torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::physical::Element Class Reference

Element composed of connections and pins. More...

#include <Element.hpp>

+ Inheritance diagram for torc::physical::Element:
+ Collaboration diagram for torc::physical::Element:

Public Types

typedef
ConnectionSharedPtrVector::const_iterator 
ConnectionSharedPtrConstIterator
 
typedef
ConnectionSharedPtrVector::iterator 
ConnectionSharedPtrIterator
 
typedef
ConfigVector::const_iterator 
ConfigConstIterator
 
typedef ConfigVector::iterator ConfigIterator
 
typedef
PrimitivePinSharedPtrVector::const_iterator 
PrimitivePinSharedPtrConstIterator
 
typedef
PrimitivePinSharedPtrVector::iterator 
PrimitivePinSharedPtrIterator
 

Public Member Functions

bool addConnection (ConnectionSharedPtr &inConnectionPtr)
 
bool removeConnection (ConnectionSharedPtr &inConnectionPtr)
 
bool removeConnection (ConnectionSharedPtrIterator inConnectionIter)
 
ConnectionSharedPtrConstIterator connectionsBegin (void) const
 
ConnectionSharedPtrConstIterator connectionsEnd (void) const
 
ConnectionSharedPtrIterator connectionsBegin (void)
 
ConnectionSharedPtrIterator connectionsEnd (void)
 
size_t getConnectionCount (void) const
 
bool addConfig (string &inConfigPtr)
 
bool removeConfig (string &inConfigPtr)
 
ConfigConstIterator confsBegin (void) const
 
ConfigConstIterator confsEnd (void) const
 
ConfigIterator confsBegin (void)
 
ConfigIterator confsEnd (void)
 
size_t getConfigCount (void) const
 
size_t getPrimitivePinCount (void) const
 
PrimitivePinSharedPtrConstIterator PrimitivePinsBegin (void) const
 
PrimitivePinSharedPtrIterator PrimitivePinsBegin (void)
 
PrimitivePinSharedPtrConstIterator PrimitivePinsEnd (void) const
 
PrimitivePinSharedPtrIterator PrimitivePinsEnd (void)
 
bool addPrimitivePin (PrimitivePinSharedPtr &inPrimitivePinPtr)
 
bool removePrimitivePin (PrimitivePinSharedPtr &inPrimitivePinPtr)
 
PrimitivePinSharedPtrIterator findPrimitivePin (const string &inName)
 
bool operator== (const Component &rhs) const
 
bool operator== (const Named &rhs) const
 Equality operator. More...
 
const stringgetName (void) const
 Returns the object name. More...
 
const WeakPtrTypegetParentWeakPtr (void) const
 Returns a weak pointer to the parent. More...
 
void setParentWeakPtr (WeakPtrType inParentPtr)
 Sets the weak pointer to the parent. More...
 
void resetParentWeakPtr (void)
 Method to reset and orphan this object. More...
 
const SharedPtrTypegetParentSharedPtr (void) const
 Returns a shared pointer to the parent (WARNING: Does not work right). More...
 

Protected Types

typedef std::string string
 
typedef boost::weak_ptr< class
Component
WeakPtrType
 Weak pointer of our own type. More...
 
typedef boost::weak_ptr< class
Component
WeakPtrType
 Weak pointer of our own type. More...
 
typedef boost::shared_ptr
< class Component
SharedPtrType
 Shared pointer of our own type. More...
 
typedef boost::shared_ptr
< class Component
SharedPtrType
 Shared pointer of our own type. More...
 

Protected Member Functions

 Element (const string &inName)
 Constructor. More...
 
void setSelfWeakPtr (WeakPtrType inSelfPtr)
 Sets the weak pointer to this object. More...
 
const WeakPtrTypegetSelfWeakPtr (void) const
 Returns a weak pointer to this object. More...
 

Protected Attributes

ConnectionSharedPtrVector mConnections
 
ConfigVector mConfigs
 
