#include <Permutable.hpp>
Public Types | |
enum | PermutableType { ePermutableParent = 0, ePermutableChild } |
typedef VisitorType< Permutable > | Visitor |
Public Member Functions | |
void | getPorts (std::vector< PortSharedPtr > &outPorts) const throw () |
void | setPorts (const std::vector< PortSharedPtr > &inSource) throw (Error) |
void | addPort (const PortSharedPtr &inPort) throw (Error) |
void | getChildren (std::vector< PermutableSharedPtr > &outPermutables) const throw () |
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 throw () |
void | setIsNonPermutable (const bool &value) throw () |
const PermutableType | getPermutableType () const throw () |
void | setPermutableType (const PermutableType &inSource) throw () |
size_t | getSize () const throw () |
virtual void | accept (BaseVisitor &visitor) throw (Error) |
Private Attributes | |
std::vector< PortSharedPtr > | mPorts |
std::vector< PermutableSharedPtr > | mChildren |
bool | mIsNonPermutable |
PermutableType | mPermutableType |
Friends | |
class | FactoryType< Permutable > |
Classes | |
class | Factory |
It may reference individual ports, arrayed ports, bundled ports, permutable and nonpermutable statements.
Definition at line 41 of file Permutable.hpp.
Convenience class to visit a permutable.
Definition at line 64 of file Permutable.hpp.
Type of the permutable, Is it parent or child.
Definition at line 55 of file Permutable.hpp.
void torc::generic::Permutable::getPorts | ( | std::vector< PortSharedPtr > & | outValues | ) | const throw () [inline] |
Get the list of ports for this permutable.
[out] | outPorts | Vector of ports to be appended to |
Definition at line 222 of file Permutable.hpp.
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 |
[in] | inSource | Vector of ports |
Definition at line 67 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 93 of file Permutable.cpp.
void torc::generic::Permutable::getChildren | ( | std::vector< PermutableSharedPtr > & | outPermutables | ) | const throw () [inline] |
Get the nested permutable.
[out] | outPermutables | Vector of permutable to be appended to |
Definition at line 234 of file Permutable.hpp.
void torc::generic::Permutable::applyOnAllChildren | ( | const _Action & | action | ) | throw (Error) [inline] |
Apply action on all children.
[in] | action | Action to be applied |
Definition at line 247 of file Permutable.hpp.
void torc::generic::Permutable::setChildren | ( | const std::vector< PermutableSharedPtr > & | inSource | ) | throw (Error) |
Set the nested permutable.
[in] | inSource | Vector containing permutables |
[in] | inSource | Vector containing permutables |
Error | Could not add permutable because pointer to the permutable does not exist |
Definition at line 117 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 |
[in] | inPermutable | Nested permutable/nonpermutable |
Error | Could not add permutable because pointer to the permutable does not exist |
Definition at line 143 of file Permutable.cpp.
const bool torc::generic::Permutable::getIsNonPermutable | ( | ) | const throw () [inline] |
Get the boolean flag whether the current object is permutable/nonpermutable.
Definition at line 268 of file Permutable.hpp.
const Permutable::PermutableType torc::generic::Permutable::getPermutableType | ( | ) | const throw () [inline] |
Get the permutable type.
Definition at line 278 of file Permutable.hpp.
void torc::generic::Permutable::setPermutableType | ( | const PermutableType & | inSource | ) | throw () |
Set the permutable type.
[in] | inSource | PermutableType |
Definition at line 250 of file Permutable.cpp.
size_t torc::generic::Permutable::getSize | ( | void | ) | const throw () |
Get the total number of bits of the composition
Definition at line 185 of file Permutable.cpp.
void torc::generic::Permutable::accept | ( | BaseVisitor & | visitor | ) | throw (Error) [virtual] |
Recive 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 sitation 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 167 of file Permutable.cpp.