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

#include <Cloning.hpp>

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

Public Types

typedef PortList Type
 
typedef boost::shared_ptr< TypePointer
 

Public Member Functions

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

Definition at line 2447 of file Cloning.hpp.

Member Typedef Documentation

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

Definition at line 2450 of file Cloning.hpp.

Definition at line 2449 of file Cloning.hpp.

Constructor & Destructor Documentation

Definition at line 2486 of file Cloning.hpp.

2486  : Type::Visitor(), mFactory(), mReturnVal() {
2487  }
torc::generic::_impl::Copier< class PortList >::~Copier ( )
throw (
)
inline

Definition at line 2489 of file Cloning.hpp.

2489  {
2490  }

Member Function Documentation

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

Definition at line 2452 of file Cloning.hpp.

2453  {
2454  mFactory = inFactory;
2455  inSource->accept(*this);
2456  return mReturnVal;
2457  }
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 PortList >::visit ( PortList inPortList)
throw (Error
)
inline

Definition at line 2459 of file Cloning.hpp.

2459  {
2460  try {
2461  PortListSharedPtr portList;
2462  mFactory->create(portList);
2463  std::list<PortList::PortListElement> elements;
2464  inPortList.getChildren(elements);
2465  for(std::list<PortList::PortListElement>::iterator it = elements.begin();
2466  it != elements.end(); ++it) {
2467  switch((*it).getType()) {
2469  portList->addChildPort((*it).getPort());
2470  break;
2471  }
2473  portList->addChildPortReference((*it).getPortReference());
2474  break;
2475  }
2476  }
2477  }
2478 
2479  mReturnVal = portList;
2480  } catch(Error& e) {
2481  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2482  throw;
2483  }
2484  }
boost::shared_ptr< PortList > PortListSharedPtr

+ Here is the call graph for this function:

Field Documentation

Definition at line 2493 of file Cloning.hpp.

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

Definition at line 2494 of file Cloning.hpp.


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