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

#include <VectorPort.hpp>

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

Public Types

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

Public Member Functions

virtual VectorPortSharedPtr newVectorPortPtr (const std::string &inName, const EPortDirection &inDirection, const ViewSharedPtr &inViewPtr, const size_t &inSize, const PortBundleSharedPtr &inParentCollection=PortBundleSharedPtr(), const ChildFactorySharedPtr &inFactory=BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()), const std::string &inOriginalName=std::string()) throw (Error)
 
virtual VectorPortSharedPtr newVectorPortPtr (const std::string &inName, const EPortDirection &inDirection, const ViewSharedPtr &inViewPtr, const std::vector< size_t > &inLimits, const PortBundleSharedPtr &inParentCollection=PortBundleSharedPtr(), const ChildFactorySharedPtr &inFactory=BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()), const std::string &inOriginalName=std::string()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create a vector port.

Definition at line 59 of file VectorPort.hpp.

Member Typedef Documentation

A pointer to an object of type Type

Definition at line 45 of file FactoryType.hpp.

A rename of the parameter type

Definition at line 40 of file FactoryType.hpp.

A weak pointer to an object of type Type

Definition at line 50 of file FactoryType.hpp.

Member Function Documentation

virtual void torc::generic::FactoryType< VectorPort >::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
VectorPortSharedPtr torc::generic::VectorPort::Factory::newVectorPortPtr ( const std::string &  inName,
const EPortDirection inDirection,
const ViewSharedPtr inViewPtr,
const size_t &  inSize,
const PortBundleSharedPtr inParentCollection = PortBundleSharedPtr(),
const ChildFactorySharedPtr inFactory = BaseVectorType::ChildFactorySharedPtr( new BaseVectorType::ChildFactory()),
const std::string &  inOriginalName = std::string() 
)
throw (Error
)
virtual

Create a vector port.

Parameters
[in]inNameName of the vector port to be created.
[in]inDirectionDirection of port.
[in]inViewPtrPointer to parented(View) object.
[in]inSizeSize of the port array.
[in]inParentCollectionPointer to parent bundle.
[in]inFactoryFactory for the child.
[in]inOriginalNameOriginal name of the vector port [optional].
Returns
Pointer to created vector port.

Create a vector port.

Parameters
[in]inNameName of the vector port to be created.
[in]inDirectionDirection of port.
[in]inViewPtrPointer to parented(View) object.
[in]inSizeSize of the port array.
[in]inFactoryFactory for the child.
[in]inOriginalNameOriginal name of the vector port [optional].
Returns
Pointer to created vector port.

Definition at line 54 of file VectorPort.cpp.

57  {
58  try {
59  std::vector < size_t > limits;
60  limits.push_back(inSize);
61  return newVectorPortPtr(inName, inDirection, inViewPtr, limits, inParentCollection,
62  inFactory, inOriginalName);
63  } catch(Error& e) {
64  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
65  throw;
66  }
67 }
virtual VectorPortSharedPtr newVectorPortPtr(const std::string &inName, const EPortDirection &inDirection, const ViewSharedPtr &inViewPtr, const size_t &inSize, const PortBundleSharedPtr &inParentCollection=PortBundleSharedPtr(), const ChildFactorySharedPtr &inFactory=BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()), const std::string &inOriginalName=std::string())
Definition: VectorPort.cpp:54

+ Here is the call graph for this function:

VectorPortSharedPtr torc::generic::VectorPort::Factory::newVectorPortPtr ( const std::string &  inName,
const EPortDirection inDirection,
const ViewSharedPtr inViewPtr,
const std::vector< size_t > &  inLimits,
const PortBundleSharedPtr inParentCollection = PortBundleSharedPtr(),
const ChildFactorySharedPtr inFactory = BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()),
const std::string &  inOriginalName = std::string() 
)
throw (Error
)
virtual

Create a vector port.

Parameters
[in]inNameName of the vector port to be created.
[in]inDirectionDirection of port.
[in]inViewPtrPointer to parented(View) object.
[in]inLimitsDimensions of the vector.
[in]inParentCollectionPointer to parent bundle.
[in]inFactoryFactory for the child.
[in]inOriginalNameOriginal name of the vector port [optional].
Returns
Pointer to created vector port.

Create a vector port.

Parameters
[in]inNameName of the vector port to be created.
[in]inDirectionDirection of port.
[in]inViewPtrPointer to parented(View) object.
[in]inLimitsDimensions of the vector.
[in]inFactoryFactory for the child.
[in]inOriginalNameOriginal name of the vector port [optional].
Returns
Pointer to created vector port.

Definition at line 81 of file VectorPort.cpp.

84  {
85  try {
86  VectorPortSharedPtr newVectorPort;
87  create(newVectorPort);
88  newVectorPort->setName(inName);
89  newVectorPort->setDirection(inDirection);
90  newVectorPort->constructChildren(inFactory,
91  inLimits);
92  newVectorPort->setOriginalName(inOriginalName);
93  if(inParentCollection) {
94  inParentCollection->addChild(newVectorPort);
95  } else {
96  inViewPtr->addPort(newVectorPort);
97  }
98  return newVectorPort;
99  } catch(Error& e) {
100  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
101  throw;
102  }
103 }
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58
boost::shared_ptr< VectorPort > VectorPortSharedPtr

+ Here is the call graph for this function:


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