NVIDIA Iray API Home  Up
 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, 2016 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 #include <mi/neuraylib/version.h>
17 
18 namespace mi {
19 
20 namespace neuraylib {
21 
22 class ISerializable;
23 
28 class ITimer : public
40  mi::base::Interface_declare<0x654218a4,0xc9af,0x4c4c,0xba,0x9a,0x3a,0x16,0x8a,0xdd,0x8a,0x0f,
41  neuraylib::ISerializable>
42 {
43 public:
48  virtual void timer_callback() = 0;
49 };
50 
54 class ITimer_class_factory : public
55  mi::base::Interface_declare<0xed2c17d1,0xdaf0,0x4aa2,0x95,0xaf,0xfc,0x1b,0x6f,0x6a,0xf6,0x2b>
56 {
57 public:
60  virtual ITimer* create() = 0;
61 };
62 
65 template <class T>
66 class Timer_class_factory : public
67  mi::base::Interface_implement<neuraylib::ITimer_class_factory>
68 {
69 public:
75  ITimer* create() { return new T; }
76 };
77 
79 class ITimer_configuration : public
80  mi::base::Interface_declare<0xedad8937,0x015e,0x4ee7,0x9e,0x49,0x6a,0x22,0x83,0xbd,0xc4,0x41>
81 {
82 public:
115  virtual Sint32 start_timer(
116  const char* name, ITimer* timer, Float64 delay, bool local = false) = 0;
117 
124  virtual Sint32 stop_timer( const char* name) = 0;
125 
127  //
135  virtual bool register_timer_class( base::Uuid class_id, ITimer_class_factory* factory) = 0;
136 
138  //
147  template <class T>
149  {
151  return register_timer_class( typename T::IID(), factory.get());
152  }
153 };
154  // end group mi_neuray_configuration
156 
157 } // namespace neuraylib
158 
159 #ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
160 using neuraylib::ISerializable;
161 #endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
162 
163 } // namespace mi
164 
165 #endif // MI_NEURAYLIB_ITIMER_CONFIGURATION_H