torc-master
|
An array of objects. More...
#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 |
typedef boost::weak_ptr< Type > | WeakPointer |
Public Member Functions | |
virtual | ~Vector () throw () |
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) |
template<typename _Action > | |
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 |
virtual void | setParentCollection (const Pointer &inParentCollection) |
virtual Pointer | getParentCollection () const |
void | setWeakThis (const WeakPointer &inWeakThis) |
Pointer | getSharedThis () const |
Protected Member Functions | |
Vector () | |
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) |
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 |
SizeType | indicesToAbsoluteIndex (const std::vector< SizeType > &inIndices) const |
SizeType | storageSize () const |
Vector (const Vector< _Type, _ChildType, _ChildFactoryType, cPreserve > &source) | |
Vector< _Type, _ChildType, _ChildFactoryType, cPreserve > & | operator= (const Vector< _Type, _ChildType, _ChildFactoryType, cPreserve > &source) |
Private Attributes | |
std::vector< SizeType > | mLimits |
List | mChildren |
SparseElements | mSparseElements |
boost::shared_ptr< ChildFactory > | mFactory |
bool | mIsPreserved |
SizeType | mPreservationThreshold |
An array of objects.
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 50 of file Vector.hpp.
typedef Composite<_Type> torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::BaseType |
Definition at line 55 of file Vector.hpp.
typedef _ChildFactoryType torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::ChildFactory |
Definition at line 62 of file Vector.hpp.
typedef boost::shared_ptr<_ChildFactoryType> torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::ChildFactorySharedPtr |
Definition at line 63 of file Vector.hpp.
typedef boost::shared_ptr<ChildType> torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::ChildPointer |
Definition at line 61 of file Vector.hpp.
typedef _ChildType torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::ChildType |
Definition at line 60 of file Vector.hpp.
typedef BaseType::List torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::List |
Definition at line 57 of file Vector.hpp.
typedef BaseType::Pointer torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::Pointer |
Definition at line 58 of file Vector.hpp.
typedef BaseType::SizeType torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::SizeType |
Definition at line 59 of file Vector.hpp.
|
private |
Definition at line 66 of file Vector.hpp.
typedef BaseType::Type torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::Type |
Definition at line 56 of file Vector.hpp.
|
inherited |
Definition at line 56 of file Composite.hpp.
|
protected |
Definition at line 292 of file Vector.hpp.
|
virtual |
Definition at line 289 of file Vector.hpp.
|
private |
void torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >::applyOnAllChildren | ( | const _Action & | action | ) | |
throw | ( | Error | |||
) |
|
inlineprivate |
Definition at line 534 of file Vector.hpp.
|
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 |
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 |
Definition at line 502 of file Vector.hpp.
|
inlinevirtual |
Force creation of VectorBit children, even if this is a preserved Vector.
Definition at line 479 of file Vector.hpp.
|
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
|
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 |
Implements torc::generic::Composite< _Type >.
Definition at line 363 of file Vector.hpp.
|
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. |
Implements torc::generic::Composite< _Type >.
Definition at line 428 of file Vector.hpp.
|
virtual |
Get composition type for this object
Implements torc::generic::Composite< _Type >.
Definition at line 301 of file Vector.hpp.
|
virtual |
Definition at line 583 of file Vector.hpp.
|
inlineprotected |
Get current factory
Error | Null Child Factory
|
Definition at line 680 of file Vector.hpp.
|
inline |
Definition at line 658 of file Vector.hpp.
|
inline |
Get dimensions of the array.
[in] | outLimits | Dimensions of the vector |
Get dimensions of the array.
Definition at line 652 of file Vector.hpp.
|
inlinevirtualinherited |
Get a pointer to the parent collection
Definition at line 156 of file Composite.hpp.
|
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.
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.
[out] | ptr | Set to a shared pointer to this object |
|
virtual |
Get the total number of bits of the composition
Implements torc::generic::Composite< _Type >.
Definition at line 312 of file Vector.hpp.
|
private |
Definition at line 605 of file Vector.hpp.
|
inlineprivate |
Definition at line 624 of file Vector.hpp.
|
protectedvirtual |
Definition at line 470 of file Vector.hpp.
|
protectedvirtual |
Definition at line 599 of file Vector.hpp.
|
private |
|
protected |
Set list of children for unpreserved vector.
[in] | inSource | List of children |
Definition at line 464 of file Vector.hpp.
|
protected |
Set current factory
[in] | inSource | ChildFactory object |
Definition at line 690 of file Vector.hpp.
|
protected |
Set dimensions of the array.
[in] | inSource | Dimensions of the vector |
Definition at line 668 of file Vector.hpp.
|
inlinevirtualinherited |
Set a pointer to a parnt composition.
[in] | inParentCollection | pointer to the parent collection (Vector/Bundle) |
Set a pointer to a parnt composition.
[in] | parentCollection | pointer to the parent collection (Vector/Bundle) |
Definition at line 145 of file Composite.hpp.
|
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.
[in] | weakThis | A weak pointer to this object |
|
inlineprivate |
Definition at line 640 of file Vector.hpp.
|
mutableprivate |
Definition at line 275 of file Vector.hpp.
|
private |
Definition at line 277 of file Vector.hpp.
|
private |
Definition at line 278 of file Vector.hpp.
|
private |
Definition at line 274 of file Vector.hpp.
|
private |
Definition at line 279 of file Vector.hpp.
|
mutableprivate |
Definition at line 276 of file Vector.hpp.