torc::generic::Connectable Class Reference

An object that is connectable to a Net. More...

#include <Connectable.hpp>

Inheritance diagram for torc::generic::Connectable:

Inheritance graph
[legend]

List of all members.

Public Types

typedef std::list
< NetSharedPtr >::iterator 
Connection
typedef boost::signal< void(const
NetSharedPtr &)> 
Connected
typedef boost::signal< void(const
NetSharedPtr &)> 
Disconnected

Public Member Functions

ConnectedsignalNetConnected () throw ()
DisconnectedsignalNetDisconnected () throw ()
virtual void getConnectedNets (std::vector< NetSharedPtr > &outNets, bool inSkipChildConnections=false) const throw (Error)
virtual Connection connect (const NetSharedPtr &inNet)=0 throw (Error)
virtual void disconnect (const Connection &inConnection)=0 throw (Error)
void disconnect (const std::string &inName) throw (Error)
void disconnect (const NetSharedPtr &net) throw (Error)
virtual void disconnect () throw (Error)

Protected Member Functions

virtual void onConnect () throw (Error)
virtual void onDisconnect () throw (Error)

Private Member Functions

 Connectable (const Connectable &rhs)
Connectableoperator= (const Connectable &rhs)

Private Attributes

std::list< NetSharedPtr > mConnectedNets
Connected mSigNetConnected
Disconnected mSigNetDisconnected


Detailed Description

An object that is connectable to a Net.

The Connectable class can act as a base for objects that can connect to a Net. This interface provides event functionality for connection and disconnection. It also provides polymorphic methods to implement connectivity beween different components in a design.

Definition at line 45 of file Connectable.hpp.


Member Typedef Documentation

typedef std::list< NetSharedPtr >::iterator torc::generic::Connectable::Connection

A connection between a net and this object

Definition at line 55 of file Connectable.hpp.

typedef boost::signal<void (const NetSharedPtr &)> torc::generic::Connectable::Connected

A signal to indicate that a new connection has been made

Definition at line 60 of file Connectable.hpp.

typedef boost::signal<void (const NetSharedPtr &)> torc::generic::Connectable::Disconnected

A signal to indicate that a connection has been removed

Definition at line 65 of file Connectable.hpp.


Member Function Documentation

Connectable::Connected & torc::generic::Connectable::signalNetConnected (  )  throw () [inline]

A signal to indicate that a new connection has been made

Definition at line 177 of file Connectable.hpp.

Connectable::Disconnected & torc::generic::Connectable::signalNetDisconnected (  )  throw () [inline]

A signal to indicate that a new connection has been made

Definition at line 185 of file Connectable.hpp.

void torc::generic::Connectable::getConnectedNets ( std::vector< NetSharedPtr > &  outNets,
bool  inSkipChildConnections = false 
) const throw (Error) [virtual]

Get the vector of Nets that are Connected to the current object. The connected elements are appended to the given vector

Parameters:
[out] outNets A vector of Connected nets
Get the vector of Nets that are Connected to the current object. The connected elements are appended to the given vector

Returns:
A vector of Connected nets

Reimplemented in torc::generic::VectorNet, torc::generic::VectorNetBit, torc::generic::VectorPort, torc::generic::VectorPortBit, torc::generic::VectorPortBitReference, and torc::generic::VectorPortReference.

Definition at line 49 of file Connectable.cpp.

Connectable::Connection torc::generic::Connectable::connect ( const NetSharedPtr &  inNet  )  throw (Error) [pure virtual]

Connect a Net to this object.

Note:
This metod can be overridden by derived classes. However, the method must call the on_connected() method after this. The sigConnected_ signal must also be invoked in the overriding method.
Parameters:
[in] inNet A pointer to the Net object that needs to be Connected
Returns:
A connection that has been established. This can be used later for disconnection.
Connect a Net to this object.

Note:
This metod can be overridden by derived classes. However, the method must call the on_connected() method after this. The sigConnected_ signal must also be invoked in the overriding method.
Parameters:
[in] inNet A pointer to the Net object that eeds to be Connected
Returns:
A connection that has been established. This can be used later for disconnection.

Implemented in torc::generic::NetBundle, torc::generic::PortBundle, torc::generic::PortBundleReference, torc::generic::PortList, torc::generic::ScalarNet, torc::generic::ScalarPort, torc::generic::ScalarPortReference, torc::generic::VectorNet, torc::generic::VectorNetBit, torc::generic::VectorPort, torc::generic::VectorPortBit, torc::generic::VectorPortBitReference, and torc::generic::VectorPortReference.

Definition at line 66 of file Connectable.cpp.

void torc::generic::Connectable::disconnect ( const Connection inConnection  )  throw (Error) [pure virtual]

Disconnect a Net from this object.

Note:
This metod can be overridden by derived classes. However, the method must call the on_connected() method after this. The sigConnected_ signal must also be invoked in the overriding method.
Parameters:
[in] inConnection A connection as returned by the connect() method
Exceptions:
Error Provided connection is invalid

Implemented in torc::generic::PortBundle, torc::generic::VectorNet, torc::generic::VectorPort, and torc::generic::VectorPortReference.

Definition at line 95 of file Connectable.cpp.

void torc::generic::Connectable::disconnect ( const std::string &  inName  )  throw (Error)

Disconnect the named Net from this object.

Note:
This metod can be overridden by derived classes. However, the method must call the on_connected() method after this. The sigConnected_ signal must also be invoked in the overriding method.
Parameters:
[in] inName Name of the net to be Disconnected
Exceptions:
Error Provided net was not found
Disconnect the named Net from this object.
Note:
This metod can be overridden by derived classes. However, the method must call the on_connected() method after this. The sigConnected_ signal must also be invoked in the overriding method.
Parameters:
[in] inNname Name of the net to be Disconnected
Exceptions:
Error Provided net was not found

Definition at line 128 of file Connectable.cpp.

void torc::generic::Connectable::disconnect ( const NetSharedPtr &  inNet  )  throw (Error)

Disconnect the given Net from this object.

Note:
This metod can be overridden by derived classes. However, the method must call the on_disconnected() method after this. The sigDisconnected_ signal must also be invoked in the overriding method.
Parameters:
[in] net Pointer to a net
Exceptions:
Error Provided net was not found
Disconnect the given Net from this object.
Note:
This metod can be overridden by derived classes. However, the method must call the on_disconnected() method after this. The sigDisconnected_ signal must also be invoked in the overriding method.
Parameters:
[in] inNet Pointer to a net
Exceptions:
Error Provided net was not found

Definition at line 144 of file Connectable.cpp.

void torc::generic::Connectable::disconnect (  )  throw (Error) [virtual]

Disconnect all connections to this port.

Reimplemented in torc::generic::Net, torc::generic::NetBundle, and torc::generic::VectorNet.

Definition at line 150 of file Connectable.cpp.

void torc::generic::Connectable::onConnect (  )  throw (Error) [protected, virtual]

A polymorphic function that is called after a net is Connected to this object

Definition at line 165 of file Connectable.cpp.

void torc::generic::Connectable::onDisconnect (  )  throw (Error) [protected, virtual]

A polymorphic function that is called after a net is Disconnected from this object

Definition at line 171 of file Connectable.cpp.


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

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