torc-master
|
Represents an EDIF Net. More...
#include <Net.hpp>
Public Types | |
typedef std::list < NetSharedPtr >::iterator | Connection |
typedef boost::signals2::signal< void(const NetSharedPtr &)> | Connected |
typedef boost::signals2::signal< void(const NetSharedPtr &)> | Disconnected |
typedef std::string | Name |
typedef Net | Type |
typedef boost::shared_ptr< Type > | Pointer |
typedef boost::weak_ptr< Type > | WeakPointer |
typedef std::vector< Pointer > | List |
typedef size_t | SizeType |
Public Member Functions | |
void | addSubnet (const NetSharedPtr &inSubnet) throw (Error) |
NetSharedPtr | findSubnet (const std::string &inName) throw (Error) |
void | removeSubnet (const std::string &inName) throw (Error) |
void | getSubnets (std::vector< NetSharedPtr > &outSubnets) const |
void | setSubnets (const std::vector< NetSharedPtr > &inSource) throw (Error) |
template<typename _Action > | |
void | applyOnAllSubnets (const _Action &action) throw (Error) |
NetSharedPtr | getParentNet () const |
void | setParentNet (const NetSharedPtr &inParent) |
const NetAttributesSharedPtr | getAttributes () const |
void | setAttributes (const NetAttributesSharedPtr &inSource) |
PortSharedPtr | findConnectedPort (const std::string &inName) throw (Error) |
virtual void | getConnectedPorts (std::vector< PortSharedPtr > &outPort, bool inSkipChildConnections=false) const |
template<typename _Action > | |
void | applyOnAllConnectedPorts (const _Action &action) throw (Error) |
virtual void | getConnectedPortLists (std::vector< PortListSharedPtr > &outPortList) const |
template<typename _Action > | |
void | applyOnAllConnectedPortLists (const _Action &action) throw (Error) |
virtual void | disconnect () throw (Error) |
PortReferenceSharedPtr | findConnectedPortReference (const std::string &inName) throw (Error) |
virtual void | getConnectedPortRefs (std::vector< PortReferenceSharedPtr > &outPortRefs, bool inSkipChildConnections=false) const |
template<typename _Action > | |
void | applyOnAllConnectedPortRefs (const _Action &action) throw (Error) |
virtual | ~Net () throw () |
void | addComment (const std::string &comment) |
const std::vector< std::string > & | getComments () const |
void | setComments (const std::vector< std::string > &inSource) |
Connected & | signalNetConnected () |
Disconnected & | signalNetDisconnected () |
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 const std::string | getName () const |
void | setName (const std::string &inSource) throw (Error) |
PropertySharedPtr | getProperty (const std::string &inName) |
bool | setProperty (const std::string &inName, const PropertySharedPtr &inProperty) |
void | getProperties (std::map< std::string, PropertySharedPtr > &outProperties) const |
void | setProperties (const std::map< std::string, PropertySharedPtr > &inSource) |
template<typename _Action > | |
void | applyOnAllProperties (const _Action &action) throw (Error) |
virtual Name | getOriginalName () const |
virtual void | setOriginalName (const Name &inSource) |
virtual void | accept (BaseVisitor &inoutVisitor)=0 throw (Error) |
virtual CompositionType | getCompositionType () const =0 |
virtual size_t | getSize () const =0 |
virtual void | getChildren (List &outChildren) const =0 throw (Error) |
virtual const Pointer | get (const std::vector< SizeType > &inIndices) const =0 throw (Error) |
virtual void | setParentCollection (const Pointer &inParentCollection) |
virtual Pointer | getParentCollection () const |
void | setWeakThis (const WeakPointer &inWeakThis) |
Pointer | getSharedThis () const |
const boost::shared_ptr< View > | getParent () const |
virtual void | setParent (const boost::shared_ptr< View > &inSource) |
void | getUserData (std::list< std::string > &outUserData) const |
void | setUserData (const std::list< std::string > &inSource) |
void | addUserData (const std::string &inSource) |
Protected Member Functions | |
void | addConnectedPort (const PortSharedPtr &inPort) throw (Error) |
void | removeConnectedPort (const PortSharedPtr &inPort) throw (Error) |
void | addConnectedPortList (const PortListSharedPtr &inPort) throw (Error) |
void | removeConnectedPortList (const PortListSharedPtr &inList) throw (Error) |
void | setConnectedPorts (const std::vector< PortSharedPtr > &inSource) throw (Error) |
void | addConnectedPortReference (const PortReferenceSharedPtr &portRef) throw (Error) |
void | removeConnectedPortReference (const PortReferenceSharedPtr &inPortRef) throw (Error) |
Net () | |
void | setConnectedPortRefs (const std::vector< PortReferenceSharedPtr > &inSource) throw (Error) |
virtual void | onConnect () throw (Error) |
virtual void | onDisconnect () throw (Error) |
Private Member Functions | |
Net (const Net &source) | |
Net & | operator= (const Net &source) |
Private Attributes | |
SymTab< std::string, NetSharedPtr, true > | mSubnets |
std::list< PortSharedPtr > | mConnectedPorts |
std::list< PortListSharedPtr > | mConnectedPortLists |
std::list< PortReferenceSharedPtr > | mConnectedPortRefs |
NetSharedPtr | mParentNet |
NetAttributesSharedPtr | mAttributes |
Friends | |
class | ConnectionHandler |
Represents an EDIF Net.
The Net class is an interface to EDIF nets. Net is an interface for scalar nets, vector nets, vector nets bits and net bundles. This class provides a simplified view of all three types of nets. To get a handle to an actual net, the client will have to use a Visitor with proper overloads of the visit() function, or dynamic_cast can be used. The latter method is however not recommended. A net object supports storing properties for storing different EDIF properties. See documentation of the Property and PropertyContainer classes for more details.
Definition at line 58 of file generic/Net.hpp.
|
inherited |
A signal to indicate that a new connection has been made
Definition at line 57 of file Connectable.hpp.
|
inherited |
A connection between a net and this object
Definition at line 52 of file Connectable.hpp.
|
inherited |
A signal to indicate that a connection has been removed
Definition at line 62 of file Connectable.hpp.
|
inherited |
List of Shared Pointers to objects of type Type
Definition at line 61 of file Composite.hpp.
|
inherited |
Definition at line 40 of file generic/Renamable.hpp.
|
inherited |
Shared Pointer to object of type Type
Definition at line 55 of file Composite.hpp.
|
inherited |
Definition at line 62 of file Composite.hpp.
|
inherited |
Definition at line 50 of file Composite.hpp.
|
inherited |
Definition at line 56 of file Composite.hpp.
|
protected |
Definition at line 43 of file generic/Net.cpp.
|
virtual |
|
private |
|
pure virtualinherited |
Receive an inoutVisitor to this class. The visit method of the inoutVisitor 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 situation can arise when the passed Visitor object does not inherit from the appropriate inoutVisitor specialization. See Visitor documentation for more details.
[in,out] | inoutVisitor | A reference to the inoutVisitor object |
Error | Visitor type inappropriate for visiting this object or any other error thrown by the Visitor::throw() method. |
Implemented in torc::generic::Root, torc::generic::Permutable, torc::generic::PortBundle, torc::generic::Status, torc::generic::VectorPort, torc::generic::View, torc::generic::InterfaceJoinedInfo, torc::generic::LogicElement, torc::generic::ParameterArray, torc::generic::InstanceArray, torc::generic::Cell, torc::generic::VectorPortReference, torc::generic::VectorNet, torc::generic::Library, torc::generic::LogicValue, torc::generic::Simulate, torc::generic::Property, torc::generic::SingleParameter, torc::generic::Design, torc::generic::SimulationInfo, torc::generic::NetBundle, torc::generic::PortBundleReference, torc::generic::ScalarPort, torc::generic::ScalarNet, torc::generic::ScalarPortReference, torc::generic::SingleInstance, torc::generic::LogicalResponse, torc::generic::InstanceArrayMember, torc::generic::ParameterArrayElement, torc::generic::Event, torc::generic::VectorNetBit, torc::generic::VectorPortBit, torc::generic::Timing, torc::generic::ForbiddenEvent, torc::generic::VectorPortBitReference, and torc::generic::Apply.
|
inherited |
Add a comment to the object
[in] | comment | The comment to add to an existing list of comments |
Definition at line 36 of file Commentable.cpp.
|
protected |
Connect a port to this net.
[in] | inPort | port to be added. Empty pointer is ignored. |
Error | Could not add Port, because Port name is empty |
Error | Could not add Port, because Port name is already exists |
Definition at line 147 of file generic/Net.cpp.
|
protected |
Definition at line 218 of file generic/Net.cpp.
|
protected |
Connect a port reference to this net.
[in] | inPortRef | Port reference to be added |
Error | Could not add port reference |
Definition at line 247 of file generic/Net.cpp.
void torc::generic::Net::addSubnet | ( | const NetSharedPtr & | inSubnet | ) | |
throw | ( | Error | |||
) |
Add a subnet to this net.
[in] | inSubnet | Subnet to be added |
Error | Could not add subnet, because subnet name is empty
|
Error | Could not add subnet, because subnet name is already exists
|
Add a subnet to this net.
[in] | inSubnet | Subnet to be added |
Error | Could not add subnet, because subnet name is empty |
Error | Could not add subnet, because subnet name is already exists |
Definition at line 63 of file generic/Net.cpp.
|
inherited |
Add an user data to the list of user data
[in] | inSource | An user data as string |
Definition at line 34 of file UserDataContainer.cpp.
|
inline |
Apply action on all connected port lists.
[in] | action | Action to be applied |
Definition at line 317 of file generic/Net.hpp.
|
inline |
Apply action on all connected port refs.
[in] | action | Action to be applied |
Definition at line 327 of file generic/Net.hpp.
|
inline |
Apply action on all connected ports.
[in] | action | Action to be applied |
Definition at line 307 of file generic/Net.hpp.
|
inlineinherited |
Apply action on all properties.
[in] | action | Action to be applied |
Definition at line 113 of file PropertyContainer.hpp.
|
inline |
Apply action on all Subnets.
[in] | action | Action to be applied |
Definition at line 284 of file generic/Net.hpp.
|
pure virtualinherited |
Connect a Net to this object.
[in] | inNet | A pointer to the Net object that needs to be Connected |
Connect a Net to this object.
[in] | inNet | A pointer to the Net object that eeds to be Connected |
Implemented in torc::generic::VectorPortReference, torc::generic::PortBundleReference, torc::generic::VectorNet, torc::generic::PortBundle, torc::generic::NetBundle, torc::generic::VectorPort, torc::generic::ScalarPort, torc::generic::ScalarNet, torc::generic::ScalarPortReference, torc::generic::PortList, torc::generic::VectorNetBit, torc::generic::VectorPortBit, and torc::generic::VectorPortBitReference.
Definition at line 60 of file Connectable.cpp.
|
pure virtualinherited |
Disconnect a Net from this object.
[in] | inConnection | A connection as returned by the connect() method |
Error | Provided connection is invalid |
Implemented in torc::generic::VectorPortReference, torc::generic::PortBundleReference, torc::generic::PortBundle, torc::generic::VectorNet, torc::generic::VectorPort, torc::generic::NetBundle, torc::generic::ScalarPort, torc::generic::ScalarNet, torc::generic::ScalarPortReference, torc::generic::PortList, torc::generic::VectorNetBit, torc::generic::VectorPortBit, and torc::generic::VectorPortBitReference.
Definition at line 83 of file Connectable.cpp.
|
inherited |
Disconnect the named Net from this object.
[in] | inName | Name of the net to be Disconnected |
Error | Provided net was not found |
Disconnect the named Net from this object.
[in] | inNname | Name of the net to be Disconnected |
Error | Provided net was not found |
Definition at line 111 of file Connectable.cpp.
|
inherited |
Disconnect the given Net from this object.
[in] | net | Pointer to a net |
Error | Provided net was not found |
Disconnect the given Net from this object.
[in] | inNet | Pointer to a net |
Error | Provided net was not found |
Definition at line 128 of file Connectable.cpp.
|
virtual |
Reimplemented from torc::generic::Connectable.
Reimplemented in torc::generic::VectorNet, and torc::generic::NetBundle.
Definition at line 311 of file generic/Net.cpp.
PortSharedPtr torc::generic::Net::findConnectedPort | ( | const std::string & | inName | ) | |
throw | ( | Error | |||
) |
Find a port connected to this net.
[in] | inName | Name of the port. If not found, empty pointer is returned |
Definition at line 166 of file generic/Net.cpp.
PortReferenceSharedPtr torc::generic::Net::findConnectedPortReference | ( | const std::string & | inName | ) | |
throw | ( | Error | |||
) |
Find a port reference connected to this net.
[in] | inName | Name of the port reference. If not found, empty pointer is returned |
Definition at line 266 of file generic/Net.cpp.
NetSharedPtr torc::generic::Net::findSubnet | ( | const std::string & | inName | ) | |
throw | ( | Error | |||
) |
Find a subnet from belonging to this net.
[in] | inName | Name of the subnet. If not found, empty pointer is returned |
Definition at line 85 of file generic/Net.cpp.
|
pure virtualinherited |
Get a specific member of this composition.
[in] | inIndices | A list of indices to be accessed. The number of indices must be equal to the number of dimensions. |
Error | Index dimensions mismatch |
Implemented in torc::generic::Vector< Net, VectorNetBit, VectorNetBit::Factory, true >, torc::generic::Bundle< Net >, torc::generic::VectorBit< Net >, and torc::generic::Scalar< Net >.
|
inline |
Get the attributes of the net. Attributes include criticality, netDelay etc.
Definition at line 303 of file generic/Net.hpp.
|
pure virtualinherited |
Get children of this composition.
[out] | outChildren | A list of all children for this composition |
Implemented in torc::generic::Vector< Net, VectorNetBit, VectorNetBit::Factory, true >, torc::generic::Scalar< Net >, and torc::generic::VectorBit< Net >.
|
inlineinherited |
Get the list of all comments
Definition at line 85 of file Commentable.hpp.
|
pure virtualinherited |
Get the type of this composition.
Implemented in torc::generic::Vector< Net, VectorNetBit, VectorNetBit::Factory, true >, torc::generic::Bundle< Net >, torc::generic::VectorBit< Net >, and torc::generic::Scalar< Net >.
|
virtualinherited |
Get the vector of Nets that are Connected to the current object. The connected elements are appended to the given vector
[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
Reimplemented in torc::generic::VectorPortReference, torc::generic::VectorNet, torc::generic::VectorPort, torc::generic::VectorNetBit, torc::generic::VectorPortBit, and torc::generic::VectorPortBitReference.
Definition at line 45 of file Connectable.cpp.
|
virtual |
Appends vector of connected port lists
[in] | outPortList | vector of port lists to be appended to |
Definition at line 213 of file generic/Net.cpp.
|
virtual |
Appends vector of connected port references
[in] | outPortRefs | vector of port refs to be appended to |
Reimplemented in torc::generic::VectorNet, and torc::generic::VectorNetBit.
Definition at line 279 of file generic/Net.cpp.
|
virtual |
Appends vector of connected ports
[in] | outPort | vector of port to be appended to |
[in] | inSkipChildConnections | Return only ports connected to this port and skip returning elements that have been connected to the child |
Reimplemented in torc::generic::VectorNet, and torc::generic::VectorNetBit.
Definition at line 179 of file generic/Net.cpp.
|
inlinevirtualinherited |
Get the object name
Definition at line 89 of file Nameable.hpp.
|
inlinevirtualinherited |
Get the new name provided for the object.
Definition at line 78 of file generic/Renamable.hpp.
|
inlineinherited |
Get a pointer to the parent object
|
inlinevirtualinherited |
Get a pointer to the parent collection
|
inline |
Definition at line 294 of file generic/Net.hpp.
|
inlineinherited |
Get the map of all properties
[out] | outProperties | The map of properties |
Get the map of all properties
Definition at line 107 of file PropertyContainer.hpp.
|
inherited |
Get a property
[in] | inName | Name of the property to be retreived |
Get a property
[in] | name | Name of the property to be retreived |
Definition at line 37 of file PropertyContainer.cpp.
|
inlineinherited |
Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.
Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.
[out] | ptr | Set to a shared pointer to this object |
|
pure virtualinherited |
Get the total number of bits of the composition
Implemented in torc::generic::Vector< Net, VectorNetBit, VectorNetBit::Factory, true >, torc::generic::Bundle< Net >, torc::generic::VectorBit< Net >, and torc::generic::Scalar< Net >.
|
inline |
Definition at line 279 of file generic/Net.hpp.
|
inlineinherited |
Get the list of all userData
[out] | outUserData | The list of all userData |
Definition at line 78 of file UserDataContainer.hpp.
|
protectedvirtualinherited |
A polymorphic function that is called after a net is Connected to this object
Definition at line 144 of file Connectable.cpp.
|
protectedvirtualinherited |
A polymorphic function that is called after a net is Disconnected from this object
Definition at line 149 of file Connectable.cpp.
|
protected |
Definition at line 185 of file generic/Net.cpp.
|
protected |
Definition at line 226 of file generic/Net.cpp.
|
protected |
Definition at line 285 of file generic/Net.cpp.
void torc::generic::Net::removeSubnet | ( | const std::string & | inName | ) | |
throw | ( | Error | |||
) |
Remove a subnet from this net.
inName | Name of the object to be delete |
Error | Could not remove subnet, because subnet name is empty
|
Error | Could not remove subnet, because subnet not present.
|
Remove a subnet from this net.
inName | Name of the object to be delete |
Error | Could not remove subnet, because subnet name is empty |
Error | Could not remove subnet, because subnet not present. |
Definition at line 99 of file generic/Net.cpp.
void torc::generic::Net::setAttributes | ( | const NetAttributesSharedPtr & | inSource | ) |
Set the attributes of the net. Attributes include criticality, netDelay etc.
[in] | inSource | Pointer to NetAttributes object. |
Definition at line 122 of file generic/Net.cpp.
|
inherited |
Get the list of all comments
[in] | inSource | A list of all comments to be set on this object |
Definition at line 45 of file Commentable.cpp.
|
protected |
Definition at line 298 of file generic/Net.cpp.
|
protected |
Definition at line 199 of file generic/Net.cpp.
|
inherited |
Set a name for this object
[in] | inSource | Name of the object |
Error | Could not set name, because name is empty (Will be used by array members)
|
Set a name for this object
[in] | inSource | Name of the object |
Error | Could not set name, because name is empty (Will be used by array members) |
Definition at line 41 of file Nameable.cpp.
|
virtualinherited |
Set the new name provided for the object.
[in] | inSource | Name of the object |
Definition at line 35 of file generic/Renamable.cpp.
|
virtualinherited |
Set a pointer to the parent
[in] | inSource | Set a pointer to the parent |
|
inlinevirtualinherited |
Set a pointer to a parnt composition.
[in] | inParentCollection | pointer to the parent collection (Vector/Bundle) |
Set a pointer to a parnt composition.
[in] | parentCollection | pointer to the parent collection (Vector/Bundle) |
void torc::generic::Net::setParentNet | ( | const NetSharedPtr & | inParent | ) |
Definition at line 113 of file generic/Net.cpp.
|
inherited |
Set the map of properties
[in] | inSource | The map of properties |
Definition at line 66 of file PropertyContainer.cpp.
|
inherited |
Save the inSource of a property
[in] | inName | Name of the property to be saved |
[in] | inProperty | Pointer to the property object if present, empty pointer otherwise. |
Save the inSource of a property
[in] | inName | Name of the property to be saved |
[in] | inPoperty | Pointer to the property object if present, empty pointer otherwise. |
Definition at line 53 of file PropertyContainer.cpp.
void torc::generic::Net::setSubnets | ( | const std::vector< NetSharedPtr > & | inSource | ) | |
throw | ( | Error | |||
) |
Definition at line 126 of file generic/Net.cpp.
|
inherited |
Set the list of userData
[in] | inSource | The list of UserData |
Definition at line 26 of file UserDataContainer.cpp.
|
inlineinherited |
Set a weak pointer to this object. This will be used later to get a shared pointer to this object from within other member methods if required. This should be called by the Factory creating the object.
[in] | weakThis | A weak pointer to this object |
|
inlineinherited |
A signal to indicate that a new connection has been made
Definition at line 167 of file Connectable.hpp.
|
inlineinherited |
A signal to indicate that a new connection has been made
Definition at line 174 of file Connectable.hpp.
|
friend |
Definition at line 64 of file generic/Net.hpp.
|
private |
Definition at line 276 of file generic/Net.hpp.
|
private |
Definition at line 273 of file generic/Net.hpp.
|
private |
Definition at line 274 of file generic/Net.hpp.
|
private |
Definition at line 272 of file generic/Net.hpp.
|
private |
Definition at line 275 of file generic/Net.hpp.
|
private |
Definition at line 271 of file generic/Net.hpp.