#include <Vector.hpp>
Public Types | |
typedef Composite< _Type > | BaseType |
typedef BaseType::Type | Type |
typedef BaseType::List | List |
typedef BaseType::Pointer | Pointer |
typedef BaseType::SizeType | SizeType |
typedef _ChildType | ChildType |
typedef boost::shared_ptr < ChildType > | ChildPointer |
typedef _ChildFactoryType | ChildFactory |
typedef boost::shared_ptr < _ChildFactoryType > | ChildFactorySharedPtr |
Public Member Functions | |
virtual CompositionType | getCompositionType () const throw () |
virtual SizeType | getSize () const throw () |
virtual const Pointer | get (const std::vector< SizeType > &inIndices) const throw (Error) |
virtual void | getChildren (List &outChildren) const 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 throw () |
bool | getIsPreserved () const throw () |
Protected Member Functions | |
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) throw () |
const boost::shared_ptr < ChildFactory > | getFactory () const throw () |
void | setFactory (const boost::shared_ptr< ChildFactory > &inSource) throw () |
Private Types | |
typedef SymTab< SizeType, Pointer > | SparseElements |
Private Member Functions | |
void | autoBlast () const throw (Error) |
void | incrementIndices (std::vector< SizeType > &indices, const std::vector< SizeType > &limits) const throw () |
SizeType | indicesToAbsoluteIndex (const std::vector< SizeType > &inIndices) const throw () |
SizeType | storageSize () const |
Vector (const Vector< _Type, _ChildType, _ChildFactoryType, cPreserve > &source) throw () | |
Vector< _Type, _ChildType, _ChildFactoryType, cPreserve > & | operator= (const Vector< _Type, _ChildType, _ChildFactoryType, cPreserve > &source) throw () |
Private Attributes | |
std::vector< SizeType > | mLimits |
List | mChildren |
SparseElements | mSparseElements |
boost::shared_ptr< ChildFactory > | mFactory |
bool | mIsPreserved |
SizeType | mPreservationThreshold |
This provides methods for accessing and adding elements to the array. It also implements the VectorPreservation algorithm if cPreserve is set to true. The vector class creates elements derived from VectorBit class by using the provided factory.
Definition at line 57 of file Vector.hpp.
typedef BaseType::List torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::List |
List of Shared Pointers to objects of type Type
Reimplemented from torc::generic::Composite< _Type >.
Definition at line 66 of file Vector.hpp.
typedef BaseType::Pointer torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::Pointer |
Shared Pointer to object of type Type
Reimplemented from torc::generic::Composite< _Type >.
Definition at line 67 of file Vector.hpp.
CompositionType torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::getCompositionType | ( | ) | const throw () [inline, virtual] |
Get composition type for this object
Implements torc::generic::Composite< _Type >.
Definition at line 349 of file Vector.hpp.
Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::SizeType torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::getSize | ( | void | ) | const throw () [inline, virtual] |
Get the total number of bits of the composition
Implements torc::generic::Composite< _Type >.
Definition at line 363 of file Vector.hpp.
const Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::Pointer torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::get | ( | const std::vector< SizeType > & | inIndices | ) | const throw (Error) [inline, virtual] |
Get a specific member of this composition.
[in] | inIndices | A list of indices to be accessed. The number of indices must be equal to the number of dimensions. |
Error | Index dimensions mismatch
| |
Error | Array index out of bounds
| |
Error | Empty Array
|
[in] | inIndices | A list of indices to be accessed. The number of indices must be equal to the number of dimensions. |
Error | Index dimensions mismatch |
Definition at line 427 of file Vector.hpp.
virtual void torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::getChildren | ( | List & | outChildren | ) | const throw (Error) [virtual] |
Get children of this composition.
[out] | outChildren | A list of all children for this composition |
Error | If factory is not set and preserve is true and the vector has not been blasted, an exception is generated. |
void torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::setChildren | ( | const List & | inSource | ) | throw (Error) [inline, protected] |
Set list of children for unpreserved vector.
[in] | inSource | List of children |
Definition at line 549 of file Vector.hpp.
void torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::constructChildren | ( | const boost::shared_ptr< ChildFactory > & | inFactory, | |
const std::vector< SizeType > & | inLimits | |||
) | throw (Error) [inline] |
Create list of children using the provided factory and limits
[in] | inFactory | ChildFactory to use for construcing children |
[in] | inLimits | Array dimensions |
Error | Children could not be created |
[in] | inFactory | ChildFactory to use for construcing children |
[in] | inLimits | Array dimensions |
Error | Children could not be created |
Definition at line 582 of file Vector.hpp.
void torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::getLimits | ( | std::vector< SizeType > & | outLimits | ) | const throw () [inline] |
Get dimensions of the array.
[in] | outLimits | Dimensions of the vector |
Definition at line 814 of file Vector.hpp.
void torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::setLimits | ( | const std::vector< SizeType > & | inSource | ) | throw () [inline, protected] |
Set dimensions of the array.
[in] | inSource | Dimensions of the vector |
Definition at line 842 of file Vector.hpp.
const boost::shared_ptr< _ChildFactoryType > torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::getFactory | ( | ) | const throw () [inline, protected] |
Get current factory
Error | Null Child Factory
|
Definition at line 858 of file Vector.hpp.
void torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::setFactory | ( | const boost::shared_ptr< ChildFactory > & | inSource | ) | throw () [protected] |
Set current factory
[in] | inSource | ChildFactory object |