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

#include <InstanceArray.hpp>

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

Public Types

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

Public Member Functions

virtual InstanceArraySharedPtr newInstanceArrayPtr (const std::string &inName, const ViewSharedPtr &inViewPtr, const ViewSharedPtr &inMaster, const size_t &inSize, const ChildFactorySharedPtr &inFactory=BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()), const std::string &inOriginalName=std::string()) throw (Error)
 
virtual InstanceArraySharedPtr newInstanceArrayPtr (const std::string &inName, const ViewSharedPtr &inViewPtr, const ViewSharedPtr &inMaster, const std::vector< size_t > &inLimits, 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 an instance array.

Definition at line 61 of file InstanceArray.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
InstanceArraySharedPtr torc::generic::InstanceArray::Factory::newInstanceArrayPtr ( const std::string &  inName,
const ViewSharedPtr inViewPtr,
const ViewSharedPtr inMaster,
const size_t &  inSize,
const ChildFactorySharedPtr inFactory = BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()),
const std::string &  inOriginalName = std::string() 
)
throw (Error
)
virtual

Create an instance array

Parameters
[in]inNameName of the instance array to be created.
[in]inViewPtrPointer to parented(view) object.
[in]inMasterPointer to master object.
[in]inSizeSize of the instance array.
[in]inFactoryFactory for the child.
[in]inOriginalNameOriginal name of the instance array [optional].
Returns
Pointer to created instance array.

Definition at line 51 of file InstanceArray.cpp.

53  {
54  try {
55  std::vector < size_t > limits;
56  limits.push_back(inSize);
57  return newInstanceArrayPtr(inName, inViewPtr, inMaster, limits, inFactory, inOriginalName);
58  } catch(Error& e) {
59  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
60  throw;
61  }
62 }
virtual InstanceArraySharedPtr newInstanceArrayPtr(const std::string &inName, const ViewSharedPtr &inViewPtr, const ViewSharedPtr &inMaster, const size_t &inSize, const ChildFactorySharedPtr &inFactory=BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()), const std::string &inOriginalName=std::string())

+ Here is the call graph for this function:

InstanceArraySharedPtr torc::generic::InstanceArray::Factory::newInstanceArrayPtr ( const std::string &  inName,
const ViewSharedPtr inViewPtr,
const ViewSharedPtr inMaster,
const std::vector< size_t > &  inLimits,
const ChildFactorySharedPtr inFactory = BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()),
const std::string &  inOriginalName = std::string() 
)
throw (Error
)
virtual

Create an instance array

Parameters
[in]inNameName of the instance array to be created.
[in]inViewPtrPointer to parented(view) object.
[in]inMasterPointer to master object.
[in]inLimitsDimensions of the vector.
[in]inFactoryFactory for the child.
[in]inOriginalNameOriginal name of the instance array [optional].
Returns
Pointer to created instance array.

Definition at line 77 of file InstanceArray.cpp.

80  {
81  try {
82  InstanceArraySharedPtr newInstanceArray;
83  create(newInstanceArray);
84  newInstanceArray->setName(inName);
85  //newInstanceArray->setMaster(inMaster);
86  newInstanceArray->constructChildren(inFactory, inLimits);
87  newInstanceArray->bindToMasterView(inMaster);
88  newInstanceArray->setOriginalName(inOriginalName);
89  inViewPtr->addInstance(newInstanceArray);
90  return newInstanceArray;
91  } catch(Error& e) {
92  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
93  throw;
94  }
95 }
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58
boost::shared_ptr< InstanceArray > InstanceArraySharedPtr

+ Here is the call graph for this function:


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