torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::_impl::Copier< class SimulationInfo > Class Template Referenceabstract

#include <Cloning.hpp>

+ Inheritance diagram for torc::generic::_impl::Copier< class SimulationInfo >:
+ Collaboration diagram for torc::generic::_impl::Copier< class SimulationInfo >:

Public Types

typedef SimulationInfo Type
 
typedef boost::shared_ptr< TypePointer
 

Public Member Functions

Pointer operator() (const Pointer &inSource, const ObjectFactorySharedPtr &inFactory) throw (Error)
 
void visit (SimulationInfo &inSimulationInfo) throw (Error)
 
 Copier ()
 
 ~Copier () throw ()
 
virtual void visit (_Tp &client)=0 throw (Error)
 

Private Attributes

ObjectFactorySharedPtr mFactory
 
Pointer mReturnVal
 

Detailed Description

template<>
class torc::generic::_impl::Copier< class SimulationInfo >

Definition at line 484 of file Cloning.hpp.

Member Typedef Documentation

typedef boost::shared_ptr<Type> torc::generic::_impl::Copier< class SimulationInfo >::Pointer

Definition at line 487 of file Cloning.hpp.

Definition at line 486 of file Cloning.hpp.

Constructor & Destructor Documentation

Definition at line 523 of file Cloning.hpp.

523  : Type::Visitor(), mFactory(), mReturnVal() {
524  }
torc::generic::_impl::Copier< class SimulationInfo >::~Copier ( )
throw (
)
inline

Definition at line 526 of file Cloning.hpp.

526  {
527  }

Member Function Documentation

Pointer torc::generic::_impl::Copier< class SimulationInfo >::operator() ( const Pointer inSource,
const ObjectFactorySharedPtr inFactory 
)
throw (Error
)
inline

Definition at line 489 of file Cloning.hpp.

490  {
491  mFactory = inFactory;
492  inSource->accept(*this);
493  return mReturnVal;
494  }
template<typename _Tp >
virtual void torc::generic::VisitorType< _Tp >::visit ( _Tp &  client)
throw (Error
)
pure virtualinherited

Visit the target object. This will typically be a derived leaf type.

Parameters
[in,out]clientA reference to the target object
Exceptions
ErrorException generated by any of the functions called from inside visit()

+ Here is the caller graph for this function:

void torc::generic::_impl::Copier< class SimulationInfo >::visit ( SimulationInfo inSimulationInfo)
throw (Error
)
inline

Definition at line 496 of file Cloning.hpp.

496  {
497  try {
498  SimulationInfoSharedPtr simuInfoPtr;
499  mFactory->create(simuInfoPtr);
500  simuInfoPtr->setComments(inSimulationInfo.getComments());
501 
502  std::list < std::string > userData;
503  inSimulationInfo.getUserData(userData);
504  simuInfoPtr->setUserData(userData);
505 
506  simuInfoPtr->setParent(inSimulationInfo.getParent());
507 
508  std::vector<LogicValueSharedPtr> outLogicValues;
509  inSimulationInfo.getLogicValues(outLogicValues);
510  for(std::vector<LogicValueSharedPtr>::iterator it = outLogicValues.begin();
511  it != outLogicValues.end(); ++it) {
512  LogicValueSharedPtr newLogicVal = clone(*it, mFactory);
513  simuInfoPtr->addLogicValue(newLogicVal);
514  }
515 
516  mReturnVal = simuInfoPtr;
517  } catch(Error& e) {
518  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
519  throw;
520  }
521  }
boost::shared_ptr< LogicValue > LogicValueSharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< SimulationInfo > SimulationInfoSharedPtr

+ Here is the call graph for this function:

Field Documentation

Definition at line 530 of file Cloning.hpp.

Pointer torc::generic::_impl::Copier< class SimulationInfo >::mReturnVal
private

Definition at line 531 of file Cloning.hpp.


The documentation for this class was generated from the following file: