OWL
|
#include <SBTObject.h>
Public Types | |
typedef std::shared_ptr< SBTObjectType > | SP |
Public Types inherited from owl::ContextObject | |
typedef std::shared_ptr< ContextObject > | SP |
Public Types inherited from owl::Object | |
typedef std::shared_ptr< Object > | SP |
Public Member Functions | |
SBTObjectType (Context *const context, ObjectRegistry ®istry, size_t varStructSize, const std::vector< OWLVarDecl > &varDecls) | |
virtual | ~SBTObjectType () |
int | getVariableIdx (const std::string &varName) |
bool | hasVariable (const std::string &varName) |
std::string | toString () const override |
void | declareVariable (const std::string &varName, OWLDataType type, size_t offset) |
std::vector< Variable::SP > | instantiateVariables () |
Public Member Functions inherited from owl::RegisteredObject | |
RegisteredObject (Context *const context, ObjectRegistry ®istry) | |
Public Member Functions inherited from owl::ContextObject | |
ContextObject (Context *const context) | |
std::string | toString () const override |
Public Member Functions inherited from owl::Object | |
Object () | |
virtual std::string | toString () const |
virtual DeviceData::SP | createOn (const std::shared_ptr< DeviceContext > &device) |
void | createDeviceData (const std::vector< std::shared_ptr< DeviceContext > > &devices) |
template<typename T > | |
std::shared_ptr< T > | as () |
Public Attributes | |
const size_t | varStructSize |
const std::vector< OWLVarDecl > | varDecls |
Public Attributes inherited from owl::RegisteredObject | |
int | ID |
ObjectRegistry & | registry |
Public Attributes inherited from owl::ContextObject | |
Context *const | context |
Public Attributes inherited from owl::Object | |
const size_t | uniqueID |
std::vector< DeviceData::SP > | deviceData |
Additional Inherited Members | |
Static Public Attributes inherited from owl::Object | |
static std::atomic< uint64_t > | nextAvailableID |
base class for describing the 'type' (eg, set of named variabels, progrma name, etc) of anything that can store variables, and that will eithe be written into the SBT, or other device representations. Object types store the description of objects (eg, which variables they have, and how those are layouted in device memory, while actual objects (basically, the equivalent of C++ instances of tihs type) then store the values* for the given type
|
virtual |
clean up; in particular, frees the vardecls
void owl::SBTObjectType::declareVariable | ( | const std::string & | varName, |
OWLDataType | type, | ||
size_t | offset | ||
) |
add a new variable of given type and name, and with given byte offset within the device representation of this class
int owl::SBTObjectType::getVariableIdx | ( | const std::string & | varName | ) |
find index of variable with given name, or -1 if not exists
bool owl::SBTObjectType::hasVariable | ( | const std::string & | varName | ) |
check if we have this variable (to error out if app tries to set variable that we do not own
std::vector< Variable::SP > owl::SBTObjectType::instantiateVariables | ( | ) |
create a set of actual instances of the variables of this type, to be attached to an actual object of this type, so this object can then store variable values
create one instance each of a given type's variables
|
overridevirtual |
pretty-printer, for printf-debugging
pretty-typecast into derived classes
Reimplemented from owl::ContextObject.
Reimplemented in owl::SphereGeomType, owl::TrianglesGeomType, and owl::UserGeomType.
const std::vector<OWLVarDecl> owl::SBTObjectType::varDecls |
the high-level semantic description of variables in the variables struct
const size_t owl::SBTObjectType::varStructSize |
the total size of the variables struct