OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
osgDB::ClassInterface Class Reference

#include <ClassInterface.h>

Collaboration diagram for osgDB::ClassInterface:
Collaboration graph
[legend]

Public Types

typedef std::map< std::string,
osgDB::BaseSerializer::Type
PropertyMap
 Properties supported for a single class. More...
 
typedef std::map< std::string,
PropertyMap
ObjectPropertyMap
 Properties supported for a range of classes, used for white and black lists. More...
 

Public Member Functions

 ClassInterface ()
 
bool getPropertyType (const osg::Object *object, const std::string &propertyName, osgDB::BaseSerializer::Type &type) const
 get the Type of the specified property, return true if property is supported, otherwise false. More...
 
bool areTypesCompatible (osgDB::BaseSerializer::Type lhs, osgDB::BaseSerializer::Type rhs) const
 return type of two types are compatible More...
 
osg::ObjectcreateObject (const std::string &compoundClassdName) const
 
template<typename T >
bool getProperty (const osg::Object *object, const std::string &propertyName, T &value)
 template method for getting property data, return true if property available and the type is compatible, otherwise returns false. More...
 
template<typename T >
bool setProperty (osg::Object *object, const std::string &propertyName, const T &value)
 template method for setting property data, return true if property available and the type is compatible, otherwise returns false. More...
 
std::string getTypeName (osgDB::BaseSerializer::Type type) const
 get the human readable name of type. More...
 
osgDB::BaseSerializer::Type getType (const std::string &typeName) const
 get the enum value of type given the human readable name. More...
 
bool getSupportedProperties (const osg::Object *object, PropertyMap &properties, bool searchAssociates=true) const
 Get the list of of properties supported by object. More...
 
bool isObjectOfType (const osg::Object *object, const std::string &compoundClassName) const
 return true if the object can be cast to the specified class specified by compoundClassName More...
 
bool run (void *objectPtr, const std::string &compoundClassName, const std::string &methodName, osg::Parameters &inputParameters, osg::Parameters &outputParameters) const
 run method of object More...
 
bool run (osg::Object *object, const std::string &methodName, osg::Parameters &inputParameters, osg::Parameters &outputParameters) const
 run method of object More...
 
bool hasMethod (const std::string &compoundClassName, const std::string &methodName) const
 checked for support of specificed method More...
 
bool hasMethod (const osg::Object *object, const std::string &methodName) const
 checked for support of specificed method More...
 
ObjectPropertyMapgetWhiteList ()
 Get the list of properties that are explicitly defined as supported. More...
 
const ObjectPropertyMapgetWhiteList () const
 Get the const list of properties that are explicitly defined as supported. More...
 
ObjectPropertyMapgetBlackList ()
 Get the list of properties that are explicitly defined as not supported. More...
 
const ObjectPropertyMapgetBlackList () const
 Get the const list of properties that are explicitly defined as not supported. More...
 
osgDB::ObjectWrappergetObjectWrapper (const osg::Object *object) const
 
osgDB::BaseSerializergetSerializer (const osg::Object *object, const std::string &propertyName, osgDB::BaseSerializer::Type &type) const
 
template<>
bool getProperty (const osg::Object *object, const std::string &propertyName, ObjectPtr &value)
 
template<>
bool setProperty (osg::Object *object, const std::string &propertyName, const ObjectPtr &value)
 

Protected Types

typedef std::map< std::string,
osgDB::BaseSerializer::Type
TypeNameToTypeMap
 
typedef std::map
< osgDB::BaseSerializer::Type,
std::string > 
TypeToTypeNameMap
 

Protected Member Functions

bool copyPropertyDataFromObject (const osg::Object *object, const std::string &propertyName, void *valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType)
 
bool copyPropertyDataToObject (osg::Object *object, const std::string &propertyName, const void *valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType)
 
bool copyPropertyObjectFromObject (const osg::Object *object, const std::string &propertyName, void *valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType)
 
bool copyPropertyObjectToObject (osg::Object *object, const std::string &propertyName, const void *valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType)
 

Protected Attributes

osgDB::OutputStream _outputStream
 
PropertyOutputIterator * _poi
 
osgDB::InputStream _inputStream
 
PropertyInputIterator * _pii
 
TypeNameToTypeMap _typeNameToTypeMap
 
TypeToTypeNameMap _typeToTypeNameMap
 
ObjectPropertyMap _whiteList
 
ObjectPropertyMap _blackList
 

Detailed Description

ClassInterface provides a general means of checking for supported properties of classes, and getting/setting thoses properties. Uses the osgDB serializers to do the actual object query/get/set.

Definition at line 121 of file ClassInterface.h.

Member Typedef Documentation

typedef std::map<std::string, PropertyMap> osgDB::ClassInterface::ObjectPropertyMap

Properties supported for a range of classes, used for white and black lists.

Definition at line 177 of file ClassInterface.h.

Properties supported for a single class.

Definition at line 154 of file ClassInterface.h.

Definition at line 213 of file ClassInterface.h.

Definition at line 214 of file ClassInterface.h.

Constructor & Destructor Documentation

osgDB::ClassInterface::ClassInterface ( )

Member Function Documentation

bool osgDB::ClassInterface::areTypesCompatible ( osgDB::BaseSerializer::Type  lhs,
osgDB::BaseSerializer::Type  rhs 
) const

return type of two types are compatible

bool osgDB::ClassInterface::copyPropertyDataFromObject ( const osg::Object object,
const std::string &  propertyName,
void *  valuePtr,
unsigned int  valueSize,
osgDB::BaseSerializer::Type  valueType 
)
protected

Here is the caller graph for this function:

