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

#include <SingleParameter.hpp>

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

Data Structures

class  Factory
 

Public Types

typedef VisitorType
< SingleParameter
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< Parameter >
::Type 
Type
 
typedef Composite< Parameter >
::Pointer 
Pointer
 
typedef Composite< Parameter >
::List 
List
 
typedef Composite< Parameter >
::SizeType 
SizeType
 

Public Member Functions

virtual ~SingleParameter () 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 > &indices) const throw (Error)
 
virtual void getChildren (List &outChildren) const throw (Error)
 

Protected Member Functions

 SingleParameter ()
 

Friends

class FactoryType< SingleParameter >
 

Detailed Description

Represents a single parameter inSource.

Definition at line 39 of file SingleParameter.hpp.

Member Typedef Documentation

Definition at line 41 of file Scalar.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.

Definition at line 40 of file Scalar.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.

Definition at line 42 of file Scalar.hpp.

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

Definition at line 62 of file Composite.hpp.

Definition at line 39 of file Scalar.hpp.

Definition at line 50 of file Composite.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::SingleParameter::~SingleParameter ( )
throw (
)
virtual

Definition at line 68 of file SingleParameter.cpp.

68 {}
torc::generic::SingleParameter::SingleParameter ( )
protected

Definition at line 66 of file SingleParameter.cpp.

66 : Parameter(), Scalar<Parameter>() {}

Member Function Documentation

void torc::generic::SingleParameter::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 57 of file SingleParameter.cpp.

57  {
58  try {
59  runVisitor(*this, inoutVisitor);
60  } catch(Error& e) {
61  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
62  throw;
63  }
64 }
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
Definition: VisitorType.hpp:78

+ Here is the call graph for this function:

virtual const Pointer torc::generic::Scalar< Parameter >::get ( const std::vector< SizeType > &  indices) const
throw (Error
)
virtualinherited

Get a specific member of this composition.

Parameters
[in]indicesA list of indices to be accessed. The number of indices must be equal to the number of dimensions.
Returns
An empty pointer is returned

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

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 void torc::generic::Scalar< Parameter >::getChildren ( List outChildren) const
throw (Error
)
virtualinherited

Get children of this composition.

Parameters
[out]outChildrenA list of all children for this composition
Note
This wil return empty list for scalar

Get children of this composition.

Parameters
[out]outChildrenA list of all children for this composition

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 CompositionType torc::generic::Scalar< Parameter >::getCompositionType ( ) const
virtualinherited

Get composition type for this object

Returns
The CompositionType inSource eCompositionTypeScalar is returned

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

virtual CompositionType torc::generic::Composite< Parameter >::getCompositionType ( ) const
pure virtualinherited
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 SizeType torc::generic::Scalar< Parameter >::getSize ( void  ) const
virtualinherited

Get the total number of bits of the composition

Returns
Number of bits

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

virtual size_t torc::generic::Composite< Parameter >::getSize ( void  ) const
pure virtualinherited
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 }
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< SingleParameter >
friend

Definition at line 43 of file SingleParameter.hpp.


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