本文整理汇总了C++中ObjectWrapper::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectWrapper::getName方法的具体用法?C++ ObjectWrapper::getName怎么用?C++ ObjectWrapper::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectWrapper
的用法示例。
在下文中一共展示了ObjectWrapper::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeObjectFields
void OutputStream::writeObjectFields( const osg::Object* obj )
{
std::string name = obj->libraryName();
name += std::string("::") + obj->className();
ObjectWrapper* wrapper = Registry::instance()->getObjectWrapperManager()->findWrapper( name );
if ( !wrapper )
{
OSG_INFO << "OutputStream::writeObject(): Unsupported wrapper class "
<< name << std::endl;
return;
}
_fields.push_back( name );
const StringList& associates = wrapper->getAssociates();
for ( StringList::const_iterator itr=associates.begin(); itr!=associates.end(); ++itr )
{
const std::string& assocName = *itr;
ObjectWrapper* assocWrapper = Registry::instance()->getObjectWrapperManager()->findWrapper(assocName);
if ( !assocWrapper )
{
OSG_INFO << "OutputStream::writeObject(): Unsupported associated class "
<< assocName << std::endl;
continue;
}
else if ( _useSchemaData )
{
if ( _inbuiltSchemaMap.find(assocName)==_inbuiltSchemaMap.end() )
{
StringList properties;
std::vector<int> types;
assocWrapper->writeSchema( properties, types );
unsigned int size = osg::minimum( properties.size(), types.size() );
if ( size>0 )
{
std::stringstream propertiesStream;
for ( unsigned int i=0; i<size; ++i )
{
propertiesStream << properties[i] << ":" << types[i] << " ";
}
_inbuiltSchemaMap[assocName] = propertiesStream.str();
}
}
}
_fields.push_back( assocWrapper->getName() );
assocWrapper->write( *this, *obj );
if ( getException() ) return;
_fields.pop_back();
}
_fields.pop_back();
}
示例2: writeObjectFields
void OutputStream::writeObjectFields( const osg::Object* obj )
{
std::string name = obj->libraryName();
name += std::string("::") + obj->className();
ObjectWrapper* wrapper = Registry::instance()->getObjectWrapperManager()->findWrapper( name );
if ( !wrapper )
{
OSG_WARN << "OutputStream::writeObject(): Unsupported wrapper class "
<< name << std::endl;
return;
}
_fields.push_back( name );
const StringList& associates = wrapper->getAssociates();
for ( StringList::const_iterator itr=associates.begin(); itr!=associates.end(); ++itr )
{
const std::string& assocName = *itr;
ObjectWrapper* assocWrapper = Registry::instance()->getObjectWrapperManager()->findWrapper(assocName);
if ( !assocWrapper )
{
OSG_WARN << "OutputStream::writeObject(): Unsupported associated class "
<< assocName << std::endl;
continue;
}
else if ( _useSchemaData )
{
if ( _inbuiltSchemaMap.find(assocName)==_inbuiltSchemaMap.end() )
{
StringList properties;
assocWrapper->writeSchema( properties );
if ( properties.size()>0 )
{
std::string propertiesString;
for ( StringList::iterator sitr=properties.begin(); sitr!=properties.end(); ++sitr )
{
propertiesString += *sitr;
propertiesString += ' ';
}
_inbuiltSchemaMap[assocName] = propertiesString;
}
}
}
_fields.push_back( assocWrapper->getName() );
assocWrapper->write( *this, *obj );
if ( getException() ) return;
_fields.pop_back();
}
_fields.pop_back();
}