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

#include <Cloning.hpp>

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

Public Types

typedef Timing Type
 
typedef boost::shared_ptr< TypePointer
 

Public Member Functions

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

Definition at line 2655 of file Cloning.hpp.

Member Typedef Documentation

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

Definition at line 2658 of file Cloning.hpp.

Definition at line 2657 of file Cloning.hpp.

Constructor & Destructor Documentation

Definition at line 2714 of file Cloning.hpp.

2714  : Type::Visitor(), mFactory(), mReturnVal() {
2715  }
torc::generic::_impl::Copier< class Timing >::~Copier ( )
throw (
)
inline

Definition at line 2717 of file Cloning.hpp.

2717  {
2718  }

Member Function Documentation

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

Definition at line 2660 of file Cloning.hpp.

2661  {
2662  mFactory = inFactory;
2663  inSource->accept(*this);
2664  return mReturnVal;
2665  }
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 Timing >::visit ( Timing inTiming)
throw (Error
)
inline

Definition at line 2667 of file Cloning.hpp.

2667  {
2668  try {
2669  TimingSharedPtr timingPtr;
2670  mFactory->create(timingPtr);
2671  timingPtr->setComments(inTiming.getComments());
2672 
2673  std::list < std::string > userData;
2674  inTiming.getUserData(userData);
2675  timingPtr->setUserData(userData);
2676 
2677  timingPtr->setDerivation(inTiming.getDerivation());
2678  std::list<PathDelaySharedPtr> outPathDelays;
2679  inTiming.getPathDelays(outPathDelays);
2680  std::list<PathDelaySharedPtr>::iterator pathDelayIt = outPathDelays.begin();
2681  for(; pathDelayIt != outPathDelays.end(); pathDelayIt++) {
2682  PathDelaySharedPtr pathDelay = *pathDelayIt;
2683  PathDelaySharedPtr newPathDelay;
2684  mFactory->create(newPathDelay);
2685  newPathDelay->setDelay(pathDelay->getDelay());
2686 
2687  std::list<EventSharedPtr> outEvents;
2688  pathDelay->getEvents(outEvents);
2689  std::list<EventSharedPtr>::iterator eventIt = outEvents.begin();
2690  for(; eventIt != outEvents.end(); eventIt++) {
2691  EventSharedPtr clonedEvent = clone(*eventIt, mFactory);
2692  newPathDelay->addEvent(clonedEvent);
2693  }
2694 
2695  timingPtr->addPathDelay(newPathDelay);
2696  }
2697 
2698  std::list<ForbiddenEventSharedPtr> outForbiddentEvents;
2699  inTiming.getForbiddentEvents(outForbiddentEvents);
2700  std::list<ForbiddenEventSharedPtr>::iterator forbiddentEventIt =
2701  outForbiddentEvents.begin();
2702  for(; forbiddentEventIt != outForbiddentEvents.end(); forbiddentEventIt++) {
2703  ForbiddenEventSharedPtr clonedForbiddenEvent = clone(*forbiddentEventIt, mFactory);
2704  timingPtr->addForbiddenEvent(clonedForbiddenEvent);
2705  }
2706 
2707  mReturnVal = timingPtr;
2708  } catch(Error& e) {
2709  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2710  throw;
2711  }
2712  }
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< ForbiddenEvent > ForbiddenEventSharedPtr
boost::shared_ptr< Event > EventSharedPtr
boost::shared_ptr< PathDelay > PathDelaySharedPtr
boost::shared_ptr< Timing > TimingSharedPtr

+ Here is the call graph for this function:

Field Documentation

Definition at line 2721 of file Cloning.hpp.

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

Definition at line 2722 of file Cloning.hpp.


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