OpenSceneGraph
3.4.0
|
ClassInterface provides a general means of checking for supported properties of classes, and getting/setting thoses properties. More...
Public Types | |
typedef std::map< std::string, osgDB::BaseSerializer::Type > | PropertyMap |
Properties supported for a single class. | |
typedef std::map< std::string, PropertyMap > | ObjectPropertyMap |
Properties supported for a range of classes, used for white and black lists. | |
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. | |
bool | areTypesCompatible (osgDB::BaseSerializer::Type lhs, osgDB::BaseSerializer::Type rhs) const |
return type of two types are compatible | |
osg::Object * | createObject (const std::string &compoundClassdName) const |
create an object of specified type for provided compound class name in the form libraryName::className. | |
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. | |
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. | |
std::string | getTypeName (osgDB::BaseSerializer::Type type) const |
get the human readable name of type. | |
osgDB::BaseSerializer::Type | getType (const std::string &typeName) const |
get the enum value of type given the human readable name. | |
bool | getSupportedProperties (const osg::Object *object, PropertyMap &properties, bool searchAssociates=true) const |
Get the list of of properties supported by object. | |
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 | |
bool | run (void *objectPtr, const std::string &compoundClassName, const std::string &methodName, osg::Parameters &inputParameters, osg::Parameters &outputParameters) const |
run method of object | |
bool | run (osg::Object *object, const std::string &methodName, osg::Parameters &inputParameters, osg::Parameters &outputParameters) const |
run method of object | |
bool | hasMethod (const std::string &compoundClassName, const std::string &methodName) const |
checked for support of specificed method | |
bool | hasMethod (const osg::Object *object, const std::string &methodName) const |
checked for support of specificed method | |
ObjectPropertyMap & | getWhiteList () |
Get the list of properties that are explicitly defined as supported. | |
const ObjectPropertyMap & | getWhiteList () const |
Get the const list of properties that are explicitly defined as supported. | |
ObjectPropertyMap & | getBlackList () |
Get the list of properties that are explicitly defined as not supported. | |
const ObjectPropertyMap & | getBlackList () const |
Get the const list of properties that are explicitly defined as not supported. | |
osgDB::ObjectWrapper * | getObjectWrapper (const osg::Object *object) const |
osgDB::BaseSerializer * | getSerializer (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 |
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.
typedef std::map<std::string, PropertyMap> osgDB::ClassInterface::ObjectPropertyMap |
Properties supported for a range of classes, used for white and black lists.
typedef std::map<std::string, osgDB::BaseSerializer::Type> osgDB::ClassInterface::PropertyMap |
Properties supported for a single class.
typedef std::map<std::string, osgDB::BaseSerializer::Type> osgDB::ClassInterface::TypeNameToTypeMap [protected] |
typedef std::map<osgDB::BaseSerializer::Type, std::string> osgDB::ClassInterface::TypeToTypeNameMap [protected] |
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] |
Referenced by getProperty().
bool osgDB::ClassInterface::copyPropertyDataToObject | ( | osg::Object * | object, |
const std::string & | propertyName, | ||
const void * | valuePtr, | ||
unsigned int | valueSize, | ||
osgDB::BaseSerializer::Type | valueType | ||
) | [protected] |
Referenced by setProperty().
bool osgDB::ClassInterface::copyPropertyObjectFromObject | ( | const osg::Object * | object, |
const std::string & | propertyName, | ||
void * | valuePtr, | ||
unsigned int | valueSize, | ||
osgDB::BaseSerializer::Type | valueType | ||
) | [protected] |
Referenced by getProperty().
bool osgDB::ClassInterface::copyPropertyObjectToObject | ( | osg::Object * | object, |
const std::string & | propertyName, | ||
const void * | valuePtr, | ||
unsigned int | valueSize, | ||
osgDB::BaseSerializer::Type | valueType | ||
) | [protected] |
Referenced by setProperty().
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.
const ObjectPropertyMap& osgDB::ClassInterface::getBlackList | ( | ) | const [inline] |
Get the const list of properties that are explicitly defined as not supported.
osgDB::ObjectWrapper* osgDB::ClassInterface::getObjectWrapper | ( | const osg::Object * | object | ) | const |
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.
References copyPropertyDataFromObject().
bool osgDB::ClassInterface::getProperty | ( | const osg::Object * | object, |
const std::string & | propertyName, | ||
ObjectPtr & | value | ||
) | [inline] |
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.
const ObjectPropertyMap& osgDB::ClassInterface::getWhiteList | ( | ) | const [inline] |
Get the const list of properties that are explicitly defined as supported.
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
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.
References copyPropertyDataToObject().
bool osgDB::ClassInterface::setProperty | ( | osg::Object * | object, |
const std::string & | propertyName, | ||
const ObjectPtr & | value | ||
) | [inline] |
References osg::UserDataContainer::addUserObject(), osg::Object::className(), copyPropertyObjectToObject(), osg::Object::getOrCreateUserDataContainer(), osg::UserDataContainer::getUserObject(), osg::UserDataContainer::getUserObjectIndex(), OSG_INFO, osgDB::BaseSerializer::RW_IMAGE, osg::Object::setName(), and osg::UserDataContainer::setUserObject().
ObjectPropertyMap osgDB::ClassInterface::_blackList [protected] |
PropertyInputIterator* osgDB::ClassInterface::_pii [protected] |
PropertyOutputIterator* osgDB::ClassInterface::_poi [protected] |
ObjectPropertyMap osgDB::ClassInterface::_whiteList [protected] |
![]() | Generated at Tue Dec 8 2015 00:14:27 for the OpenSceneGraph by doxygen 1.7.6.1. |