本文整理汇总了C++中Param::Name方法的典型用法代码示例。如果您正苦于以下问题:C++ Param::Name方法的具体用法?C++ Param::Name怎么用?C++ Param::Name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Param
的用法示例。
在下文中一共展示了Param::Name方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ByName
// **************************************************************************
// Function: Add
// Purpose: adds a new parameter to the list of parameters
// if a parameter with the same name already exists,
// it updates the currently stored parameter with the provided values
// Parameters: inParam - reference to a Param object representing the
// parameter,
// inSortingHint - float value used as an additional sorting
// criterion.
// Returns: N/A
// **************************************************************************
void
ParamList::Add( const Param& inParam, float inSortingHint )
{
ByName( inParam.Name() );
ParamEntry& entry = mParams[inParam.Name()];
entry.Param = inParam;
entry.SortingHint = inSortingHint;
}
示例2: linestream
// **************************************************************************
// Function: Add
// Purpose: adds a new parameter to the list of parameters
// if a parameter with the same name already exists,
// it updates the currently stored parameter with the provided values
// Parameters: inLine - ASCII string, as defined in project description,
// defining this parameter
// Returns: true if inLine is a correct parameter line, false otherwise
// **************************************************************************
bool
ParamList::Add( const string& inLine )
{
istringstream linestream( inLine );
Param param;
if( linestream >> param )
ByName( param.Name() ) = param;
return linestream;
}
示例3: Clear
// **************************************************************************
// Function: ReadFromStream
// Purpose: Member function for formatted stream input of the entire
// parameter list. The list is cleared before reading.
// For partial input, use another instance of type ParamList
// to hold the desired subset as in ParamList::LoadParameterList().
// All formatted input functions are, for consistency's sake,
// supposed to use this function.
// Parameters: Input stream to read from.
// Returns: Input stream.
// **************************************************************************
istream&
ParamList::ReadFromStream( istream& is )
{
Clear();
Param param;
is >> ws;
while( !is.eof() && is >> param >> ws )
ByName( param.Name() ) = param;
return is;
}
示例4:
bool
CoreModule::HandleParam( istream& is )
{
if( mpStatevector && mpStatevector->StateValue( "Running" ) )
BCIERR << "Unexpected Param message" << endl;
Param p;
if( p.ReadBinary( is ) )
mParamlist[ p.Name() ] = p;
return is;
}
示例5:
bool
CoreModule::HandleParam( istream& is )
{
if( mRunning )
bcierr << "Unexpected Param message" << endl;
ParamList& list = mReceivingNextModuleInfo ? mNextModuleInfo : mParamlist;
Param p;
if( p.ReadBinary( is ) )
list[p.Name()] = p;
return is ? true : false;
}
示例6: if
string
EnvironmentBase::DescribeValue( const Param& inParam, size_t inIdx1, size_t inIdx2 )
{
ostringstream oss;
oss << "Parameter \""
<< inParam.Section() << "->" << inParam.Name()
<< "\": Value";
if( string( inParam.Type() ).find( "matrix" ) != string::npos )
oss << " at index (" << inIdx1 + 1 << ", " << inIdx2 + 1 << ")";
else if( string( inParam.Type() ).find( "list" ) != string::npos )
oss << " at index " << inIdx1 + 1;
return oss.str();
}