NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
itimer_configuration.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2014 NVIDIA Corporation. All rights reserved.
3 //*****************************************************************************
7 //*****************************************************************************
8 
9 #ifndef MI_NEURAYLIB_ITIMER_CONFIGURATION_H
10 #define MI_NEURAYLIB_ITIMER_CONFIGURATION_H
11 
14 #include <mi/base/handle.h>
16 
17 namespace mi {
18 
19 class ISerializable;
20 
21 namespace neuraylib {
22 
27 class ITimer : public
39  mi::base::Interface_declare<0x654218a4,0xc9af,0x4c4c,0xba,0x9a,0x3a,0x16,0x8a,0xdd,0x8a,0x0f,
40  ISerializable>
41 {
42 public:
47  virtual void timer_callback() = 0;
48 };
49 
53 class ITimer_class_factory : public
54  mi::base::Interface_declare<0xed2c17d1,0xdaf0,0x4aa2,0x95,0xaf,0xfc,0x1b,0x6f,0x6a,0xf6,0x2b>
55 {
56 public:
59  virtual ITimer* create() = 0;
60 };
61 
63 template <class T>
64 class Timer_class_factory : public
65  mi::base::Interface_implement<ITimer_class_factory>
66 {
67 public:
73  ITimer* create() { return new T; }
74 };
75 
77 class ITimer_configuration : public
78  mi::base::Interface_declare<0xedad8937,0x015e,0x4ee7,0x9e,0x49,0x6a,0x22,0x83,0xbd,0xc4,0x41>
79 {
80 public:
110  virtual Sint32 start_timer(
111  const char* name, ITimer* timer, Float64 delay, bool local = false) = 0;
112 
119  virtual Sint32 stop_timer( const char* name) = 0;
120 
122  //
130  virtual bool register_timer_class( base::Uuid class_id, ITimer_class_factory* factory) = 0;
131 
133  //
142  template <class T>
144  {
146  return register_timer_class( typename T::IID(), factory.get());
147  }
148 };
149  // end group mi_neuray_configuration
151 
152 } // namespace neuraylib
153 
154 } // namespace mi
155 
156 #endif // MI_NEURAYLIB_ITIMER_CONFIGURATION_H