本文整理汇总了C++中NameList类的典型用法代码示例。如果您正苦于以下问题:C++ NameList类的具体用法?C++ NameList怎么用?C++ NameList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NameList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Exception
bool LiveScene::hasAttribute( const Name &name ) const
{
if ( !m_isRoot && m_dagPath.length() == 0 )
{
throw Exception( "IECoreMaya::LiveScene::hasAttribute: Dag path no longer exists!" );
}
if( name == SceneInterface::visibilityName )
{
return true;
}
std::vector< CustomAttributeReader > &attributeReaders = customAttributeReaders();
for ( std::vector< CustomAttributeReader >::const_iterator it = attributeReaders.begin(); it != attributeReaders.end(); ++it )
{
NameList names;
{
// call it->m_names under a mutex, as it could be reading plug values,
// which isn't thread safe:
tbb::mutex::scoped_lock l( s_mutex );
it->m_names( m_dagPath, names );
}
if ( std::find(names.begin(), names.end(), name) != names.end() )
{
return true;
}
}
return false;
}
示例2: retrieveNode
Imath::Box3d HoudiniScene::readBound( double time ) const
{
OP_Node *node = retrieveNode( true );
Imath::Box3d bounds;
UT_BoundingBox box;
OP_Context context( time );
/// \todo: this doesn't account for SOPs containing multiple shapes
/// if we fix it, we need to fix the condition below as well
if ( node->getBoundingBox( box, context ) )
{
bounds = IECore::convert<Imath::Box3d>( box );
}
// paths embedded within a sop already have bounds accounted for
if ( m_contentIndex )
{
return bounds;
}
NameList children;
childNames( children );
for ( NameList::iterator it=children.begin(); it != children.end(); ++it )
{
ConstSceneInterfacePtr childScene = child( *it );
Imath::Box3d childBound = childScene->readBound( time );
if ( !childBound.isEmpty() )
{
bounds.extendBy( Imath::transform( childBound, childScene->readTransformAsMatrix( time ) ) );
}
}
return bounds;
}
示例3: user_pass
void
user_pass(char *username)
{
NameList name;
IdMap users;
ServerPrx server;
server = meta->getServer(serverId, ctx);
name.push_back(username);
users = server->getUserIds(name, ctx);
if (users[username] < 0)
throw "Invalid User";
else
{
UserInfoMap uinfo = server->getRegistration(users[username], ctx);
cout << "Enter new password for " << uinfo[UserName] << ": ";
string pass;
getline(cin, pass);
uinfo[UserPassword] = pass;
server->updateRegistration(users[username], uinfo, ctx);
cout << "Password Updated!" << endl;
}
}
示例4: getMapTextureNames
NameList SplattingManager::getMapTextureNames() const
{
NameList names;
for (size_t i = 0; i < mImpl->maps.size(); ++i)
names.push_back(mImpl->maps[i]->getName());
return names;
}
示例5: Exception
void LinkedScene::readTags( NameList &tags, int filter ) const
{
if ( filter!=SceneInterface::LocalTag && !m_readOnly )
{
throw Exception( "readTags with filter != LocalTag is only supported when reading the scene file!" );
}
if ( m_linkedScene )
{
m_linkedScene->readTags( tags, filter );
/// Only queries ancestor tags and local tags (if at the link location) from the main scene.
int mainFilter = filter & ( SceneInterface::AncestorTag | ( m_atLink ? SceneInterface::LocalTag : 0 ) );
if ( !m_atLink && (filter & SceneInterface::AncestorTag) )
{
/// child locations inside the link consider all the local tags at the link location as ancestor tags as well.
mainFilter |= SceneInterface::LocalTag;
}
if ( mainFilter )
{
NameList mainTags;
m_mainScene->readTags( mainTags, mainFilter );
tags.insert( tags.end(), mainTags.begin(), mainTags.end() );
}
}
else
{
m_mainScene->readTags( tags, filter );
}
}
示例6: assembleRecord
RecordPtr Common::assembleRecord(const Json::Value& rVal)
{
auto contact = rVal["contact"].asString();
auto nonce = rVal["nonce"].asString();
auto pow = rVal["pow"].asString();
auto pubHSKey = rVal["pubHSKey"].asString();
auto sig = rVal["recordSig"].asString();
auto type = rVal["type"].asString();
auto name = rVal["name"].asString();
if (type != "Create")
Log::get().error("Record parsing: not a Create Record!");
NameList subdomains;
if (rVal.isMember("subd"))
{
Json::Value list = rVal["subd"];
auto sources = list.getMemberNames();
for (auto source : sources)
subdomains.push_back(std::make_pair(source, list[source].asString()));
}
auto key = Utils::base64ToRSA(pubHSKey);
return std::make_shared<CreateR>(contact, name, subdomains, nonce, pow, sig,
key);
}
示例7: NameList
const clbr::RuleNameMap* clbr::DrcLibrary::rules()
{
RuleNameMap* ruleMap = DEBUG_NEW clbr::RuleNameMap();
for (CellMap::const_iterator wc = _cells.begin(); wc != _cells.end(); wc++)
{
std::string cellName = wc->first;
const RuleMap* cRules = wc->second->rules();
for (RuleMap::const_iterator wr = cRules->begin(); wr != cRules->end(); wr++)
{
std::string ruleName = wr->first;
NameList* cellNames;
if (ruleMap->end() == ruleMap->find(ruleName))
{
cellNames = DEBUG_NEW NameList();
(*ruleMap)[ruleName] = cellNames;
}
else
cellNames = (*ruleMap)[ruleName];
cellNames->push_back(cellName);
}
}
for (RuleNameMap::iterator wr = ruleMap->begin(); wr != ruleMap->end(); wr++)
{
wr->second->unique();
}
return ruleMap;
}
示例8: attributeNames
void LiveScene::attributeNames( NameList &attrs ) const
{
if( !m_isRoot && m_dagPath.length() == 0 )
{
throw Exception( "IECoreMaya::LiveScene::attributeNames: Dag path no longer exists!" );
}
tbb::mutex::scoped_lock l( s_mutex );
attrs.clear();
attrs.push_back( SceneInterface::visibilityName );
// translate attributes with names starting with "ieAttr_":
MFnDependencyNode fnNode( m_dagPath.node() );
unsigned int n = fnNode.attributeCount();
for( unsigned int i=0; i<n; i++ )
{
MObject attr = fnNode.attribute( i );
MFnAttribute fnAttr( attr );
MString attrName = fnAttr.name();
if( attrName.length() > 7 && ( strstr( attrName.asChar(),"ieAttr_" ) == attrName.asChar() ) )
{
attrs.push_back( ( "user:" + attrName.substring( 7, attrName.length()-1 ) ).asChar() );
}
}
// add attributes from custom readers:
for ( std::vector< CustomAttributeReader >::const_iterator it = customAttributeReaders().begin(); it != customAttributeReaders().end(); it++ )
{
it->m_names( m_dagPath, attrs );
}
// remove duplicates:
std::sort( attrs.begin(), attrs.end() );
attrs.erase( std::unique( attrs.begin(), attrs.end() ), attrs.end() );
}
示例9: attributeNames
void HoudiniScene::attributeNames( NameList &attrs ) const
{
attrs.clear();
for ( std::map<Name, CustomReader>::const_iterator it = customAttributeReaders().begin(); it != customAttributeReaders().end(); ++it )
{
if ( it->second.m_has( retrieveNode() ) )
{
attrs.push_back( it->first );
}
}
}
示例10: catch
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
int PluginRegistry::loadConfiguredPlugins(const Config::Config *config) {
try { _pluginNames = config->getStrings("core.plugins"); }
catch ( ... ) {}
try {
NameList appPlugins = config->getStrings("plugins");
_pluginNames.insert(_pluginNames.end(), appPlugins.begin(), appPlugins.end());
}
catch ( ... ) {}
return loadPlugins();
}
示例11: attributeNames
void MayaScene::attributeNames( NameList &attrs ) const
{
if( !m_isRoot && m_dagPath.length() == 0 )
{
throw Exception( "MayaScene::attributeNames: Dag path no longer exists!" );
}
tbb::mutex::scoped_lock l( s_mutex );
attrs.clear();
attrs.push_back( SceneInterface::visibilityName );
for ( std::vector< CustomAttributeReader >::const_iterator it = customAttributeReaders().begin(); it != customAttributeReaders().end(); it++ )
{
it->m_names( m_dagPath, attrs );
}
}
示例12: retrieveNode
bool LiveScene::hasAttribute( const Name &name ) const
{
OP_Node *node = retrieveNode();
const std::vector<CustomAttributeReader> &attributeReaders = customAttributeReaders();
for ( std::vector<CustomAttributeReader>::const_iterator it = attributeReaders.begin(); it != attributeReaders.end(); ++it )
{
NameList names;
it->m_names( node, names );
if ( std::find( names.begin(), names.end(), name ) != names.end() )
{
return true;
}
}
return false;
}
示例13: user_delete
void
user_delete(char *username)
{
NameList name;
IdMap users;
ServerPrx server;
server = meta->getServer(serverId, ctx);
name.push_back(username);
users = server->getUserIds(name, ctx);
if (users[username] < 0)
throw "Invalid User";
else
{
server->unregisterUser(users[username], ctx);
cout << username << " deleted." << endl;
}
}
示例14: FieldDecl
/**
* Create a new field declaration with exactly one variable in it.
* If the field is uninitialized, the initializer may be
* <code>null</code>.
*
* @param context Context indicating what line and file this
* field is created at
* @param type Type of the field
* @param name Name of the field
* @param init Expression initializing the field, or
* <code>null</code> if the field is uninitialized
*/
FieldDecl(FEContext *context, Type *type, string name,
Expression *init) : FENode(context)
{
types = new TypeList;
names = new NameList;
inits = new ExpressionList;
types->push_back(type);
names->push_back(name);
inits->push_back(init);
}
示例15: attributeNames
void LinkedScene::attributeNames( NameList &attrs ) const
{
if ( m_linkedScene && !m_atLink )
{
m_linkedScene->attributeNames(attrs);
}
else
{
m_mainScene->attributeNames(attrs);
for ( NameList::iterator it = attrs.begin(); it != attrs.end(); it++ )
{
// \todo: remove "*it == linkAttribute" when it's no longer relevant
if ( *it == linkAttribute || *it == fileNameLinkAttribute || *it == rootLinkAttribute || *it == timeLinkAttribute )
{
attrs.erase( it );
--it;
}
}
}
}