当前位置: 首页>>代码示例>>C++>>正文


C++ NameList类代码示例

本文整理汇总了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;
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:30,代码来源:LiveScene.cpp

示例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;
}
开发者ID:danieldresser,项目名称:cortex,代码行数:34,代码来源:HoudiniScene.cpp

示例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;
	}
}
开发者ID:fwaggle,项目名称:mutter,代码行数:25,代码来源:main.cpp

示例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;
 }
开发者ID:hjqqq,项目名称:Forever,代码行数:7,代码来源:ETSplattingManager.cpp

示例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 );
	}
}
开发者ID:UIKit0,项目名称:cortex,代码行数:30,代码来源:LinkedScene.cpp

示例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);
}
开发者ID:Jesse-V,项目名称:OnioNS-common,代码行数:26,代码来源:Common.cpp

示例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;
}
开发者ID:etihwnad,项目名称:toped,代码行数:27,代码来源:calbr_reader.cpp

示例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() );
}
开发者ID:cnpinto,项目名称:cortex,代码行数:35,代码来源:LiveScene.cpp

示例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 );
		}
	}
}
开发者ID:danieldresser,项目名称:cortex,代码行数:11,代码来源:HoudiniScene.cpp

示例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();
}
开发者ID:marcelobianchi,项目名称:seiscomp3,代码行数:13,代码来源:pluginregistry.cpp

示例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 );
	}
}
开发者ID:dboogert,项目名称:cortex,代码行数:15,代码来源:MayaScene.cpp

示例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;
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:17,代码来源:LiveScene.cpp

示例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;
	}
}
开发者ID:fwaggle,项目名称:mutter,代码行数:19,代码来源:main.cpp

示例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);
    }
开发者ID:fifield,项目名称:skir,代码行数:23,代码来源:FieldDecl.hpp

示例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;
			}
		}
	}
}
开发者ID:UIKit0,项目名称:cortex,代码行数:21,代码来源:LinkedScene.cpp


注:本文中的NameList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。