Adaptagrams
Public Member Functions | List of all members
Avoid::HyperedgeRerouter Class Reference

The HyperedgeRerouter class is a convenience object that can be used to register hyperedges to be rerouted, improving the placement of their junctions and connector paths. More...

#include <hyperedge.h>

Collaboration diagram for Avoid::HyperedgeRerouter:
Collaboration graph

Public Member Functions

 HyperedgeRerouter ()
 Constructor for hyperedge rerouter object. More...
 
size_t registerHyperedgeForRerouting (ConnEndList terminals)
 Registers a hyperedge to be fully rerouted the next time the router processes a transaction. More...
 
size_t registerHyperedgeForRerouting (JunctionRef *junction)
 Registers a hyperedge to be fully rerouted the next time the router processes a transaction. More...
 
HyperedgeNewAndDeletedObjectLists newAndDeletedObjectLists (size_t index) const
 Returns a HyperedgeNewAndDeletedObjectLists detailing the lists of junctions and connectors created and deleted during hyperedge improvement. More...
 

Detailed Description

The HyperedgeRerouter class is a convenience object that can be used to register hyperedges to be rerouted, improving the placement of their junctions and connector paths.

To work with this class, you should get a copy from the router instance via a call to Router::hyperedgeRerouter().

If you would like a particular hyperedge to be completely rerouted with new junction positions then you should register it with this class via a call to registerHyperedgeForRerouting. A hyperedge can either be specified as a set of terminal vertices, or as a single JunctionRef. Passing a JunctionRef will cause HyperedgeRerouter to follow the attached connectors and junctions to determine the hyperedge. When you register a hyperedge you get an index number that can be used to later find information about it.

The rerouting will actually occur the next time the Router processes a transaction, see Router::processTransaction(). The rerouting will effectively create new junctions (JunctionRefs) and connectors (ConnRefs) for the hyperedge.
Since hyperedges are composed of multiple connections and junction objects, rerouting a hyperedge can cause creation of new or deletion of existing connectors and/or junctions. Thus once the transaction has been completed you should call the newAndDeletedObjectLists() to get an object containing the lists of created and deleted junctions and connectors. After the transaction You should not use references to these deleted objects any more from your own code (since the router will free their memory at its convenience) and you should refer only to the unaffected objects and the new connectors and junctions.

Constructor & Destructor Documentation

◆ HyperedgeRerouter()

Avoid::HyperedgeRerouter::HyperedgeRerouter ( )

Constructor for hyperedge rerouter object.

Note
You shouldn't create this object yourself. The Router instance has one that you can request a reference to via Router::hyperedgeRerouter().

Member Function Documentation

◆ newAndDeletedObjectLists()

HyperedgeNewAndDeletedObjectLists Avoid::HyperedgeRerouter::newAndDeletedObjectLists ( size_t  index) const

Returns a HyperedgeNewAndDeletedObjectLists detailing the lists of junctions and connectors created and deleted during hyperedge improvement.

This method will only return information once the router has processed the transaction. You should read this information before processTransaction() is called again.

After calling this you should no longer refer to any of the objects in the "deleted" lists — the router will delete these and free their memory at its convenience.

Parameters
indexThe index of the hyperedge to return junctions for.
Returns
A HyperedgeNewAndDeletedObjectLists containing lists of junctions and connectors created and deleted.

References Avoid::HyperedgeNewAndDeletedObjectLists::deletedConnectorList, Avoid::HyperedgeNewAndDeletedObjectLists::deletedJunctionList, Avoid::HyperedgeNewAndDeletedObjectLists::newConnectorList, and Avoid::HyperedgeNewAndDeletedObjectLists::newJunctionList.

◆ registerHyperedgeForRerouting() [1/2]

size_t Avoid::HyperedgeRerouter::registerHyperedgeForRerouting ( ConnEndList  terminals)

Registers a hyperedge to be fully rerouted the next time the router processes a transaction.

Parameters
[in]terminalsThe ConnEnds that form the endpoints of the hyperedge.
Returns
An index that can be used to request information on the resulting routing of the hyperedge.

◆ registerHyperedgeForRerouting() [2/2]

size_t Avoid::HyperedgeRerouter::registerHyperedgeForRerouting ( JunctionRef junction)

Registers a hyperedge to be fully rerouted the next time the router processes a transaction.

In this case the connectors and junctions attached to the given junction will be traversed to determine the endpoints of the hyperedge. These endpoints will then be used for the rerouting. The junctions and connectors forming the old route will be deleted.

Parameters
[in]junctionOne of the junctions that forms the hyperedge.
Returns
An index that can be used to request information on the resulting routing of the hyperedge.

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