This class is used to start and stop timers. More...
#include <itimer_configuration.h>
Public Member Functions | |
virtual Sint32 | start_timer (const char *name, ITimer *timer, Float64 delay, bool local=false)=0 |
Starts a cluster timer to elapse once. More... | |
virtual Sint32 | stop_timer (const char *name)=0 |
Stops a timer. More... | |
virtual bool | register_timer_class (base::Uuid class_id, ITimer_class_factory *factory)=0 |
Registers a timer class with the timer configuration. More... | |
template<class T> | |
bool | register_timer_class () |
Registers a timer class with the timer configuration. More... | |
Public Member Functions inherited from mi::base::IInterface | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... | |
template<class T> | |
const T * | get_interface () const |
Acquires a const interface from another. More... | |
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... | |
template<class T> | |
T * | get_interface () |
Acquires a mutable interface from another. More... | |
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... | |
Additional Inherited Members | |
Public Types inherited from mi::base::Interface_declare< 0xedad8937, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::IInterface | |
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | IID |
Declares the interface ID (IID) of this interface. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0xedad8937, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::IInterface | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
This class is used to start and stop timers.
|
inline |
Registers a timer class with the timer configuration.
Registration is strictly necessary for non-local timers.
This templated member function is a wrapper of the non-template variant for the user's convenience. It uses T::IID()
as UUID and the default class factory mi::neuraylib::Timer_class_factory specialized for T.
true
if the class of was successfully registered for serialization, and false
otherwise.
|
pure virtual |
Registers a timer class with the timer configuration.
Registration is strictly necessary for non-local timers.
class_id | The class ID of the class that shall be registered for serialization. |
factory | The class factory. |
true
if the class of was successfully registered for serialization, and false
otherwise.
|
pure virtual |
Starts a cluster timer to elapse once.
The timer is either executed locally only or scheduled to be executed on one host in the cluster chosen by the timer system. In the latter case the timer system will guarantee that the timer will be executed even if the host starting it left the cluster before the timer elapsed.
If a named timer is started which is already running then the later time of the running and newly started timer will prevail. That is if a timer is running and would elapse after two seconds and a new start_timer() call would set it to elapse after one second, then it will elapse after two seconds. If that is not the desired behavior the timer must be stopped before starting it with a new value.
If timers are not running locally then the execution of the timer will be delayed by the time necessary to transport the timer to the remote host.
If a timer is to be executed remotely then it must be registered with the register_timer_class() function before starting it.
This method can only be used while DiCE is running.
name | The name of the timer, used to identify the timer in the cluster. |
timer | The timer which holds the callback to be called when the timer elapses. |
delay | Time in seconds after which mi::neuraylib::ITimer::timer_callback() will be called. |
local | Specifies if this is a timer which is running in the cluster (default) or only on the local node. |
NULL
pointer).
|
pure virtual |
Stops a timer.
name | The name of the timer to be stopped. |