torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::ParameterArray Class Referenceabstract

Represents a parameter array. More...

#include <ParameterArray.hpp>

+ Inheritance diagram for torc::generic::ParameterArray:
+ Collaboration diagram for torc::generic::ParameterArray:

Data Structures

class  Factory
 

Public Types

typedef Vector< Parameter,
ParameterArrayElement,
ParameterArrayElement::Factory,
false > 
BaseVectorType
 
typedef VisitorType
< ParameterArray
Visitor
 
typedef Parameter Type
 
typedef boost::shared_ptr< TypePointer
 
typedef boost::weak_ptr< TypeWeakPointer
 
typedef std::vector< PointerList
 
typedef size_t SizeType
 
typedef std::string Name
 
typedef Composite< ParameterBaseType
 
typedef BaseType::Type Type
 
typedef BaseType::List List
 
typedef BaseType::Pointer Pointer
 
typedef BaseType::SizeType SizeType
 
typedef ParameterArrayElement ChildType
 
typedef boost::shared_ptr
< ChildType
ChildPointer
 
typedef
ParameterArrayElement::Factory 
ChildFactory
 
typedef boost::shared_ptr
< ParameterArrayElement::Factory
ChildFactorySharedPtr
 

Public Member Functions

virtual ~ParameterArray () throw ()
 
virtual void accept (BaseVisitor &inoutVisitor) throw (Error)
 
const Value getValue () const
 
void setValue (const Value &inSource)
 
virtual const Unit getUnit () const
 
virtual void setUnit (const Unit &inSource)
 
virtual CompositionType getCompositionType () const =0
 
virtual size_t getSize () const =0
 
virtual void getChildren (List &outChildren) const =0 throw (Error)
 
virtual const Pointer get (const std::vector< SizeType > &inIndices) const =0 throw (Error)
 
virtual void setParentCollection (const Pointer &inParentCollection)
 
virtual Pointer getParentCollection () const
 
void setWeakThis (const WeakPointer &inWeakThis)
 
Pointer getSharedThis () const
 
virtual const std::string getName () const
 
void setName (const std::string &inSource) throw (Error)
 
virtual Name getOriginalName () const
 
virtual void setOriginalName (const Name &inSource)
 
virtual CompositionType getCompositionType () const
 
virtual SizeType getSize () const
 
virtual const Pointer get (const std::vector< SizeType > &inIndices) const throw (Error)
 
virtual void getChildren (List &outChildren) const throw (Error)
 
void applyOnAllChildren (const _Action &action) throw (Error)
 
virtual void forceAutoBlast (void) throw (Error)
 
virtual void getCreatedChildren (List &outChildren) const throw (Error)
 
void constructChildren (const boost::shared_ptr< ChildFactory > &inFactory, const std::vector< SizeType > &inLimits) throw (Error)
 
void getLimits (std::vector< SizeType > &outLimits) const
 
bool getIsPreserved () const
 

Protected Member Functions

virtual void onChildCreate (const boost::shared_ptr< BaseVectorType::ChildType > &inCreatedChild) const throw (Error)
 
 ParameterArray ()
 
void setChildren (const List &inSource) throw (Error)
 
virtual void onAutoBlast () const throw (Error)
 
virtual void onChildCreate (const boost::shared_ptr< ChildType > &inCreatedChild) const throw (Error)
 
void setLimits (const std::vector< SizeType > &inSource)
 
const boost::shared_ptr
< ChildFactory
getFactory () const
 
void setFactory (const boost::shared_ptr< ChildFactory > &inSource)
 

Friends

class FactoryType< ParameterArray >
 

Detailed Description

Represents a parameter array.

The ParameterArray class represents an array of parameters.

Definition at line 42 of file ParameterArray.hpp.

Member Typedef Documentation

Definition at line 61 of file Vector.hpp.

Definition at line 57 of file Vector.hpp.

typedef std::vector<Pointer> torc::generic::Composite< Parameter >::List
inherited

List of Shared Pointers to objects of type Type

Definition at line 61 of file Composite.hpp.

typedef std::string torc::generic::Renamable::Name
inherited

Definition at line 40 of file generic/Renamable.hpp.

typedef boost::shared_ptr<Type> torc::generic::Composite< Parameter >::Pointer
inherited

Shared Pointer to object of type Type

Definition at line 55 of file Composite.hpp.

typedef BaseType::SizeType torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::SizeType
inherited

Definition at line 59 of file Vector.hpp.

typedef size_t torc::generic::Composite< Parameter >::SizeType
inherited

Definition at line 62 of file Composite.hpp.

Definition at line 50 of file Composite.hpp.

Definition at line 56 of file Vector.hpp.

typedef boost::weak_ptr<Type> torc::generic::Composite< Parameter >::WeakPointer
inherited

Definition at line 56 of file Composite.hpp.

Constructor & Destructor Documentation

torc::generic::ParameterArray::~ParameterArray ( )
throw (
)
virtual

Definition at line 43 of file ParameterArray.cpp.

43 {}
torc::generic::ParameterArray::ParameterArray ( )
protected

Member Function Documentation

void torc::generic::ParameterArray::accept ( BaseVisitor inoutVisitor)
throw (Error
)
virtual

Receive an inoutVisitor to this class. The visit method of the inoutVisitor is called and a reference to this object is passed as a parameter. It has to be noted however, that a dynamic_cast is performed inside this method. If the cast fails, an appropriate exception is thrown by this method. This situation can arise when the passed Visitor object does not inherit from the appropriate inoutVisitor specialization. See Visitor documentation for more details.

Parameters
[in,out]inoutVisitorA reference to the inoutVisitor object
Exceptions
ErrorVisitor type inappropriate for visiting this object or any other error thrown by the Visitor::throw() method.

Implements torc::generic::Visitable.

Definition at line 96 of file ParameterArray.cpp.

96  {
97  try {
98  runVisitor(*this, inoutVisitor);
99  } catch(Error& e) {
100  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
101  throw;
102  }
103 }
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
Definition: VisitorType.hpp:78

+ Here is the call graph for this function:

void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::applyOnAllChildren ( const _Action &  action)
throw (Error
)
inherited
void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::constructChildren ( const boost::shared_ptr< ChildFactory > &  inFactory,
const std::vector< SizeType > &  inLimits 
)
throw (Error
)
inlineinherited

Create list of children using the provided factory and limits

Parameters
[in]inFactoryChildFactory to use for construcing children
[in]inLimitsArray dimensions
Exceptions
ErrorChildren could not be created
Note
setName() must have already been called before calling this method. For preserved arrays this does not actually do anything other than storing the factory and limits inside itself for later use.

Create list of children using the provided factory and limits

Parameters
[in]inFactoryChildFactory to use for construcing children
[in]inLimitsArray dimensions
Exceptions
ErrorChildren could not be created
Note
For preserved arrays this does not actually do anything other than storing the factory and limits inside itself for later use.
virtual void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::forceAutoBlast ( void  )
throw (Error
)
virtualinherited

Force creation of VectorBit children, even if this is a preserved Vector.

virtual const Pointer torc::generic::Composite< Parameter >::get ( const std::vector< SizeType > &  inIndices) const
throw (Error
)
pure virtualinherited

Get a specific member of this composition.

Note
This is relevant for Vector composition only. Other compositions return a NULL pointer
Parameters
[in]inIndicesA list of indices to be accessed. The number of indices must be equal to the number of dimensions.
Returns
A pointer to the child situated at the specified indices. For non-relevant types a NULL pointer is returned
Exceptions
ErrorIndex dimensions mismatch

Implemented in torc::generic::Vector< Parameter, ParameterArrayElement, ParameterArrayElement::Factory, false >, torc::generic::VectorBit< Parameter >, and torc::generic::Scalar< Parameter >.

virtual const Pointer torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::get ( const std::vector< SizeType > &  inIndices) const
throw (Error
)
virtualinherited

Get a specific member of this composition.

Note
This is relevant for Vector composition only. Other compositions return a NULL pointer
Parameters
[in]inIndicesA list of indices to be accessed. The number of indices must be equal to the number of dimensions.
Returns
A pointer to the child situated at the specified indices. For non-relevant types a NULL pointer is returned
Exceptions
ErrorIndex dimensions mismatch
  • Id : eMessageIdErrorArrayIndexSizeMismatch
  • Context Data
    • Array Index Size - size_t
    • Array Dimension Size - size_t
ErrorArray index out of bounds
  • Id : eMessageIdErrorArrayIndexOutOfBounds
  • Context Data
    • Array Index - size_t
    • Array Dimension - size_t
ErrorEmpty Array
  • Id : eMessageIdErrorEmptyArray
  • Context Data
    • Array Dimension - size_t

Get a specific member of this composition.

Note
This is relevant for Vector composition only. Other compositions return a NULL pointer
Parameters
[in]inIndicesA list of indices to be accessed. The number of indices must be equal to the number of dimensions.
Returns
A pointer to the child situated at the specified indices. For non-relevant types a NULL pointer is returned
Exceptions
ErrorIndex dimensions mismatch

Implements torc::generic::Composite< Parameter >.

virtual void torc::generic::Composite< Parameter >::getChildren ( List outChildren) const
throw (Error
)
pure virtualinherited

Get children of this composition.

Note
This is relevant for Vector and Bundle compositions only. Other compositions return a NULL pointer
Parameters
[out]outChildrenA list of all children for this composition

Implemented in torc::generic::Vector< Parameter, ParameterArrayElement, ParameterArrayElement::Factory, false >, torc::generic::Scalar< Parameter >, and torc::generic::VectorBit< Parameter >.

virtual void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::getChildren ( List outChildren) const
throw (Error
)
virtualinherited

Get children of this composition.

Parameters
[out]outChildrenA list of all children for this composition
Exceptions
ErrorIf factory is not set and preserve is true and the vector has not been blasted, an exception is generated.

Implements torc::generic::Composite< Parameter >.

virtual CompositionType torc::generic::Composite< Parameter >::getCompositionType ( ) const
pure virtualinherited
virtual CompositionType torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::getCompositionType ( ) const
virtualinherited

Get composition type for this object

Returns
The CompositionType inSource eCompositionTypeVector is returned

Implements torc::generic::Composite< Parameter >.

virtual void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::getCreatedChildren ( List outChildren) const
throw (Error
)
virtualinherited
const boost::shared_ptr<ChildFactory> torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::getFactory ( ) const
inlineprotectedinherited

Get current factory

Returns
Return ChildFactory object
Exceptions
ErrorNull Child Factory
  • Id : eMessageIdErrorNullChildfactory
  • Context Data

    • Child factory - ChildFactory

    Get current factory

Returns
Return ChildFactory object
bool torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::getIsPreserved ( ) const
inlineinherited
void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::getLimits ( std::vector< SizeType > &  outLimits) const
inlineinherited

Get dimensions of the array.

Parameters
[in]outLimitsDimensions of the vector

Get dimensions of the array.

Returns
Dimensions of the vector
const std::string torc::generic::Nameable::getName ( void  ) const
inlinevirtualinherited

Get the object name

Returns
Name of the object

Definition at line 89 of file Nameable.hpp.

89  {
90  return mName;
91 }

+ Here is the caller graph for this function:

Renamable::Name torc::generic::Renamable::getOriginalName ( ) const
inlinevirtualinherited

Get the new name provided for the object.

Returns
Name of the object

Definition at line 78 of file generic/Renamable.hpp.

78  {
79  return mOriginalName;
80 }

+ Here is the caller graph for this function:

virtual Pointer torc::generic::Composite< Parameter >::getParentCollection ( ) const
inlinevirtualinherited

Get a pointer to the parent collection

Returns
A pointer to the parent collection if present, empty pointer otherwise
Pointer torc::generic::SelfReferencing< Parameter >::getSharedThis ( ) const
inlineinherited

Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.

Returns
A shared pointer to this object

Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.

