torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::Scalar< _Type > Class Template Reference

A single object with no child objects. More...

#include <Scalar.hpp>

+ Inheritance diagram for torc::generic::Scalar< _Type >:
+ Collaboration diagram for torc::generic::Scalar< _Type >:

Public Types

typedef Composite< _Type >::Type Type
 
typedef Composite< _Type >::Pointer Pointer
 
typedef Composite< _Type >::List List
 
typedef Composite< _Type >
::SizeType 
SizeType
 
typedef boost::weak_ptr< TypeWeakPointer
 

Public Member Functions

virtual ~Scalar () throw ()
 
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)
 
virtual void setParentCollection (const Pointer &inParentCollection)
 
virtual Pointer getParentCollection () const
 
void setWeakThis (const WeakPointer &inWeakThis)
 
Pointer getSharedThis () const
 

Protected Member Functions

 Scalar ()
 

Private Member Functions

 Scalar (const Scalar< _Type > &source)
 
Scalar< _Type > & operator= (const Scalar< _Type > &source)
 

Detailed Description

template<typename _Type>
class torc::generic::Scalar< _Type >

A single object with no child objects.

Definition at line 34 of file Scalar.hpp.

Member Typedef Documentation

template<typename _Type>
typedef Composite<_Type>::List torc::generic::Scalar< _Type >::List

Definition at line 41 of file Scalar.hpp.

template<typename _Type>
typedef Composite<_Type>::Pointer torc::generic::Scalar< _Type >::Pointer

Definition at line 40 of file Scalar.hpp.

template<typename _Type>
typedef Composite<_Type>::SizeType torc::generic::Scalar< _Type >::SizeType

Definition at line 42 of file Scalar.hpp.

template<typename _Type>
typedef Composite<_Type>::Type torc::generic::Scalar< _Type >::Type

Definition at line 39 of file Scalar.hpp.

template<typename _Type>
typedef boost::weak_ptr<Type> torc::generic::Composite< _Type >::WeakPointer
inherited

Definition at line 56 of file Composite.hpp.

Constructor & Destructor Documentation

template<typename _Type >
torc::generic::Scalar< _Type >::~Scalar ( )
throw (
)
virtual

Definition at line 88 of file Scalar.hpp.

88 {}
template<typename _Type >
torc::generic::Scalar< _Type >::Scalar ( )
protected

Definition at line 130 of file Scalar.hpp.

130 : Composite<_Type>() {}
template<typename _Type>
torc::generic::Scalar< _Type >::Scalar ( const Scalar< _Type > &  source)
private

Member Function Documentation

template<typename _Type>
const Scalar< _Type >::Pointer torc::generic::Scalar< _Type >::get ( const std::vector< SizeType > &  indices) const
throw (Error
)
virtual

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< _Type >.

Definition at line 115 of file Scalar.hpp.

116  {
117  return Pointer();
118 }
Composite< _Type >::Pointer Pointer
Definition: Scalar.hpp:40
template<typename _Type>
void torc::generic::Scalar< _Type >::getChildren ( List outChildren) const
throw (Error
)
virtual

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< _Type >.

Definition at line 125 of file Scalar.hpp.

126  {
127  return;
128 }
template<typename _Type >
CompositionType torc::generic::Scalar< _Type >::getCompositionType ( ) const
virtual

Get composition type for this object

Returns
The CompositionType inSource eCompositionTypeScalar is returned

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

Definition at line 95 of file Scalar.hpp.

template<typename _Type >
Composite< _Type >::Pointer torc::generic::Composite< _Type >::getParentCollection ( ) const
inlinevirtualinherited

Get a pointer to the parent collection

Returns
A pointer to the parent collection if present, empty pointer otherwise

Definition at line 156 of file Composite.hpp.

156  {
157  return mParentCollection.lock();
158 }
WeakPointer mParentCollection
Definition: Composite.hpp:133
Pointer torc::generic::SelfReferencing< _Type >::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
template<typename _Type >
Scalar< _Type >::SizeType torc::generic::Scalar< _Type >::getSize ( void  ) const
virtual

Get the total number of bits of the composition

Returns
Number of bits

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

Definition at line 103 of file Scalar.hpp.

103  {
104  return 1;
105 }
template<typename _Type>
Scalar<_Type>& torc::generic::Scalar< _Type >::operator= ( const Scalar< _Type > &  source)
private
template<typename _Type>
void torc::generic::Composite< _Type >::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)

Definition at line 145 of file Composite.hpp.

146  {
147  mParentCollection = inParentCollection;
148 }
WeakPointer mParentCollection
Definition: Composite.hpp:133
void torc::generic::SelfReferencing< _Type >::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

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