NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ineuray.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2014 NVIDIA Corporation. All rights reserved.
3 //*****************************************************************************
6 //*****************************************************************************
7 
8 #ifndef MI_NEURAYLIB_INEURAY_H
9 #define MI_NEURAYLIB_INEURAY_H
10 
12 
13 // X11/Xlib.h defines Status to int
14 #ifdef _XLIB_H_
15 #undef Status
16 #endif // _XLIB_H_
17 
18 namespace mi {
19 
20 namespace neuraylib {
21 
41 class INeuray : public
44  mi::base::Interface_declare<0x66c653e4,0xc03b,0x4a66,0xad,0x47,0xb0,0x55,0x37,0x94,0x2d,0xd6>
45 {
46 public:
50  virtual Uint32 get_interface_version() const = 0;
51 
56  virtual const char* get_version() const = 0;
57 
58  // Startup and shutdown
59 
84  virtual Sint32 start( bool blocking = true) = 0;
85 
89  enum Status
90  {
94  STARTING = 1,
96  STARTED = 2,
100  SHUTDOWN = 4,
102  FAILURE = 5,
103  // Undocumented, for alignment only.
104  FORCE_32_BIT = 0xffffffffU
105  };
106 
128  virtual Sint32 shutdown( bool blocking = true) = 0;
129 
133  virtual Status get_status() const = 0;
134 
145  virtual base::IInterface* get_api_component( const base::Uuid& uuid) const = 0;
146 
159  template<class T>
160  T* get_api_component() const
161  {
162  base::IInterface* ptr_iinterface = get_api_component( typename T::IID());
163  if ( !ptr_iinterface)
164  return 0;
165  T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
166  ptr_iinterface->release();
167  return ptr_T;
168  }
169 
184  const base::Uuid& uuid, base::IInterface* api_component) = 0;
185 
200  template<class T>
201  Sint32 register_api_component( T* api_component)
202  {
203  return register_api_component( typename T::IID(), api_component);
204  }
205 
214  virtual Sint32 unregister_api_component( const base::Uuid& uuid) = 0;
215 
227  template<class T>
229  {
230  return unregister_api_component( typename T::IID());
231  }
232 };
233 
234 mi_static_assert( sizeof( INeuray::Status) == sizeof( Uint32));
235  // end group mi_neuray_ineuray
237 
238 } // namespace neuraylib
239 
240 } // namespace mi
241 
242 // X11/Xlib.h defines Status to int
243 #ifdef _XLIB_H_
244 #define Status int
245 #endif // _XLIB_H_
246 
247 #endif // MI_NEURAYLIB_INEURAY_H