neuray API Programmer's Manual

ineuray.h File Reference

Description

Main Neuray API interface.

Code Example

ineuray.h

‎//*****************************************************************************
// Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
//*****************************************************************************
//*****************************************************************************

#ifndef MI_NEURAYLIB_INEURAY_H
#define MI_NEURAYLIB_INEURAY_H

#include <mi/base/interface_declare.h>
#include <mi/neuraylib/version.h>

// X11/Xlib.h defines Status to int
#if defined(_XLIB_H_) || defined(_X11_XLIB_H_)
#undef Status
#endif // _XLIB_H_ || _X11_XLIB_H_

namespace mi {

namespace neuraylib {



class INeuray : public
    mi::base::Interface_declare<0x66c653e4,0xc03b,0x4a66,0xad,0x47,0xb0,0x55,0x37,0x94,0x2d,0xd6>
{
public:
    virtual Uint32 
               get_interface_version() const = 0;

    virtual const char* get_version() const = 0;

    // Startup and shutdown

    virtual Sint32 
               start( bool blocking = true) = 0;

    enum Status
    {
        PRE_STARTING     = 0,
        STARTING         = 1,
        STARTED          = 2,
        SHUTTINGDOWN     = 3,
        SHUTDOWN         = 4,
        FAILURE          = 5,
        //  Undocumented, for alignment only.
        FORCE_32_BIT     = 0xffffffffU
    };

    virtual Sint32 
               shutdown( bool blocking = true) = 0;

    virtual Status 
               get_status() const = 0;

    virtual base::IInterface* get_api_component( const base::Uuid& uuid) const = 0;

    template<class T>
    T* get_api_component() const
    {
        base::IInterface* ptr_iinterface = get_api_component( typename T::IID());
        if ( !ptr_iinterface)
            return 0;
        T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
        ptr_iinterface->release();
        return ptr_T;
    }

    virtual Sint32 
               register_api_component(
        const base::Uuid& uuid, base::IInterface* api_component) = 0;

    template<class T>
    Sint32 
               register_api_component( T* api_component)
    {
        return register_api_component( typename T::IID(), api_component);
    }

    virtual Sint32 
               unregister_api_component( const base::Uuid& uuid) = 0;

    template<class T>
    Sint32 
               unregister_api_component()
    {
        return unregister_api_component( typename T::IID());
    }
};

mi_static_assert( sizeof( INeuray::Status) == sizeof( Uint32));
 // end group mi_neuray_ineuray

} // namespace neuraylib

} // namespace mi

// X11/Xlib.h defines Status to int
#if defined(_XLIB_H_) || defined(_X11_XLIB_H_)
#define Status int
#endif // _XLIB_H_ || _X11_XLIB_H_

#endif // MI_NEURAYLIB_INEURAY_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...
namespace 
Namespace for the neuray API. More...

Classes

class 
This is an object representing the . More...