PrimitivePinSharedPtrVector mPrimitivePins
 
string mName
 The name of the object. More...
 
WeakPtrType mParentWeakPtr
 Weak pointer to the parent. More...
 
WeakPtrType mSelfWeakPtr
 Weak pointer this object. More...
 

Friends

class RcFactory
 The Factory class has direct access to our internals. More...
 

Detailed Description

Element composed of connections and pins.

This class implements everything for XDLRC elements.

Definition at line 41 of file Element.hpp.

Member Typedef Documentation

typedef ConfigVector::const_iterator torc::physical::Element::ConfigConstIterator

Definition at line 57 of file Element.hpp.

typedef ConfigVector::iterator torc::physical::Element::ConfigIterator

Definition at line 58 of file Element.hpp.

typedef ConnectionSharedPtrVector::const_iterator torc::physical::Element::ConnectionSharedPtrConstIterator

Definition at line 54 of file Element.hpp.

typedef ConnectionSharedPtrVector::iterator torc::physical::Element::ConnectionSharedPtrIterator

Definition at line 55 of file Element.hpp.

typedef PrimitivePinSharedPtrVector::const_iterator torc::physical::Component::PrimitivePinSharedPtrConstIterator
inherited

Definition at line 39 of file Component.hpp.

typedef PrimitivePinSharedPtrVector::iterator torc::physical::Component::PrimitivePinSharedPtrIterator
inherited

Definition at line 40 of file Component.hpp.

typedef boost::shared_ptr<class Component > torc::physical::Progeny< class Component >::SharedPtrType
protectedinherited

Shared pointer of our own type.

Definition at line 35 of file Progeny.hpp.

typedef boost::shared_ptr<class Component > torc::physical::Progenitor< class Component >::SharedPtrType
protectedinherited

Shared pointer of our own type.

Definition at line 52 of file Progenitor.hpp.

typedef std::string torc::physical::Component::string
protectedinherited

Definition at line 33 of file Component.hpp.

typedef boost::weak_ptr<class Component > torc::physical::Progeny< class Component >::WeakPtrType
protectedinherited

Weak pointer of our own type.

Definition at line 33 of file Progeny.hpp.

typedef boost::weak_ptr<class Component > torc::physical::Progenitor< class Component >::WeakPtrType
protectedinherited

Weak pointer of our own type.

Definition at line 50 of file Progenitor.hpp.

Constructor & Destructor Documentation

torc::physical::Element::Element ( const string inName)
inlineprotected

Constructor.

Definition at line 51 of file Element.hpp.

51 : Component(inName){}
Component(const string &inName)
Protected constructor.
Definition: Component.hpp:37

Member Function Documentation

bool torc::physical::Element::addConfig ( string inConfigPtr)
inline
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 92 of file Element.hpp.

92  {
93  /// \todo Acquire mutex.
94  ConfigIterator e = mConfigs.end();
95  ConfigIterator result = std::find(mConfigs.begin(), e, inConfigPtr);
96  if(result != e) return false;
97  mConfigs.push_back(inConfigPtr);
98  return true;
99  /// \todo Release mutex.
100  }
ConfigVector::iterator ConfigIterator
Definition: Element.hpp:58
ConfigVector mConfigs
Definition: Element.hpp:48
bool torc::physical::Element::addConnection ( ConnectionSharedPtr inConnectionPtr)
inline
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 61 of file Element.hpp.

61  {
62  /// \todo Acquire mutex.
63  mConnections.push_back(inConnectionPtr);
64  return true;
65  /// \todo Release mutex.
66  }
ConnectionSharedPtrVector mConnections
Definition: Element.hpp:47
bool torc::physical::Component::addPrimitivePin ( PrimitivePinSharedPtr inPrimitivePinPtr)
inlineinherited
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 48 of file Component.hpp.

