NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::ITimer_configuration Class Referenceabstract

This class is used to start and stop timers. More...

Inheritance diagram for mi::neuraylib::ITimer_configuration:
Inheritance graph
[legend]

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...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xedad8937, 0x015e, 0x4ee7, 0x9e, 0x49, 0x6a, 0x22, 0x83, 0xbd, 0xc4, 0x41 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xedad8937, 0x015e, 0x4ee7, 0x9e, 0x49, 0x6a, 0x22, 0x83, 0xbd, 0xc4, 0x41 >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

This class is used to start and stop timers.

Member Function Documentation

virtual bool mi::neuraylib::ITimer_configuration::register_timer_class ( base::Uuid  class_id,
ITimer_class_factory factory 
)
pure virtual

Registers a timer class with the timer configuration.

Registration is strictly necessary for non-local timers.

Parameters
class_id The class ID of the class that shall be registered for serialization.
factory The class factory.
Returns
true if the class of was successfully registered for serialization, and false otherwise.
template<class T >
bool mi::neuraylib::ITimer_configuration::register_timer_class ( )
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.

Returns
true if the class of was successfully registered for serialization, and false otherwise.
virtual Sint32 mi::neuraylib::ITimer_configuration::start_timer ( const char *  name,
ITimer timer,
Float64  delay,
bool  local = false 
)
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 Iray is running.

Parameters
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.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: The timer class is not registered.
  • -3: The method cannot be called at this point of time.
virtual Sint32 mi::neuraylib::ITimer_configuration::stop_timer ( const char *  name)
pure virtual

Stops a timer.

Parameters
name The name of the timer to be stopped.
Returns
  • 0: Success.
  • -1: Invalid parameters (e.g. unknown name).