OSVR-Core
Public Member Functions | List of all members
osvr::clientkit::Interface Class Reference

Interface handle object. More...

#include <Interface_decl.h>

Public Member Functions

 Interface (ClientContext &ctx, OSVR_ClientInterface iface)
 Constructs an Interface object from an OSVR_ClientInterface object. More...
 
 Interface ()
 Empty constructor.
 
bool notEmpty () const
 Determine if this interface object is empty (that is, was it once initialized). More...
 
OSVR_ClientInterface get ()
 Get the raw OSVR_ClientInterface from this wrapper.
 
ClientContextgetContext ()
 Get the associated ClientContext.
 
void free ()
 Manually free the interface before the context is closed. More...
 
void takeOwnership (util::boost_util::DeletablePtr const &obj)
 Take (shared) ownership of some Deletable object.
 

Detailed Description

Interface handle object.

Typically acquired from a ClientContext.

May be freely passed around and copied, as it does not confer ownership in the underlying interface object - that is maintained by the ClientContext. You may request, however, that ClientContext destroy the underlying interface object before it normally would (at context destruction).

Constructor & Destructor Documentation

§ Interface()

osvr::clientkit::Interface::Interface ( ClientContext ctx,
OSVR_ClientInterface  iface 
)
inline

Constructs an Interface object from an OSVR_ClientInterface object.

Member Function Documentation

§ free()

void osvr::clientkit::Interface::free ( )
inline

Manually free the interface before the context is closed.

This is not required, but can be used, for instance, to ensure that a callback is not called with a reference to an already-deleted object.

This will make use of this and any other copies of this Interface object illegal!

Exceptions
std::logic_errorif the interface is null or already freed.

§ notEmpty()

bool osvr::clientkit::Interface::notEmpty ( ) const
inline

Determine if this interface object is empty (that is, was it once initialized).

Does not determine if it has already been freed (see free())


The documentation for this class was generated from the following files: