本文整理汇总了C++中Parm::GetGroupName方法的典型用法代码示例。如果您正苦于以下问题:C++ Parm::GetGroupName方法的具体用法?C++ Parm::GetGroupName怎么用?C++ Parm::GetGroupName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parm
的用法示例。
在下文中一共展示了Parm::GetGroupName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindParm
//==== Find Parm ID Given GroupName and Parm Name ====//
string ParmContainer::FindParm( const string& parm_name, const string& group_name )
{
string id;
map< string, vector< string > >::iterator iter;
iter = m_GroupParmMap.find( group_name );
if ( iter != m_GroupParmMap.end() )
{
//==== Look For Parm Name ====//
vector< string > pid_vec = iter->second;
for ( int i = 0 ; i < (int)pid_vec.size() ; i++ )
{
Parm* p = ParmMgr.FindParm( pid_vec[i] );
if ( p->GetName() == parm_name )
return pid_vec[i];
}
}
//==== Look Thru All Parms And Return First Name Match ====//
for ( int i = 0 ; i < ( int )m_ParmVec.size() ; i++ )
{
Parm* p = ParmMgr.FindParm( m_ParmVec[i] );
if ( p )
{
if ( p->GetName() == parm_name && p->GetGroupName() == group_name )
{
return p->GetID();
}
}
}
return id;
}
示例2: LoadGroupParmVec
//==== Load Parm Vec, Find Groups And Sort ====//
void ParmContainer::LoadGroupParmVec( vector< string > & parm_vec, bool displaynames )
{
m_GroupNames.clear();
m_GroupParmMap.clear();
//==== Map Parms To Group Names ====//
for ( int i = 0 ; i < ( int )parm_vec.size() ; i++ )
{
string pid = parm_vec[i];
Parm* p = ParmMgr.FindParm( pid );
if ( p )
{
string group_name;
if( displaynames )
{
group_name = p->GetDisplayGroupName();
}
else
{
group_name = p->GetGroupName();
}
m_GroupParmMap[group_name].push_back( pid );
}
}
map< string, vector< string > >::iterator iter;
for ( iter = m_GroupParmMap.begin() ; iter != m_GroupParmMap.end() ; iter++ )
{
m_GroupNames.push_back( iter->first );
sort( iter->second.begin(), iter->second.end(), ParmNameCompare );
}
}
示例3: AddUserParm
string LinkMgrSingleton::AddUserParm(int type, const string & name, const string & group )
{
//==== Check For Duplicate ====//
int num_parms = GetNumUserParms() - GetNumPredefinedUserParms();
for ( int i = 0 ; i < num_parms ; i++ )
{
string pid = LinkMgr.GetUserParmId( i + GetNumPredefinedUserParms() );
Parm* pptr = ParmMgr.FindParm( pid );
if ( pptr && pptr->GetName() == name && pptr->GetGroupName() == group )
{
return string();
}
}
return m_UserParms.AddParm( type, name, group );
}