torc-master
|
Interface for objects that can be composed within each other. More...
#include <Composite.hpp>
Public Types | |
typedef _Type | Type |
typedef boost::shared_ptr< Type > | Pointer |
typedef boost::weak_ptr< Type > | WeakPointer |
typedef std::vector< Pointer > | List |
typedef size_t | SizeType |
Public Member Functions | |
Composite () | |
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 |
Protected Member Functions | |
virtual | ~Composite () throw () |
Private Member Functions | |
Composite (const Composite< _Type > &rhs) | |
Composite< _Type > & | operator= (const Composite< _Type > &rhs) |
Private Attributes | |
WeakPointer | mParentCollection |
Interface for objects that can be composed within each other.
The Composite class defines an interface for objects that can occur singly (Scalar), as Arrays (Vector) or bundles (Bundle). This class defines polymorphic methods that will be overridden by subsequent implementations.
Definition at line 45 of file Composite.hpp.
typedef std::vector<Pointer> torc::generic::Composite< _Type >::List |
List of Shared Pointers to objects of type Type
Definition at line 61 of file Composite.hpp.
typedef boost::shared_ptr<Type> torc::generic::Composite< _Type >::Pointer |
Shared Pointer to object of type Type
Definition at line 55 of file Composite.hpp.
typedef size_t torc::generic::Composite< _Type >::SizeType |
Definition at line 62 of file Composite.hpp.
typedef _Type torc::generic::Composite< _Type >::Type |
Definition at line 50 of file Composite.hpp.
typedef boost::weak_ptr<Type> torc::generic::Composite< _Type >::WeakPointer |
Definition at line 56 of file Composite.hpp.
|
inlineprotectedvirtual |
Definition at line 65 of file Composite.hpp.
torc::generic::Composite< _Type >::Composite | ( | ) |
Definition at line 137 of file Composite.hpp.
|
private |
|
pure 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 |
Implemented in torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >, torc::generic::Vector< Instance, InstanceArrayMember, InstanceArrayMember::Factory, false >, torc::generic::Vector< Port, VectorPortBit, VectorPortBit::Factory, true >, torc::generic::Vector< Net, VectorNetBit, VectorNetBit::Factory, true >, torc::generic::Vector< Parameter, ParameterArrayElement, ParameterArrayElement::Factory, false >, torc::generic::Vector< PortReference, VectorPortBitReference, VectorPortBitReference::Factory, true >, torc::generic::Bundle< _Type >, torc::generic::Bundle< Port >, torc::generic::Bundle< Net >, torc::generic::Bundle< PortReference >, torc::generic::Bundle< _BaseType >, torc::generic::VectorBit< _Type >, torc::generic::VectorBit< Port >, torc::generic::VectorBit< Net >, torc::generic::VectorBit< PortReference >, torc::generic::VectorBit< Instance >, torc::generic::VectorBit< Parameter >, torc::generic::Scalar< _Type >, torc::generic::Scalar< Port >, torc::generic::Scalar< Net >, torc::generic::Scalar< PortReference >, torc::generic::Scalar< Parameter >, and torc::generic::Scalar< Instance >.
|
pure virtual |
Get children of this composition.
[out] | outChildren | A list of all children for this composition |
Implemented in torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >, torc::generic::Vector< Instance, InstanceArrayMember, InstanceArrayMember::Factory, false >, torc::generic::Vector< Port, VectorPortBit, VectorPortBit::Factory, true >, torc::generic::Vector< Net, VectorNetBit, VectorNetBit::Factory, true >, torc::generic::Vector< Parameter, ParameterArrayElement, ParameterArrayElement::Factory, false >, torc::generic::Vector< PortReference, VectorPortBitReference, VectorPortBitReference::Factory, true >, torc::generic::Bundle< _Type >, torc::generic::Bundle< PortReference >, torc::generic::Scalar< _Type >, torc::generic::Scalar< Port >, torc::generic::Scalar< Net >, torc::generic::Scalar< PortReference >, torc::generic::Scalar< Parameter >, torc::generic::Scalar< Instance >, torc::generic::VectorBit< _Type >, torc::generic::VectorBit< Port >, torc::generic::VectorBit< Net >, torc::generic::VectorBit< PortReference >, torc::generic::VectorBit< Instance >, and torc::generic::VectorBit< Parameter >.
|
pure virtual |
Get the type of this composition.
Implemented in torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >, torc::generic::Vector< Instance, InstanceArrayMember, InstanceArrayMember::Factory, false >, torc::generic::Vector< Port, VectorPortBit, VectorPortBit::Factory, true >, torc::generic::Vector< Net, VectorNetBit, VectorNetBit::Factory, true >, torc::generic::Vector< Parameter, ParameterArrayElement, ParameterArrayElement::Factory, false >, torc::generic::Vector< PortReference, VectorPortBitReference, VectorPortBitReference::Factory, true >, torc::generic::Bundle< _Type >, torc::generic::Bundle< Port >, torc::generic::Bundle< Net >, torc::generic::Bundle< PortReference >, torc::generic::Bundle< _BaseType >, torc::generic::VectorBit< _Type >, torc::generic::VectorBit< Port >, torc::generic::VectorBit< Net >, torc::generic::VectorBit< PortReference >, torc::generic::VectorBit< Instance >, torc::generic::VectorBit< Parameter >, torc::generic::Scalar< _Type >, torc::generic::Scalar< Port >, torc::generic::Scalar< Net >, torc::generic::Scalar< PortReference >, torc::generic::Scalar< Parameter >, and torc::generic::Scalar< Instance >.
|
inlinevirtual |
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 |
|
pure virtual |
Get the total number of bits of the composition
Implemented in torc::generic::Vector< _Type, _ChildType, _ChildFactoryType, cPreserve >, torc::generic::Vector< Instance, InstanceArrayMember, InstanceArrayMember::Factory, false >, torc::generic::Vector< Port, VectorPortBit, VectorPortBit::Factory, true >, torc::generic::Vector< Net, VectorNetBit, VectorNetBit::Factory, true >, torc::generic::Vector< Parameter, ParameterArrayElement, ParameterArrayElement::Factory, false >, torc::generic::Vector< PortReference, VectorPortBitReference, VectorPortBitReference::Factory, true >, torc::generic::Bundle< _Type >, torc::generic::Bundle< Port >, torc::generic::Bundle< Net >, torc::generic::Bundle< PortReference >, torc::generic::Bundle< _BaseType >, torc::generic::VectorBit< _Type >, torc::generic::VectorBit< Port >, torc::generic::VectorBit< Net >, torc::generic::VectorBit< PortReference >, torc::generic::VectorBit< Instance >, torc::generic::VectorBit< Parameter >, torc::generic::Scalar< _Type >, torc::generic::Scalar< Port >, torc::generic::Scalar< Net >, torc::generic::Scalar< PortReference >, torc::generic::Scalar< Parameter >, and torc::generic::Scalar< Instance >.
|
private |
|
inlinevirtual |
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 |
|
private |
Definition at line 133 of file Composite.hpp.