torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::Permutable::Factory Class Reference

#include <Permutable.hpp>

+ Inheritance diagram for torc::generic::Permutable::Factory:
+ Collaboration diagram for torc::generic::Permutable::Factory:

Public Types

typedef _Tp Type
 
typedef SelfReferencing< Type >
::Pointer 
Pointer
 
typedef SelfReferencing< Type >
::WeakPointer 
WeakPointer
 

Public Member Functions

virtual PermutableSharedPtr newPermutablePtr (const std::vector< PortSharedPtr > &inPorts, const ViewSharedPtr &inViewPtr, const PermutableSharedPtr &inParentPermutable=PermutableSharedPtr()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create a permutable.

Definition at line 63 of file Permutable.hpp.

Member Typedef Documentation

template<typename _Tp>
typedef SelfReferencing<Type>::Pointer torc::generic::FactoryType< _Tp >::Pointer
inherited

A pointer to an object of type Type

Definition at line 45 of file FactoryType.hpp.

template<typename _Tp>
typedef _Tp torc::generic::FactoryType< _Tp >::Type
inherited

A rename of the parameter type

Definition at line 40 of file FactoryType.hpp.

template<typename _Tp>
typedef SelfReferencing<Type>::WeakPointer torc::generic::FactoryType< _Tp >::WeakPointer
inherited

A weak pointer to an object of type Type

Definition at line 50 of file FactoryType.hpp.

Member Function Documentation

template<typename _Tp>
virtual void torc::generic::FactoryType< _Tp >::create ( Pointer outPointer)
throw (Error
)
inlinevirtualinherited

Create an object of the Type specification of Factory. If the object has a boost::weak_ptr to itself, it is the task of this method to set this after the object is created.

Returns
A pointer to the freshly created object.

Definition at line 58 of file FactoryType.hpp.

58  {
59  try {
60  Pointer temp(new _Tp()); //Do not remove
61  outPointer = temp;
62  WeakPointer weakPtr(outPointer);
63  outPointer->setWeakThis(weakPtr);
64  } catch(std::exception& e) //May receive std::bad_alloc
65  {
66  //TBD::ERROR
67  }
68  }
SelfReferencing< Type >::WeakPointer WeakPointer
Definition: FactoryType.hpp:50
SelfReferencing< Type >::Pointer Pointer
Definition: FactoryType.hpp:45
PermutableSharedPtr torc::generic::Permutable::Factory::newPermutablePtr ( const std::vector< PortSharedPtr > &  inPorts,
const ViewSharedPtr inViewPtr,
const PermutableSharedPtr inParentPermutable = PermutableSharedPtr() 
)
throw (Error
)
virtual

Create a permutable.

Parameters
[in]inPortsVector of ports to this permutable.
[in]inViewPtrPointer to parented(View) object.
[in]inParentPermutablePointer to parent permutable.
Returns
Pointer to created permutable.

Definition at line 31 of file Permutable.cpp.

32  {
33  try {
34  PermutableSharedPtr newPermutable;
35  create(newPermutable);
36  newPermutable->setPorts(inPorts);
37  if(inParentPermutable) {
38  inParentPermutable->addChildPermutable(newPermutable);
39  } else if(inViewPtr) {
40  inViewPtr->addPermutable(newPermutable);
41  }
42  return newPermutable;
43  } catch(Error& e) {
44  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
45  throw;
46  }
47 }
boost::shared_ptr< Permutable > PermutableSharedPtr
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58

+ Here is the call graph for this function:


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