本文整理汇总了C++中Param::unpack方法的典型用法代码示例。如果您正苦于以下问题:C++ Param::unpack方法的具体用法?C++ Param::unpack怎么用?C++ Param::unpack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Param
的用法示例。
在下文中一共展示了Param::unpack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unpack
//-----------------------------------------------------------------------------
// Function : ModelBlock::unpack
// Purpose : Unpacks ModelBlock from char buffer using MPI_UNPACK
// Special Notes :
// Scope : public
// Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
// Creation Date : 5/24/00
//-----------------------------------------------------------------------------
void ModelBlock::unpack(char * pB, int bsize,int & pos, N_PDS_Comm * comm)
{
int size, length;
int i;
//----- unpack name
comm->unpack( pB, bsize, pos, &length, 1 );
name_ = std::string( (pB+pos), length);
pos += length;
//----- unpack type
comm->unpack( pB, bsize, pos, &length, 1 );
type_ = std::string( (pB+pos), length);
pos += length;
//----- unpack level
comm->unpack( pB, bsize, pos, &level_, 1 );
//----- unpack params
comm->unpack( pB, bsize, pos, &size, 1 );
params.clear();
Param dp;
for( i = 0; i < size; ++i )
{
dp.unpack( pB, bsize, pos, comm );
params.push_back( dp );
}
//----- unpack netlistFileName_
comm->unpack( pB, bsize, pos, &length, 1 );
netlistLocation_.setPath(std::string( (pB+pos), length));
pos += length;
//----- unpack lineNumber_
int line_number = 0;
comm->unpack( pB, bsize, pos, &line_number, 1 );
netlistLocation_.setLineNumber(line_number);
#ifdef Xyce_DEBUG_TOPOLOGY
Xyce::dout() << "Unpacked " << pos << " bytes for ModelBlock: " <<
name_ << std::endl;
#endif
}