torc::generic::Permutable Class Reference

Permutable is used to describe a relationship in which ports are interchangeable. More...

#include <Permutable.hpp>

Inheritance diagram for torc::generic::Permutable:

Inheritance graph
[legend]
Collaboration diagram for torc::generic::Permutable:

Collaboration graph
[legend]

List of all members.

Public Types

enum  PermutableType { ePermutableParent = 0, ePermutableChild }
typedef VisitorType< PermutableVisitor

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


Detailed Description

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 41 of file Permutable.hpp.


Member Typedef Documentation

Convenience class to visit a permutable.

Definition at line 64 of file Permutable.hpp.


Member Enumeration Documentation

Type of the permutable, Is it parent or child.

Definition at line 55 of file Permutable.hpp.


Member Function Documentation

void torc::generic::Permutable::getPorts ( std::vector< PortSharedPtr > &  outValues  )  const throw () [inline]

Get the list of ports for this permutable.

Parameters:
[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.

Parameters:
[in] inSource Vector of ports
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.

Parameters:
[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.

Parameters:
[in] inPort Pointer to port to be added.
Exceptions:
Error Could not add port, because Port name is empty

Definition at line 93 of file Permutable.cpp.

void torc::generic::Permutable::getChildren ( std::vector< PermutableSharedPtr > &  outPermutables  )  const throw () [inline]

Get the nested permutable.

Parameters:
[out] outPermutables Vector of permutable to be appended to

Definition at line 234 of file Permutable.hpp.

template<typename _Action>
void torc::generic::Permutable::applyOnAllChildren ( const _Action &  action  )  throw (Error) [inline]

Apply action on all children.

Parameters:
[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.

Parameters:
[in] inSource Vector containing permutables
Set the nested permutable.

Parameters:
[in] inSource Vector containing permutables
Exceptions:
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.

Parameters:
[in] inPermutable Nested permutable/nonpermutable
Add a nested permutable/nonpermutable to this permutable.

Parameters:
[in] inPermutable Nested permutable/nonpermutable
Exceptions:
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.

Returns:
Boolean flag
Get the boolean flag whether the current object is permutable/nonpermutable.
Returns:
Boolean flag

Definition at line 268 of file Permutable.hpp.

const Permutable::PermutableType torc::generic::Permutable::getPermutableType (  )  const throw () [inline]

Get the permutable type.

Returns:
PermutableType
Get the permutable type.

Returns:
PermutableType

Definition at line 278 of file Permutable.hpp.

void torc::generic::Permutable::setPermutableType ( const PermutableType inSource  )  throw ()

Set the permutable type.

Parameters:
[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

Returns:
Number of bits

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.

Parameters:
[in,out] visitor A reference to the visitor object
Exceptions:
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.


The documentation for this class was generated from the following files:

Generated on Thu Oct 13 16:50:16 2011 for TORC by  doxygen 1.5.6