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

Hierarchical componenet. More...

#include <Component.hpp>

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

Public Types

typedef
PrimitivePinSharedPtrVector::const_iterator 
PrimitivePinSharedPtrConstIterator
 
typedef
PrimitivePinSharedPtrVector::iterator 
PrimitivePinSharedPtrIterator
 

Public Member Functions

size_t getPrimitivePinCount (void) const
 
PrimitivePinSharedPtrConstIterator PrimitivePinsBegin (void) const
 
PrimitivePinSharedPtrConstIterator PrimitivePinsEnd (void) const
 
PrimitivePinSharedPtrIterator PrimitivePinsBegin (void)
 
PrimitivePinSharedPtrIterator PrimitivePinsEnd (void)
 
bool addPrimitivePin (PrimitivePinSharedPtr &inPrimitivePinPtr)
 
bool removePrimitivePin (PrimitivePinSharedPtr &inPrimitivePinPtr)
 
PrimitivePinSharedPtrIterator findPrimitivePin (const string &inName)
 
bool operator== (const Component &rhs) const
 
const stringgetName (void) const
 Returns the object name. More...
 
bool operator== (const Named &rhs) const
 Equality operator. 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::shared_ptr
< class Component
SharedPtrType
 Shared 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...
 

Protected Member Functions

 Component (const string &inName)
 Protected 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

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...
 

Detailed Description

Hierarchical componenet.

Definition at line 30 of file Component.hpp.

Member Typedef Documentation

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

Definition at line 39 of file Component.hpp.

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

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
protected

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::Component::Component ( const string inName)
inlineprotected

Protected constructor.

Definition at line 37 of file Component.hpp.

37 : Named(inName), Progenitor<class Component>(){}
Named(const string &inName)
Constructor which must specify the object name.
Definition: Named.hpp:48

Member Function Documentation

bool torc::physical::Component::addPrimitivePin ( PrimitivePinSharedPtr inPrimitivePinPtr)
inline
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:

PrimitivePinSharedPtrIterator torc::physical::Component::findPrimitivePin ( const string inName)
inline

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:

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
inline

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
inline

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
inline

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  )
inline

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
inline

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  )
inline

Definition at line 46 of file Component.hpp.

46 { return mPrimitivePins.end(); }
PrimitivePinSharedPtrVector mPrimitivePins
Definition: Component.hpp:34
bool torc::physical::Component::removePrimitivePin ( PrimitivePinSharedPtr inPrimitivePinPtr)
inline
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

Field Documentation

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
protected

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: