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

#include <VectorPortReference.hpp>

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

Public Types

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

Public Member Functions

virtual
VectorPortReferenceSharedPtr 
newVectorPortReferencePtr (const InstanceSharedPtr &inInstancePtr, const PortSharedPtr &inPortPtr, const size_t &inSize, const PortBundleReferenceSharedPtr &inParentCollection=PortBundleReferenceSharedPtr(), const ChildFactorySharedPtr &inFactory=BaseType::ChildFactorySharedPtr(new BaseType::ChildFactory())) throw (Error)
 
virtual
VectorPortReferenceSharedPtr 
newVectorPortReferencePtr (const InstanceSharedPtr &inInstancePtr, const PortSharedPtr &inPortPtr, const std::vector< size_t > &inLimits, const PortBundleReferenceSharedPtr &inParentCollection=PortBundleReferenceSharedPtr(), const ChildFactorySharedPtr &inFactory=BaseType::ChildFactorySharedPtr(new BaseType::ChildFactory())) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create a vector port ref.

Definition at line 59 of file VectorPortReference.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< VectorPortReference >::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
VectorPortReferenceSharedPtr torc::generic::VectorPortReference::Factory::newVectorPortReferencePtr ( const InstanceSharedPtr inInstancePtr,
const PortSharedPtr inPortPtr,
const size_t &  inSize,
const PortBundleReferenceSharedPtr inParentCollection = PortBundleReferenceSharedPtr(),
const ChildFactorySharedPtr inFactory = BaseType::ChildFactorySharedPtr(new BaseType::ChildFactory()) 
)
throw (Error
)
virtual

Create a vector port ref.

Parameters
[in]inInstancePtrPointer to parented(Instance) object.
[in]inPortPtrPointer to master(Port) object.
[in]inSizeSize of the net array.
[in]inParentCollectionPointer to parent bundle.
[in]inFactoryFactory for the child.
Returns
Pointer to created scalar port ref.

Create a vector port ref.

Parameters
[in]inInstancePtrPointer to parented(Instance) object.
[in]inPortPtrPointer to master(Port) object.
[in]inSizeSize of the net array.
[in]inFactoryFactory for the child.
Returns
Pointer to created scalar port ref.

Definition at line 78 of file VectorPortReference.cpp.

81  {
82  try {
83  std::vector < size_t > limits;
84  limits.push_back(inSize);
85  return newVectorPortReferencePtr(inInstancePtr, inPortPtr, limits, inParentCollection,
86  inFactory);
87  } catch(Error& e) {
88  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
89  throw;
90  }
91 }
virtual VectorPortReferenceSharedPtr newVectorPortReferencePtr(const InstanceSharedPtr &inInstancePtr, const PortSharedPtr &inPortPtr, const size_t &inSize, const PortBundleReferenceSharedPtr &inParentCollection=PortBundleReferenceSharedPtr(), const ChildFactorySharedPtr &inFactory=BaseType::ChildFactorySharedPtr(new BaseType::ChildFactory()))

+ Here is the call graph for this function:

VectorPortReferenceSharedPtr torc::generic::VectorPortReference::Factory::newVectorPortReferencePtr ( const InstanceSharedPtr inInstancePtr,
const PortSharedPtr inPortPtr,
const std::vector< size_t > &  inLimits,
const PortBundleReferenceSharedPtr inParentCollection = PortBundleReferenceSharedPtr(),
const ChildFactorySharedPtr inFactory = BaseType::ChildFactorySharedPtr(new BaseType::ChildFactory()) 
)
throw (Error
)
virtual

Create a vector port ref.

Parameters
[in]inInstancePtrPointer to parented(Instance) object.
[in]inPortPtrPointer to master(Port) object.
[in]inLimitsDimensions of the vector.
[in]inParentCollectionPointer to parent bundle.
[in]inFactoryFactory for the child.
Returns
Pointer to created scalar port ref.

Create a vector port ref.

Parameters
[in]inInstancePtrPointer to parented(Instance) object.
[in]inPortPtrPointer to master(Port) object.
[in]inLimitsDimensions of the vector.
[in]inFactoryFactory for the child.
Returns
Pointer to created scalar port ref.

Definition at line 103 of file VectorPortReference.cpp.

106  {
107  try {
108  VectorPortReferenceSharedPtr newVectorPortReference;
109  create(newVectorPortReference);
110  newVectorPortReference->constructChildren(inFactory, inLimits);
111  newVectorPortReference->bindToMasterPort(inPortPtr);
112  if(inParentCollection) {
113  inParentCollection->addChild(newVectorPortReference);
114  } else {
115  inInstancePtr->addPortReference(newVectorPortReference);
116  }
117  return newVectorPortReference;
118  } catch(Error& e) {
119  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
120  throw;
121  }
122 }
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58
boost::shared_ptr< VectorPortReference > VectorPortReferenceSharedPtr

+ Here is the call graph for this function:


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