本文整理汇总了C++中Eref::dropAll方法的典型用法代码示例。如果您正苦于以下问题:C++ Eref::dropAll方法的具体用法?C++ Eref::dropAll怎么用?C++ Eref::dropAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eref
的用法示例。
在下文中一共展示了Eref::dropAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clearFunc
/**
* Clears out all the messages to zombie objects
*/
void HSolveHub::clearFunc( Eref hub )
{
clearMsgsFromFinfo( hub, compartmentSolveFinfo );
clearMsgsFromFinfo( hub, hhchannelSolveFinfo );
hub.dropAll( compartmentInjectFinfo->msg() );
}
示例2: initKinComptCinfo
/* create COMPARTMENT */
map< string,Id > SbmlReader::createCompartment( Id location )
{
static const Cinfo* kincomptCinfo = initKinComptCinfo();
static const Finfo* sizeFinfo = kincomptCinfo->findFinfo( "size" );
static const Finfo* dimensionFinfo = kincomptCinfo->findFinfo( "numDimensions" );
map< string,Id > idMap;
//Id outcompt; //outside compartment
map< Id,string > outsideMap;
map< Id,string > ::iterator iter;
double msize = 0.0,size=0.0;
::Compartment* compt;
unsigned int num_compts = model_->getNumCompartments();
//cout << "num of compartments :" << num_compts <<endl;
for ( unsigned int i = 0; i < num_compts; i++ )
{
compt = model_->getCompartment(i);
std::string id = "";
if ( compt->isSetId() ){
id = compt->getId();
}
std::string name = "";
if ( compt->isSetName() ){
name = compt->getName();
}
std::string outside = "";
if ( compt->isSetOutside() ){
outside = compt->getOutside ();
}
if ( compt->isSetSize() ){
msize = compt->getSize();
}
UnitDefinition * ud = compt->getDerivedUnitDefinition();
size = transformUnits( msize,ud );
unsigned int dimension = compt->getSpatialDimensions();
comptEl_ = Neutral::create( "KinCompt",id, location, Id::scratchId() ); //create Compartment
idMap[id] = comptEl_->id();
if ( outside != "" )
outsideMap[comptEl_->id()] = outside ;
if ( size != 0.0 )
::set< double >( comptEl_, sizeFinfo, size );
if ( dimension != 0 )
::set< unsigned int >( comptEl_,dimensionFinfo,dimension );
}
for ( iter = outsideMap.begin(); iter != outsideMap.end(); iter++ )
{
Eref msid = iter->first();
string outside = iter->second;
Id outcompt = idMap.find( outside )->second;
static const Finfo* outsideFinfo = kincomptCinfo->findFinfo( "outside" );
static const Finfo* insideFinfo = kincomptCinfo->findFinfo( "inside" );
msid.dropAll("child"); //delete the connection with old parent ie, /kinetics
Eref(outcompt() ).add("childSrc",msid,"child",ConnTainer::Default); //create connection with new parent ie.outside compartment
Eref( msid ).add( outsideFinfo->msg(),outcompt(),insideFinfo->msg(),ConnTainer::Default );
}
return idMap;
}
示例3: clearMsgsFromFinfo
void HSolveHub::clearMsgsFromFinfo( Eref hub, const Finfo * f )
{
Conn* c = hub.e->targets( f->msg(), hub.i );
vector< Element* > list;
while ( c->good() ) {
list.push_back( c->target().e );
c->increment();
}
delete c;
hub.dropAll( f->msg() );
vector< Element* >::iterator i;
for ( i = list.begin(); i != list.end(); i++ ) unzombify( *i );
}
示例4: zombify
/**
* This operation turns the target element e into a zombie controlled
* by the hub/solver. It gets rid of any process message coming into
* the zombie and replaces it with one from the solver.
*/
void HSolveHub::zombify(
Eref hub, Eref e,
const Finfo* hubFinfo, Finfo* solveFinfo )
{
// Replace the original procFinfo with one from the hub.
const Finfo* procFinfo = e->findFinfo( "process" );
e.dropAll( procFinfo->msg() );
bool ret = hub.add( hubFinfo->msg(), e, procFinfo->msg(),
ConnTainer::Default );
assert( ret );
// Redirect original messages from the zombie to the hub.
// Pending.
// Replace the 'ThisFinfo' on the solved element
e->setThisFinfo( solveFinfo );
}