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

Module input or output port. More...

#include <Port.hpp>

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

Public Member Functions

const InstanceWeakPtrgetInstancePtr (void) const
 Returns a weak instance pointer. More...
 
const PinNamegetPinName (void) const
 Returns the pin name. More...
 
bool operator== (const Port &rhs) const
 Equality operator. More...
 
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
 Imported type name. More...
 
typedef boost::weak_ptr< class
Module
WeakPtrType
 Weak pointer of our own type. More...
 
typedef boost::shared_ptr
< class Module
SharedPtrType
 Shared pointer of our own type. More...
 

Protected Member Functions

 Port (const string &inName, InstanceSharedPtr inInstancePtr, const string &inPinName)
 Protected constructor. More...
 

Protected Attributes

InstanceWeakPtr mInstancePtr
 The port instance pointer. More...
 
PinName mPinName
 The port pin name. More...
 
string mName
 The name of the object. More...
 
WeakPtrType mParentWeakPtr
 Weak pointer to the parent. More...
 

Friends

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

Detailed Description

Module input or output port.

This class declares a named port for the enclosing module.

Definition at line 37 of file physical/Port.hpp.

Member Typedef Documentation

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

Shared pointer of our own type.

Definition at line 35 of file Progeny.hpp.

typedef std::string torc::physical::Port::string
protected

Imported type name.

Definition at line 44 of file physical/Port.hpp.

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

Weak pointer of our own type.

Definition at line 33 of file Progeny.hpp.

Constructor & Destructor Documentation

torc::physical::Port::Port ( const string inName,
InstanceSharedPtr  inInstancePtr,
const string inPinName 
)
inlineprotected

Protected constructor.

Parameters
inNameThe port name.
inInstancePtrThe port instance pointer.
inPinNameThe port pin name.

Definition at line 55 of file physical/Port.hpp.

56  : Named(inName), mInstancePtr(inInstancePtr), mPinName(inPinName) {}
Named(const string &inName)
Constructor which must specify the object name.
Definition: Named.hpp:48
InstanceWeakPtr mInstancePtr
The port instance pointer.
PinName mPinName
The port pin name.

Member Function Documentation

const InstanceWeakPtr& torc::physical::Port::getInstancePtr ( void  ) const
inline

Returns a weak instance pointer.

Definition at line 60 of file physical/Port.hpp.

60 { return mInstancePtr; }
InstanceWeakPtr mInstancePtr
The port instance pointer.

+ Here is the caller 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 Module >::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 Module >::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
const PinName& torc::physical::Port::getPinName ( void  ) const
inline

Returns the pin name.

Definition at line 62 of file physical/Port.hpp.

62 { return mPinName; }
PinName mPinName
The port pin name.

+ Here is the caller graph for this function:

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::Port::operator== ( const Port rhs) const
inline

Equality operator.

This function deems ports equal if their names are identical.

Returns
true if both port names are identical, or false otherwise.

Definition at line 67 of file physical/Port.hpp.

67 { return mName == rhs.mName; }
string mName
The name of the object.
Definition: Named.hpp:43
void torc::physical::Progeny< class Module >::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 Module >::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

Friends And Related Function Documentation

friend class Factory
friend

The Factory class has direct access to our internals.

Definition at line 40 of file physical/Port.hpp.

Field Documentation

InstanceWeakPtr torc::physical::Port::mInstancePtr
protected

The port instance pointer.

Definition at line 47 of file physical/Port.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 Module >::mParentWeakPtr
protectedinherited

Weak pointer to the parent.

Definition at line 38 of file Progeny.hpp.

PinName torc::physical::Port::mPinName
protected

The port pin name.

Definition at line 49 of file physical/Port.hpp.


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