48  {
49  /// \todo Acquire mutex.
51  PrimitivePinSharedPtrIterator result = std::find(PrimitivePinsEnd(), e, inPrimitivePinPtr);
52  if(result != e) return false;
53  mPrimitivePins.push_back(inPrimitivePinPtr);
54  return true;
55  /// \todo Release mutex.
56  }
PrimitivePinSharedPtrVector::iterator PrimitivePinSharedPtrIterator
Definition: Component.hpp:40
PrimitivePinSharedPtrVector mPrimitivePins
Definition: Component.hpp:34
PrimitivePinSharedPtrConstIterator PrimitivePinsEnd(void) const
Definition: Component.hpp:44

+ Here is the call graph for this function:

ConfigConstIterator torc::physical::Element::confsBegin ( void  ) const
inline

Definition at line 111 of file Element.hpp.

111 { return mConfigs.begin(); }
ConfigVector mConfigs
Definition: Element.hpp:48
ConfigIterator torc::physical::Element::confsBegin ( void  )
inline

Definition at line 113 of file Element.hpp.

113 { return mConfigs.begin(); }
ConfigVector mConfigs
Definition: Element.hpp:48
ConfigConstIterator torc::physical::Element::confsEnd ( void  ) const
inline

Definition at line 112 of file Element.hpp.

112 { return mConfigs.end(); }
ConfigVector mConfigs
Definition: Element.hpp:48
ConfigIterator torc::physical::Element::confsEnd ( void  )
inline

Definition at line 114 of file Element.hpp.

114 { return mConfigs.end(); }
ConfigVector mConfigs
Definition: Element.hpp:48
ConnectionSharedPtrConstIterator torc::physical::Element::connectionsBegin ( void  ) const
inline

Definition at line 86 of file Element.hpp.

86 { return mConnections.begin(); }
ConnectionSharedPtrVector mConnections
Definition: Element.hpp:47
ConnectionSharedPtrIterator torc::physical::Element::connectionsBegin ( void  )
inline

Definition at line 88 of file Element.hpp.

88 { return mConnections.begin(); }
ConnectionSharedPtrVector mConnections
Definition: Element.hpp:47
ConnectionSharedPtrConstIterator torc::physical::Element::connectionsEnd ( void  ) const
inline

Definition at line 87 of file Element.hpp.

87 { return mConnections.end(); }
ConnectionSharedPtrVector mConnections
Definition: Element.hpp:47
ConnectionSharedPtrIterator torc::physical::Element::connectionsEnd ( void  )
inline

Definition at line 89 of file Element.hpp.

89 { return mConnections.end(); }
ConnectionSharedPtrVector mConnections
Definition: Element.hpp:47
PrimitivePinSharedPtrIterator torc::physical::Component::findPrimitivePin ( const string inName)
inlineinherited

Definition at line 66 of file Component.hpp.

66  {
67  NameComparator predicate(inName);
68  return std::find_if(PrimitivePinsBegin(), PrimitivePinsEnd(), predicate);
69  }
PrimitivePinSharedPtrConstIterator PrimitivePinsEnd(void) const
Definition: Component.hpp:44
PrimitivePinSharedPtrConstIterator PrimitivePinsBegin(void) const
Definition: Component.hpp:43

+ Here is the call graph for this function:

size_t torc::physical::Element::getConfigCount ( void  ) const
inline

Definition at line 115 of file Element.hpp.

115 { return mConfigs.size(); }
ConfigVector mConfigs
Definition: Element.hpp:48
size_t torc::physical::Element::getConnectionCount ( void  ) const
inline

Definition at line 90 of file Element.hpp.

90 { return mConnections.size(); }
ConnectionSharedPtrVector mConnections
Definition: Element.hpp:47
const string& torc::physical::Named::getName ( void  ) const
inlineinherited

Returns the object name.

Definition at line 51 of file Named.hpp.

51 { return mName; }
string mName
The name of the object.
Definition: Named.hpp:43

+ Here is the caller graph for this function:

const SharedPtrType& torc::physical::Progeny< class Component >::getParentSharedPtr ( void  ) const
inlineinherited

Returns a shared pointer to the parent (WARNING: Does not work right).

Always seems to generate a "Returning reference to temporary" warning, and I cannot figure out why.

It is the caller's responsibility to reset the shared pointer when done.

Todo:
Figure out why Progeny<T>::getParentSharedPtr() yields a "Returning reference to temporary" warning.

Definition at line 59 of file Progeny.hpp.

59 { return mParentWeakPtr.lock(); }
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
const WeakPtrType& torc::physical::Progeny< class Component >::getParentWeakPtr ( void  ) const
inlineinherited

Returns a weak pointer to the parent.

Definition at line 47 of file Progeny.hpp.

47 { return mParentWeakPtr; }
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
size_t torc::physical::Component::getPrimitivePinCount ( void  ) const
inlineinherited

Definition at line 42 of file Component.hpp.

42 { return mPrimitivePins.size(); }
PrimitivePinSharedPtrVector mPrimitivePins
Definition: Component.hpp:34
const WeakPtrType& torc::physical::Progenitor< class Component >::getSelfWeakPtr ( void  ) const
inlineinherited

Returns a weak pointer to this object.

Definition at line 68 of file Progenitor.hpp.

68 { return mSelfWeakPtr; }
WeakPtrType mSelfWeakPtr
Weak pointer this object.
Definition: Progenitor.hpp:57
bool torc::physical::Named::operator== ( const Named rhs) const
inlineinherited

Equality operator.

Definition at line 54 of file Named.hpp.

54 { return mName == rhs.mName; }
string mName
The name of the object.
Definition: Named.hpp:43
bool torc::physical::Component::operator== ( const Component rhs) const
inlineinherited

Definition at line 71 of file Component.hpp.

71 { return mName == rhs.mName; }
string mName
The name of the object.
Definition: Named.hpp:43
PrimitivePinSharedPtrConstIterator torc::physical::Component::PrimitivePinsBegin ( void  ) const
inlineinherited

Definition at line 43 of file Component.hpp.

43 { return mPrimitivePins.begin(); }
PrimitivePinSharedPtrVector mPrimitivePins
Definition: Component.hpp:34

+ Here is the caller graph for this function:

PrimitivePinSharedPtrIterator torc::physical::Component::PrimitivePinsBegin ( void  )
inlineinherited

Definition at line 45 of file Component.hpp.

45 { return mPrimitivePins.begin(); }
PrimitivePinSharedPtrVector mPrimitivePins
Definition: Component.hpp:34
PrimitivePinSharedPtrConstIterator torc::physical::Component::PrimitivePinsEnd ( void  ) const
inlineinherited

Definition at line 44 of file Component.hpp.

44 { return mPrimitivePins.end(); }
PrimitivePinSharedPtrVector mPrimitivePins
Definition: Component.hpp:34

+ Here is the caller graph for this function:

PrimitivePinSharedPtrIterator torc::physical::Component::PrimitivePinsEnd ( void  )
inlineinherited

Definition at line 46 of file Component.hpp.

46 { return mPrimitivePins.end(); }
PrimitivePinSharedPtrVector mPrimitivePins
Definition: Component.hpp:34
bool torc::physical::Element::removeConfig ( string inConfigPtr)
inline
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 101 of file Element.hpp.

101  {
102  /// \todo Acquire mutex.
103  ConfigIterator e = mConfigs.end();
104  ConfigIterator result = std::find(mConfigs.begin(), e, inConfigPtr);
105  if(result == e) return false;
106  mConfigs.erase(result);
107  /// \todo Release mutex.
108  return true;
109  }
ConfigVector::iterator ConfigIterator
Definition: Element.hpp:58
ConfigVector mConfigs
Definition: Element.hpp:48
bool torc::physical::Element::removeConnection ( ConnectionSharedPtr inConnectionPtr)
inline
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 67 of file Element.hpp.

67  {
68  /// \todo Acquire mutex.
70  ConnectionSharedPtrIterator result = std::find(connectionsBegin(), e, inConnectionPtr);
71  if(result == e) return false;
72  mConnections.erase(result);
73  /// \todo Release mutex.
74  return true;
75  }
ConnectionSharedPtrVector mConnections
Definition: Element.hpp:47
ConnectionSharedPtrConstIterator connectionsEnd(void) const
Definition: Element.hpp:87
ConnectionSharedPtrVector::iterator ConnectionSharedPtrIterator
Definition: Element.hpp:55
ConnectionSharedPtrConstIterator connectionsBegin(void) const
Definition: Element.hpp:86
bool torc::physical::Element::removeConnection ( ConnectionSharedPtrIterator  inConnectionIter)
inline
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 77 of file Element.hpp.

77  {
78  /// \todo Acquire mutex.
79 
80  mConnections.erase(inConnectionIter);
81  /// \todo Release mutex.
82  return true;
83  }
ConnectionSharedPtrVector mConnections
Definition: Element.hpp:47
bool torc::physical::Component::removePrimitivePin ( PrimitivePinSharedPtr inPrimitivePinPtr)
inlineinherited
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 57 of file Component.hpp.

57  {
58  /// \todo Acquire mutex.
60  PrimitivePinSharedPtrIterator result = std::find(PrimitivePinsBegin(), e, inPrimitivePinPtr);
61  if(result == e) return false;
62  mPrimitivePins.erase(result);
63  /// \todo Release mutex.
64  return true;
65  }
PrimitivePinSharedPtrVector::iterator PrimitivePinSharedPtrIterator
Definition: Component.hpp:40
PrimitivePinSharedPtrVector mPrimitivePins
Definition: Component.hpp:34
PrimitivePinSharedPtrConstIterator PrimitivePinsEnd(void) const
Definition: Component.hpp:44
PrimitivePinSharedPtrConstIterator PrimitivePinsBegin(void) const
Definition: Component.hpp:43

+ Here is the call graph for this function:

void torc::physical::Progeny< class Component >::resetParentWeakPtr ( void  )
inlineinherited

Method to reset and orphan this object.

Definition at line 51 of file Progeny.hpp.

51 { mParentWeakPtr.reset(); }
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
void torc::physical::Progeny< class Component >::setParentWeakPtr ( WeakPtrType  inParentPtr)
inlineinherited

Sets the weak pointer to the parent.

Definition at line 49 of file Progeny.hpp.

49 { mParentWeakPtr = inParentPtr; }
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
void torc::physical::Progenitor< class Component >::setSelfWeakPtr ( WeakPtrType  inSelfPtr)
inlineprotectedinherited

Sets the weak pointer to this object.

Definition at line 59 of file Progenitor.hpp.

59 { mSelfWeakPtr = inSelfPtr; }
WeakPtrType mSelfWeakPtr
Weak pointer this object.
Definition: Progenitor.hpp:57

Friends And Related Function Documentation

friend class RcFactory
friend

The Factory class has direct access to our internals.

Definition at line 44 of file Element.hpp.

Field Documentation

ConfigVector torc::physical::Element::mConfigs
protected

Definition at line 48 of file Element.hpp.

ConnectionSharedPtrVector torc::physical::Element::mConnections
protected

Definition at line 47 of file Element.hpp.

string torc::physical::Named::mName
protectedinherited

The name of the object.

Definition at line 43 of file Named.hpp.

WeakPtrType torc::physical::Progeny< class Component >::mParentWeakPtr
protectedinherited

Weak pointer to the parent.

Definition at line 38 of file Progeny.hpp.

PrimitivePinSharedPtrVector torc::physical::Component::mPrimitivePins
protectedinherited

Definition at line 34 of file Component.hpp.

WeakPtrType torc::physical::Progenitor< class Component >::mSelfWeakPtr
protectedinherited

Weak pointer this object.

This weak pointer is kept here to be passed along to our children, allowing them to point back to us without the strong dependency of a shared pointer.

Definition at line 57 of file Progenitor.hpp.


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