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

Represents a single element of a vector composition. More...

#include <VectorBit.hpp>

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

Public Types

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

Public Member Functions

virtual CompositionType getCompositionType () const
 
virtual SizeType getSize () const
 
virtual void getChildren (List &outChildren) const throw (Error)
 
virtual const Pointer get (const std::vector< SizeType > &inIndices) const throw (Error)
 
const std::vector< SizeType > & getIndices () const
 
void setIndices (const std::vector< SizeType > &inSource)
 
SizeType getAbsoluteIndex () const
 
void setAbsoluteIndex (SizeType inSource)
 
virtual ~VectorBit () throw ()
 
virtual void setParentCollection (const Pointer &inParentCollection)
 
virtual Pointer getParentCollection () const
 
void setWeakThis (const WeakPointer &inWeakThis)
 
Pointer getSharedThis () const
 

Protected Member Functions

 VectorBit ()
 

Private Member Functions

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

Private Attributes

std::vector< SizeTypemIndices
 
SizeType mAbsoluteIndex
 

Detailed Description

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

Represents a single element of a vector composition.

A VectorBit is used to represent a bit of a vector. It contains a pointer to the vector and the particular index where it was stored. For a Vector where the _PRESERVE parameter is true, this is setup during the blast operation. Otherwise, this is moreor less similar to the Scalar composition.

Definition at line 41 of file VectorBit.hpp.

Member Typedef Documentation

template<typename _Type>
typedef Composite<Type> torc::generic::VectorBit< _Type >::BaseType

Definition at line 47 of file VectorBit.hpp.

template<typename _Type>
typedef BaseType::List torc::generic::VectorBit< _Type >::List

Definition at line 48 of file VectorBit.hpp.

template<typename _Type>
typedef BaseType::Pointer torc::generic::VectorBit< _Type >::Pointer

Definition at line 49 of file VectorBit.hpp.

template<typename _Type>
typedef BaseType::SizeType torc::generic::VectorBit< _Type >::SizeType

Definition at line 50 of file VectorBit.hpp.

template<typename _Type>
typedef _Type torc::generic::VectorBit< _Type >::Type

Definition at line 46 of file VectorBit.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::VectorBit< _Type >::VectorBit ( )
protected

Definition at line 185 of file VectorBit.hpp.

185 : BaseType(), mIndices() {}
Composite< Type > BaseType
Definition: VectorBit.hpp:47
std::vector< SizeType > mIndices
Definition: VectorBit.hpp:111
template<typename _Type >
torc::generic::VectorBit< _Type >::~VectorBit ( )
throw (
)
virtual

Definition at line 187 of file VectorBit.hpp.

187 {}
template<typename _Type>
torc::generic::VectorBit< _Type >::VectorBit ( const VectorBit< _Type > &  source)
private

Member Function Documentation

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

Get a specific member of this composition.

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

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 152 of file VectorBit.hpp.

153  {
154  return Pointer();
155 }
BaseType::Pointer Pointer
Definition: VectorBit.hpp:49
template<typename _Type >
VectorBit< _Type >::SizeType torc::generic::VectorBit< _Type >::getAbsoluteIndex ( ) const
inline

Definition at line 177 of file VectorBit.hpp.

177  {
178  return mAbsoluteIndex;
179 }
template<typename _Type>
void torc::generic::VectorBit< _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 140 of file VectorBit.hpp.

141  {
142  return;
143 }

+ Here is the caller graph for this function:

template<typename _Type >
CompositionType torc::generic::VectorBit< _Type >::getCompositionType ( ) const
virtual

Get composition type for this object

Returns
The CompositionType inSource eCompositionTypeVectorBit is returned

Get composition type for this object

Returns
The CompositionType inSource eCompositionTypeScalar is returned

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

Definition at line 123 of file VectorBit.hpp.

template<typename _Type >
const std::vector< typename VectorBit< _Type >::SizeType > & torc::generic::VectorBit< _Type >::getIndices ( ) const
inline

Get the index of this bit in the vector.

Returns
A vector containing the indices to which this element belonged.

Definition at line 163 of file VectorBit.hpp.

163  {
164  return mIndices;
165 }
std::vector< SizeType > mIndices
Definition: VectorBit.hpp:111
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 >
VectorBit< _Type >::SizeType torc::generic::VectorBit< _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 131 of file VectorBit.hpp.

131  {
132  return 1;
133 }
template<typename _Type>
VectorBit<_Type>& torc::generic::VectorBit< _Type >::operator= ( const VectorBit< _Type > &  source)
private
template<typename _Type >
void torc::generic::VectorBit< _Type >::setAbsoluteIndex ( SizeType  inSource)

Definition at line 181 of file VectorBit.hpp.

181  {
182  mAbsoluteIndex = inSource;
183 }
template<typename _Type >
void torc::generic::VectorBit< _Type >::setIndices ( const std::vector< SizeType > &  inSource)

Set the index of this bit in the vector.

Parameters
[in]inSourceA vector of indices for this element

Definition at line 172 of file VectorBit.hpp.

172  {
173  mIndices = inSource;
174 }
std::vector< SizeType > mIndices
Definition: VectorBit.hpp:111
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

Field Documentation

template<typename _Type>
SizeType torc::generic::VectorBit< _Type >::mAbsoluteIndex
private

Definition at line 112 of file VectorBit.hpp.

template<typename _Type>
std::vector<SizeType> torc::generic::VectorBit< _Type >::mIndices
private

Definition at line 111 of file VectorBit.hpp.


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