Iray SDK API nvidia_logo_transpbg.gif Up
itimer_configuration.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
7
8#ifndef MI_NEURAYLIB_ITIMER_CONFIGURATION_H
9#define MI_NEURAYLIB_ITIMER_CONFIGURATION_H
10
13#include <mi/base/handle.h>
15
16namespace mi {
17
18namespace neuraylib {
19
20class ISerializable;
21
37class ITimer : public
38 mi::base::Interface_declare<0x654218a4,0xc9af,0x4c4c,0xba,0x9a,0x3a,0x16,0x8a,0xdd,0x8a,0x0f,
39 neuraylib::ISerializable>
40{
41public:
46 virtual void timer_callback() = 0;
47};
48
53 mi::base::Interface_declare<0xed2c17d1,0xdaf0,0x4aa2,0x95,0xaf,0xfc,0x1b,0x6f,0x6a,0xf6,0x2b>
54{
55public:
58 virtual ITimer* create() = 0;
59};
60
63template <class T>
64class Timer_class_factory : public
65 mi::base::Interface_implement<neuraylib::ITimer_class_factory>
66{
67public:
73 ITimer* create() { return new T; }
74};
75
78 mi::base::Interface_declare<0xedad8937,0x015e,0x4ee7,0x9e,0x49,0x6a,0x22,0x83,0xbd,0xc4,0x41>
79{
80public:
114 const char* name, ITimer* timer, Float64 delay, bool local = false) = 0;
115
122 virtual Sint32 stop_timer( const char* name) = 0;
123
125 //
133 virtual bool register_timer_class( base::Uuid class_id, ITimer_class_factory* factory) = 0;
134
136 //
145 template <class T>
147 {
149 return register_timer_class( typename T::IID(), factory.get());
150 }
151};
152 // end group mi_neuray_configuration
154
155} // namespace neuraylib
156
157} // namespace mi
158
159#endif // MI_NEURAYLIB_ITIMER_CONFIGURATION_H
Handle class template for interfaces, automatizing the lifetime control via reference counting.
Definition: handle.h:113
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Mixin class template for deriving interface implementations.
Definition: interface_implement.h:41
The registration of a timer class requires a factory which constructs an instance during deserializat...
Definition: itimer_configuration.h:54
virtual ITimer * create()=0
Creates an instance of the class for which the factory was registered.
This class is used to start and stop timers.
Definition: itimer_configuration.h:79
bool register_timer_class()
Registers a timer class with the timer configuration.
Definition: itimer_configuration.h:146
virtual bool register_timer_class(base::Uuid class_id, ITimer_class_factory *factory)=0
Registers a timer class with the timer configuration.
virtual Sint32 stop_timer(const char *name)=0
Stops a timer.
virtual Sint32 start_timer(const char *name, ITimer *timer, Float64 delay, bool local=false)=0
Starts a cluster timer to elapse once.
This is an abstract interface class for a timer.
Definition: itimer_configuration.h:40
virtual void timer_callback()=0
This function is called when the timer elapses.
This mixin class provides a default implementation of the mi::neuraylib::ITimer_class_factory interfa...
Definition: itimer_configuration.h:66
ITimer * create()
Creates an instance of the class for which the factory was registered.
Definition: itimer_configuration.h:73
Interface * get() const
Access to the interface. Returns 0 for an invalid interface.
Definition: handle.h:294
double Float64
64-bit float.
Definition: types.h:52
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Smart-pointer handle class for interfaces, const and non-const version.
Mixin class template for deriving new interface declarations.
Mixin class template for deriving interface implementations.
Serialization of objects to a byte stream.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179
A 128 bit representation of a universally unique identifier (UUID or GUID).
Definition: uuid.h:26