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

#include <Cloning.hpp>

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

Public Types

typedef LogicElement Type
 
typedef boost::shared_ptr< TypePointer
 

Public Member Functions

Pointer operator() (const Pointer &inSource, const ObjectFactorySharedPtr &inFactory) throw (Error)
 
void visit (LogicElement &inLogicElement) 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 LogicElement >

Definition at line 2859 of file Cloning.hpp.

Member Typedef Documentation

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

Definition at line 2862 of file Cloning.hpp.

Definition at line 2861 of file Cloning.hpp.

Constructor & Destructor Documentation

Definition at line 2894 of file Cloning.hpp.

2894  : Type::Visitor(), mFactory(), mReturnVal() {
2895  }
torc::generic::_impl::Copier< class LogicElement >::~Copier ( )
throw (
)
inline

Definition at line 2897 of file Cloning.hpp.

2897  {
2898  }

Member Function Documentation

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

Definition at line 2864 of file Cloning.hpp.

2865  {
2866  mFactory = inFactory;
2867  inSource->accept(*this);
2868  return mReturnVal;
2869  }
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 LogicElement >::visit ( LogicElement inLogicElement)
throw (Error
)
inline

Definition at line 2871 of file Cloning.hpp.

2871  {
2872  try {
2873  LogicElementSharedPtr logicElementPtr;
2874  mFactory->create(logicElementPtr);
2875  logicElementPtr->setType(inLogicElement.getType());
2876  if(LogicElement::eTypeSingle == inLogicElement.getType()) {
2877  logicElementPtr->setName(inLogicElement.getName());
2878  }
2879  std::vector<LogicElementSharedPtr> outLogicElements;
2880  inLogicElement.getChildren(outLogicElements);
2881  for(std::vector<LogicElementSharedPtr>::iterator it = outLogicElements.begin();
2882  it != outLogicElements.end(); ++it) {
2883  LogicElementSharedPtr clonedLogicElement = clone(*it, mFactory);
2884  logicElementPtr->addChildLogicElement(clonedLogicElement);
2885  }
2886 
2887  mReturnVal = logicElementPtr;
2888  } catch(Error& e) {
2889  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2890  throw;
2891  }
2892  }
boost::shared_ptr< LogicElement > LogicElementSharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63

+ Here is the call graph for this function:

Field Documentation

Definition at line 2901 of file Cloning.hpp.

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

Definition at line 2902 of file Cloning.hpp.


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