torc-master
|
Permutable is used to describe a relationship in which ports are interchangeable. More...
#include <Permutable.hpp>
Data Structures | |
class | Factory |
Public Types | |
enum | PermutableType { ePermutableParent = 0, ePermutableChild } |
typedef VisitorType< Permutable > | Visitor |
typedef Permutable | Type |
typedef boost::shared_ptr< Type > | Pointer |
typedef boost::weak_ptr< Type > | WeakPointer |
Public Member Functions | |
void | getPorts (std::vector< PortSharedPtr > &outPorts) const |
void | setPorts (const std::vector< PortSharedPtr > &inSource) throw (Error) |
void | addPort (const PortSharedPtr &inPort) throw (Error) |
void | getChildren (std::vector< PermutableSharedPtr > &outPermutables) const |
template<typename _Action > | |
void | applyOnAllChildren (const _Action &action) throw (Error) |
void | setChildren (const std::vector< PermutableSharedPtr > &inSource) throw (Error) |
bool | addChildPermutable (const PermutableSharedPtr &inPermutable) throw (Error) |
const bool | getIsNonPermutable () const |
void | setIsNonPermutable (const bool &value) |
const PermutableType | getPermutableType () const |
void | setPermutableType (const PermutableType &inSource) |
size_t | getSize () const |
virtual | ~Permutable () throw () |
virtual void | accept (BaseVisitor &visitor) throw (Error) |
void | setWeakThis (const WeakPointer &inWeakThis) |
Pointer | getSharedThis () const |
Protected Member Functions | |
Permutable () | |
Private Attributes | |
std::vector< PortSharedPtr > | mPorts |
std::vector< PermutableSharedPtr > | mChildren |
bool | mIsNonPermutable |
PermutableType | mPermutableType |
Friends | |
class | FactoryType< Permutable > |
Permutable is used to describe a relationship in which ports are interchangeable.
It may reference individual ports, arrayed ports, bundled ports, permutable and nonpermutable statements.
Definition at line 40 of file Permutable.hpp.
|
inherited |
Definition at line 36 of file SelfReferencing.hpp.
|
inherited |
Definition at line 35 of file SelfReferencing.hpp.
Convenience class to visit a permutable.
Definition at line 58 of file Permutable.hpp.
|
inherited |
Definition at line 37 of file SelfReferencing.hpp.
Type of the permutable, Is it parent or child.
Enumerator | |
---|---|
ePermutableParent | |
ePermutableChild |
Definition at line 51 of file Permutable.hpp.
|
virtual |
Definition at line 200 of file Permutable.cpp.
|
protected |
Definition at line 197 of file Permutable.cpp.
|
virtual |
Receive a visitor to this class. The visit method of the visitor is called and a reference to this object is passed as a parameter. It has to be noted however, that a dynamic_cast is performed inside this method. If the cast fails, an appropriate exception is thrown by this method. This situation can arise when the passed Visitor object does not inherit from the appropriate visitor specialization. See Visitor documentation for more details.
[in,out] | visitor | A reference to the visitor object |
Error | Visitor type inappropriate for visiting this object or any other error thrown by the Visitor::throw() method. |
Implements torc::generic::Visitable.
Definition at line 132 of file Permutable.cpp.
bool torc::generic::Permutable::addChildPermutable | ( | const PermutableSharedPtr & | inPermutable | ) | |
throw | ( | Error | |||
) |
Add a nested permutable/nonpermutable to parent permutable.
[in] | inPermutable | Nested permutable/nonpermutable |
Add a nested permutable/nonpermutable to this permutable.
[in] | inPermutable | Nested permutable/nonpermutable |
Error | Could not add permutable because pointer to the permutable does not exist |
Definition at line 114 of file Permutable.cpp.
void torc::generic::Permutable::addPort | ( | const PortSharedPtr & | inPort | ) | |
throw | ( | Error | |||
) |
Add a port to the list of ports. Empty pointer is ignored.
[in] | inPort | Pointer to port to be added. |
Definition at line 76 of file Permutable.cpp.
|
inline |
Apply action on all children.
[in] | action | Action to be applied |
Definition at line 212 of file Permutable.hpp.
|
inline |
Get the nested permutable.
[out] | outPermutables | Vector of permutable to be appended to |
Definition at line 203 of file Permutable.hpp.
|
inline |
Get the boolean flag whether the current object is permutable/nonpermutable.
Definition at line 229 of file Permutable.hpp.
|
inline |
Get the permutable type.
Definition at line 238 of file Permutable.hpp.
|
inline |
Get the list of ports for this permutable.
[out] | outPorts | Vector of ports to be appended to |
Definition at line 194 of file Permutable.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 |
size_t torc::generic::Permutable::getSize | ( | void | ) | const |
Get the total number of bits of the composition
Definition at line 145 of file Permutable.cpp.
void torc::generic::Permutable::setChildren | ( | const std::vector< PermutableSharedPtr > & | inSource | ) | |
throw | ( | Error | |||
) |
Set the nested permutable.
[in] | inSource | Vector containing permutables |
Set the nested permutable.
[in] | inSource | Vector containing permutables |
Error | Could not add permutable because pointer to the permutable does not exist |
Definition at line 95 of file Permutable.cpp.
void torc::generic::Permutable::setIsNonPermutable | ( | const bool & | value | ) |
Definition at line 128 of file Permutable.cpp.
void torc::generic::Permutable::setPermutableType | ( | const PermutableType & | inSource | ) |
Set the permutable type.
[in] | inSource | PermutableType |
Definition at line 193 of file Permutable.cpp.
void torc::generic::Permutable::setPorts | ( | const std::vector< PortSharedPtr > & | inSource | ) | |
throw | ( | Error | |||
) |
Set the list of ports to this permutable. It will lead to a linear traversal on the list. So usage of this API is not recommended.
[in] | inSource | Vector of ports |
Definition at line 56 of file Permutable.cpp.
|
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 |
|
friend |
Definition at line 42 of file Permutable.hpp.
|
private |
Definition at line 183 of file Permutable.hpp.
|
private |
Definition at line 184 of file Permutable.hpp.
|
private |
Definition at line 185 of file Permutable.hpp.
|
private |
Definition at line 182 of file Permutable.hpp.