bool osgDB::ClassInterface::copyPropertyDataToObject ( osg::Object object,
const std::string &  propertyName,
const void *  valuePtr,
unsigned int  valueSize,
osgDB::BaseSerializer::Type  valueType 
)
protected

Here is the caller graph for this function:

bool osgDB::ClassInterface::copyPropertyObjectFromObject ( const osg::Object object,
const std::string &  propertyName,
void *  valuePtr,
unsigned int  valueSize,
osgDB::BaseSerializer::Type  valueType 
)
protected

Here is the caller graph for this function:

bool osgDB::ClassInterface::copyPropertyObjectToObject ( osg::Object object,
const std::string &  propertyName,
const void *  valuePtr,
unsigned int  valueSize,
osgDB::BaseSerializer::Type  valueType 
)
protected

Here is the caller graph for this function:

osg::Object* osgDB::ClassInterface::createObject ( const std::string &  compoundClassdName) const

create an object of specified type for provided compound class name in the form libraryName::className.

ObjectPropertyMap& osgDB::ClassInterface::getBlackList ( )
inline

Get the list of properties that are explicitly defined as not supported.

Definition at line 186 of file ClassInterface.h.

const ObjectPropertyMap& osgDB::ClassInterface::getBlackList ( ) const
inline

Get the const list of properties that are explicitly defined as not supported.

Definition at line 189 of file ClassInterface.h.

osgDB::ObjectWrapper* osgDB::ClassInterface::getObjectWrapper ( const osg::Object object) const
template<typename T >
bool osgDB::ClassInterface::getProperty ( const osg::Object object,
const std::string &  propertyName,
T &  value 
)

template method for getting property data, return true if property available and the type is compatible, otherwise returns false.

Definition at line 225 of file ClassInterface.h.

Here is the call graph for this function:

template<>
bool osgDB::ClassInterface::getProperty ( const osg::Object object,
const std::string &  propertyName,
ObjectPtr value 
)
inline

Definition at line 246 of file ClassInterface.h.

Here is the call graph for this function:

bool osgDB::ClassInterface::getPropertyType ( const osg::Object object,
const std::string &  propertyName,
osgDB::BaseSerializer::Type type 
) const

get the Type of the specified property, return true if property is supported, otherwise false.

osgDB::BaseSerializer* osgDB::ClassInterface::getSerializer ( const osg::Object object,
const std::string &  propertyName,
osgDB::BaseSerializer::Type type 
) const
bool osgDB::ClassInterface::getSupportedProperties ( const osg::Object object,
PropertyMap properties,
bool  searchAssociates = true 
) const

Get the list of of properties supported by object.

osgDB::BaseSerializer::Type osgDB::ClassInterface::getType ( const std::string &  typeName) const

get the enum value of type given the human readable name.

std::string osgDB::ClassInterface::getTypeName ( osgDB::BaseSerializer::Type  type) const

get the human readable name of type.

ObjectPropertyMap& osgDB::ClassInterface::getWhiteList ( )
inline

Get the list of properties that are explicitly defined as supported.

Definition at line 180 of file ClassInterface.h.

const ObjectPropertyMap& osgDB::ClassInterface::getWhiteList ( ) const
inline

Get the const list of properties that are explicitly defined as supported.

Definition at line 183 of file ClassInterface.h.

bool osgDB::ClassInterface::hasMethod ( const std::string &  compoundClassName,
const std::string &  methodName 
) const

checked for support of specificed method

bool osgDB::ClassInterface::hasMethod ( const osg::Object object,
const std::string &  methodName 
) const

checked for support of specificed method

bool osgDB::ClassInterface::isObjectOfType ( const osg::Object object,
const std::string &  compoundClassName 
) const

return true if the object can be cast to the specified class specified by compoundClassName

bool osgDB::ClassInterface::run ( void *  objectPtr,
const std::string &  compoundClassName,
const std::string &  methodName,
osg::Parameters inputParameters,
osg::Parameters outputParameters 
) const

run method of object

bool osgDB::ClassInterface::run ( osg::Object object,
const std::string &  methodName,
osg::Parameters inputParameters,
osg::Parameters outputParameters 
) const

run method of object

template<typename T >
bool osgDB::ClassInterface::setProperty ( osg::Object object,
const std::string &  propertyName,
const T &  value 
)

template method for setting property data, return true if property available and the type is compatible, otherwise returns false.

Definition at line 232 of file ClassInterface.h.

Here is the call graph for this function:

template<>
bool osgDB::ClassInterface::setProperty ( osg::Object object,
const std::string &  propertyName,
const ObjectPtr value 
)
inline

Definition at line 268 of file ClassInterface.h.

Here is the call graph for this function:

Member Data Documentation

ObjectPropertyMap osgDB::ClassInterface::_blackList
protected

Definition at line 220 of file ClassInterface.h.

osgDB::InputStream osgDB::ClassInterface::_inputStream
protected

Definition at line 210 of file ClassInterface.h.

osgDB::OutputStream osgDB::ClassInterface::_outputStream
protected

Definition at line 207 of file ClassInterface.h.

PropertyInputIterator* osgDB::ClassInterface::_pii
protected

Definition at line 211 of file ClassInterface.h.

PropertyOutputIterator* osgDB::ClassInterface::_poi
protected

Definition at line 208 of file ClassInterface.h.

TypeNameToTypeMap osgDB::ClassInterface::_typeNameToTypeMap
protected

Definition at line 216 of file ClassInterface.h.

TypeToTypeNameMap osgDB::ClassInterface::_typeToTypeNameMap
protected

Definition at line 217 of file ClassInterface.h.

ObjectPropertyMap osgDB::ClassInterface::_whiteList
protected

Definition at line 219 of file ClassInterface.h.


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