GET_METHOD_DEF( Polymorph, ProcessList, Stepper ) { PolymorphVector aVector; aVector.reserve( theProcessVector.size() ); for( ProcessVector::const_iterator i( theProcessVector.begin() ); i != theProcessVector.end() ; ++i ) { aVector.push_back( Polymorph( (*i)->getFullID().asString() ) ); } return Polymorph( aVector ); }
GET_METHOD_DEF( Polymorph, ProcessList, System ) { PolymorphVector aVector; aVector.reserve( theProcessMap.size() ); for( ProcessMap::const_iterator i( theProcessMap.begin() ); i != theProcessMap.end() ; ++i ) { aVector.push_back( Polymorph( i->second->getID() ) ); } return Polymorph( aVector ); }
GET_METHOD_DEF( Polymorph, ReadVariableList, Stepper ) { PolymorphVector aVector; aVector.reserve( theVariableVector.size() ); for( VariableVector::size_type c( theReadWriteVariableOffset ); c != theVariableVector.size(); ++c ) { aVector.push_back( Polymorph( theVariableVector[c]->getFullID().asString() ) ); } return Polymorph( aVector ); }
GET_METHOD_DEF( Polymorph, SystemList, Stepper ) { PolymorphVector aVector; aVector.reserve( theSystemVector.size() ); for( SystemVector::const_iterator i( getSystemVector().begin() ); i != getSystemVector().end() ; ++i ) { aVector.push_back( Polymorph( ( *i )->getFullID().asString() ) ); } return Polymorph( aVector ); }
GET_METHOD( libecs::Polymorph, EventAssignmentList ) { PolymorphVector aVector; aVector.reserve( theEventAssignmentMap.size() ); for( EventAssignmentMap::const_iterator i( theEventAssignmentMap.begin() ); i != theEventAssignmentMap.end() ; ++i ) { aVector.push_back( boost::tuple< libecs::String, libecs::String >( (*i).first, (*i).second.getExpression() ) ); } return Polymorph( aVector ); }
GET_METHOD_DEF( Polymorph, VariableReferenceList, Process ) { PolymorphVector aVector; aVector.reserve( theVariableReferenceVector.size() ); for( VariableReferenceVector::const_iterator i( theVariableReferenceVector.begin() ); i != theVariableReferenceVector.end() ; ++i ) { VariableReference const& aVariableReference( *i ); FullID aFullID( aVariableReference.getVariable()->getFullID() ); aFullID.setEntityType( EntityType::NONE ); aVector.push_back( boost::tuple< String, String, Integer, Integer >( aVariableReference.getName(), aFullID.asString(), aVariableReference.getCoefficient(), aVariableReference.isAccessor() ) ); } return Polymorph( aVector ); }
SAVE_METHOD_DEF( Polymorph, VariableReferenceList, Process ) { PolymorphVector aVector; aVector.reserve( theVariableReferenceVector.size() ); for( VariableReferenceVector::const_iterator i( theVariableReferenceVector.begin() ); i != theVariableReferenceVector.end() ; ++i ) { VariableReference const& aVariableReference( *i ); // (1) Variable reference name // convert back all variable reference ellipses to the default '_'. String aReferenceName( aVariableReference.getName() ); if( VariableReference::isEllipsisNameString( aReferenceName ) ) { aReferenceName = VariableReference::DEFAULT_NAME; } // (2) FullID FullID aFullID( aVariableReference.getVariable()->getFullID() ); aFullID.setEntityType( EntityType::NONE ); // (3) Coefficient and (4) IsAccessor const Integer aCoefficient( aVariableReference.getCoefficient() ); const bool anIsAccessorFlag( aVariableReference.isAccessor() ); // include both if IsAccessor is non-default (not true). if( anIsAccessorFlag != true ) { aVector.push_back( boost::tuple< String, String, Integer, Integer >( aReferenceName, aFullID.asString(), aCoefficient, static_cast<Integer>( anIsAccessorFlag ) ) ); } else { // output only the coefficient if IsAccessor has a // default value, and the coefficient is non-default. if( aCoefficient != 0 ) { aVector.push_back( boost::tuple< String, String, Integer >( aReferenceName, aFullID.asString(), aCoefficient ) ); } else { aVector.push_back( boost::tuple< String, String >( aReferenceName, aFullID.asString() ) ); } } } return Polymorph( aVector ); }