isomatch
Classes | Public Member Functions | List of all members
WireManager Class Reference

#include <wireManager.h>

Classes

class  AlreadyDefined
 
class  NotDefined
 
class  WireException
 

Public Member Functions

 WireManager ()
 
 ~WireManager ()
 
WireIdfresh (const std::string &name)
 
bool hasWire (const std::string &name)
 
bool hasWire (size_t id)
 
const std::vector< WireId * > & allWires () const
 Returns all wires, including the merged ones. More...
 
std::vector< WireId * > wires () const
 Returns a vector of unique wires. More...
 
WireIdwire (const std::string &name, bool dontCreate=false)
 
WireIdwire (size_t id)
 
void rename (const std::string &curName, const std::string &newName)
 
void rename (size_t id, const std::string &newName)
 
size_t id () const
 

Detailed Description

Wire manager for a circuit

Allocates fresh wire IDs, finds previously defined wire IDs to establish connections, …

Constructor & Destructor Documentation

◆ WireManager()

WireManager::WireManager ( )

Basic constructor

◆ ~WireManager()

WireManager::~WireManager ( )

Member Function Documentation

◆ allWires()

const std::vector<WireId*>& WireManager::allWires ( ) const
inline

Returns all wires, including the merged ones.

◆ fresh()

WireId * WireManager::fresh ( const std::string &  name)

Allocates a fresh wire with the given name

Exceptions
AlreadyDefined

◆ hasWire() [1/2]

bool WireManager::hasWire ( const std::string &  name)

Checks the existence of a given wire

◆ hasWire() [2/2]

bool WireManager::hasWire ( size_t  id)

Checks the existence of a given wire

◆ id()

size_t WireManager::id ( ) const
inline

Get this wire manager's unique id

◆ rename() [1/2]

void WireManager::rename ( const std::string &  curName,
const std::string &  newName 
)

Renames a wire. Be sure to call this only if you do not rely on the previous wire's name: the old name won't be mapped to that wire anymore.

Exceptions
NotDefinedif there is no such wire.

◆ rename() [2/2]

void WireManager::rename ( size_t  id,
const std::string &  newName 
)

Renames a wire. Be sure to call this only if you do not rely on the previous wire's name: the old name won't be mapped to that wire anymore.

Exceptions
NotDefinedif there is no such wire.

◆ wire() [1/2]

WireId * WireManager::wire ( const std::string &  name,
bool  dontCreate = false 
)

Retrieves an existing wire, or creates it as a fresh one if it does not exist yet.

Parameters
nameThe name to search
dontCreateIf set to true, do not create the wire if it does not exist, but raise NotDefined instead.

◆ wire() [2/2]

WireId * WireManager::wire ( size_t  id)

Retrieves an existing wire by its id.

Exceptions
NotDefinedif the given id does not exist

◆ wires()

std::vector< WireId * > WireManager::wires ( ) const

Returns a vector of unique wires.


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