Parameters
[out]ptrSet to a shared pointer to this object
virtual size_t torc::generic::Composite< Parameter >::getSize ( void  ) const
pure virtualinherited
virtual SizeType torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::getSize ( void  ) const
virtualinherited

Get the total number of bits of the composition

Returns
Number of bits

Implements torc::generic::Composite< Parameter >.

const Unit torc::generic::Parameter::getUnit ( ) const
virtualinherited

Definition at line 44 of file Parameter.cpp.

44  {
45  return mUnit;
46 }
const Value torc::generic::Parameter::getValue ( ) const
inlineinherited

Definition at line 71 of file Parameter.hpp.

71  {
72  return mValue;
73 }
virtual void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::onAutoBlast ( ) const
throw (Error
)
protectedvirtualinherited
void torc::generic::ParameterArray::onChildCreate ( const boost::shared_ptr< BaseVectorType::ChildType > &  inCreatedChild) const
throw (Error
)
protectedvirtual

Definition at line 35 of file ParameterArray.cpp.

36  {
37  inCreatedChild->setName(getName());
38 }
virtual const std::string getName() const
Definition: Nameable.hpp:89
virtual void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::onChildCreate ( const boost::shared_ptr< ChildType > &  inCreatedChild) const
throw (Error
)
protectedvirtualinherited
void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::setChildren ( const List inSource)
throw (Error
)
protectedinherited

Set list of children for unpreserved vector.

Parameters
[in]inSourceList of children
void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::setFactory ( const boost::shared_ptr< ChildFactory > &  inSource)
protectedinherited

Set current factory

Parameters
[in]inSourceChildFactory object
void torc::generic::Vector< Parameter , ParameterArrayElement , ParameterArrayElement::Factory , cPreserve >::setLimits ( const std::vector< SizeType > &  inSource)
protectedinherited

Set dimensions of the array.

Parameters
[in]inSourceDimensions of the vector
void torc::generic::Nameable::setName ( const std::string &  inSource)
throw (Error
)
inherited

Set a name for this object

Parameters
[in]inSourceName of the object
Exceptions
ErrorCould not set name, because name is empty (Will be used by array members)
  • Id : eMessageIdErrorEmptyItemName
  • Context Data

Set a name for this object

Parameters
[in]inSourceName of the object
Exceptions
ErrorCould not set name, because name is empty (Will be used by array members)

Definition at line 41 of file Nameable.cpp.

41  {
42  if(inSource.empty()) {
43  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
44  e.saveContextData("Nameable", inSource);
45  throw e;
46  }
47  mName = inSource;
48 }

+ Here is the call graph for this function:

void torc::generic::Renamable::setOriginalName ( const Name inSource)
virtualinherited

Set the new name provided for the object.

Parameters
[in]inSourceName of the object

Definition at line 35 of file generic/Renamable.cpp.

35  {
36  mOriginalName = inSource;
37 }
virtual void torc::generic::Composite< Parameter >::setParentCollection ( const Pointer inParentCollection)
inlinevirtualinherited

Set a pointer to a parnt composition.

Parameters
[in]inParentCollectionpointer to the parent collection (Vector/Bundle)

Set a pointer to a parnt composition.

Parameters
[in]parentCollectionpointer to the parent collection (Vector/Bundle)
void torc::generic::Parameter::setUnit ( const Unit inSource)
virtualinherited

Definition at line 48 of file Parameter.cpp.

48  {
49  mUnit = inSource;
50 }
void torc::generic::Parameter::setValue ( const Value inSource)
inherited

Definition at line 40 of file Parameter.cpp.

40  {
41  mValue = inSource;
42 }
void torc::generic::SelfReferencing< Parameter >::setWeakThis ( const WeakPointer inWeakThis)
inlineinherited

Set a weak pointer to this object. This will be used later to get a shared pointer to this object from within other member methods if required. This should be called by the Factory creating the object.

Parameters
[in]weakThisA weak pointer to this object

Friends And Related Function Documentation

friend class FactoryType< ParameterArray >
friend

Definition at line 47 of file ParameterArray.hpp.


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