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

#include <Cloning.hpp>

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

Public Types

typedef Property Type
 
typedef boost::shared_ptr< TypePointer
 

Public Member Functions

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

Definition at line 1994 of file Cloning.hpp.

Member Typedef Documentation

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

Definition at line 1997 of file Cloning.hpp.

Definition at line 1996 of file Cloning.hpp.

Constructor & Destructor Documentation

Definition at line 2031 of file Cloning.hpp.

2031  : Type::Visitor(), mFactory(), mReturnVal() {
2032  }
torc::generic::_impl::Copier< class Property >::~Copier ( )
throw (
)
inline

Definition at line 2034 of file Cloning.hpp.

2034  {
2035  }

Member Function Documentation

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

Definition at line 1999 of file Cloning.hpp.

2000  {
2001  mFactory = inFactory;
2002  inSource->accept(*this);
2003  return mReturnVal;
2004  }
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 Property >::visit ( Property inProperty)
throw (Error
)
inline

Definition at line 2006 of file Cloning.hpp.

2006  {
2007  try {
2008  PropertySharedPtr propertyPtr;
2009  mFactory->create(propertyPtr);
2010  propertyPtr->setComments(inProperty.getComments());
2011  propertyPtr->setName(inProperty.getName());
2012  propertyPtr->setOriginalName(inProperty.getOriginalName());
2013  propertyPtr->setOwner(inProperty.getOwner());
2014  propertyPtr->setUnit(inProperty.getUnit());
2015  propertyPtr->setValue(inProperty.getValue());
2016 
2017  std::map<std::string, PropertySharedPtr> outValues;
2018  inProperty.getChildren(outValues);
2019  for(std::map<std::string, PropertySharedPtr>::iterator it = outValues.begin();
2020  it != outValues.end(); ++it) {
2021  PropertySharedPtr childProperty = clone((*it).second, mFactory);
2022  propertyPtr->addChildProperty((*it).first, childProperty);
2023  }
2024  mReturnVal = propertyPtr;
2025  } catch(Error& e) {
2026  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2027  throw;
2028  }
2029  }
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:

Field Documentation

Definition at line 2038 of file Cloning.hpp.

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

Definition at line 2039 of file Cloning.hpp.


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