Hook description (API) More...
Public Member Functions | |
virtual Component * | getComponent () const =0 |
Hook * | getNextHook () const |
Hook * | getPreviousHook () const |
Hook * | getMasterHook () const |
Hook * | getNextMasterHook () const |
Hook * | getPreviousMasterHook () const |
Hooks | getHooks () const |
Hooks | getSlaveHooks () const |
virtual bool | isMaster () const =0 |
bool | isAttached () const |
Hook * | detach () |
Hook * | attach (Hook *hook) |
Hook * | merge (Hook *hook) |
Hook description (API)
The hook is an object which is nested inside a component and which represents some specific part of this component (like its body, its origin or its extremity ...).
The Hook class is an abstract one, that means that for any new type of part a new hook subclass must be derived. Each hook specialization will be described altogether with the component which includes it.
The Component for instance introduces the concept of BodyHook representing the body of the component (which can be assimilated to the component itself).
Hooks are assembled into a ring (circular link) thanks to a special field pointing to the next hook within the ring.
This field is never NULL, by default it points to itself, generating a minimal ring.
There are two kinds of hooks : the masters and the slaves.
Rings are organized such that all slave hooks of a master hook are placed in the ring immediately before it (the ordering of slaves is not significant).
Therefore, to find the master of a given slave, it's enough to follow the ring pointers, starting from the slave, until a master is found.
This dependency between a slave and its master means that the part of the component represented by the slave is anchored on the part of the component represented by the master.
This dependence relationship is indeed an explicit connection.
Within a ring many relationships master-slaves can cohabit.
This cohabitation has a specific meaning for the different masters of the ring. In fact, the ring must be considered as a connection request between the different masters of the ring.
In other words, this means that the different masters remains to be connected together, or more generaly stated, that the different connected subsets of components associated to those masters remains to be connected together.
The ordering of masters within a ring has no particular signification.
We can imagine the master-slaves relation as a kind of hyper-hook representing the associated sub-ring, and the ring containing multiple master-slaves relations as an hyper-ring made up of hyper-hooks needing to be connected.
Therefore there will be two different levels of ring processing functions depending on wether we handle hooks stricktly speaking or we handle hyper-hooks representing multiple master hooks.
There is no Hook constructor available because they are created by the components themselves.
On the same way, hooks disapear automatically with their owner.
|
pure virtual |
Returns: the component whose hook represents a part.
Hook * Hurricane::Hook::getNextHook | ( | ) | const |
Returns: the next hook within the ring.
Hook * Hurricane::Hook::getPreviousHook | ( | ) | const |
Returns: the previous hook within the ring.
Hook * Hurricane::Hook::getMasterHook | ( | ) | const |
Returns: the master of the relation master-slaves identified by the hook.
Hook * Hurricane::Hook::getNextMasterHook | ( | ) | const |
Returns: the first master found when starting the search immediately after the given hook.
Hook * Hurricane::Hook::getPreviousMasterHook | ( | ) | const |
Returns: the first master found when starting a backwards search immediately before the given hook.
Hooks Hurricane::Hook::getHooks | ( | ) | const |
Returns: the collection of hooks of the ring containing the given hook.
Hooks Hurricane::Hook::getSlaveHooks | ( | ) | const |
Returns: the hook collection which are slaves of the given hook.
When visiting the slaves of a master, those are accessed in the assembly order : the first one is the oldest inserted (they are accessed starting from the first slave found when starting a ring loop from the master itself).
The master is not included in this collection.
|
pure virtual |
Returns: true if the hook must be considered as a master, else false.
bool Hurricane::Hook::isAttached | ( | ) | const |
If the hook is a slave :
Returns: true if the hook has an associated master, else false.
If the hook is a master :
Let us consider the hyper-ring made upon hyper-hooks. Then the function returns true if the ring contains at least an other master else false.
Hook * Hurricane::Hook::detach | ( | ) |
If the hook is a slave :
detaches the hook from its ring and returns its old predecessor.
If the hook is a master :
Let us consider the hyper-ring made upon hyper-hooks. Then, the function detaches the hyper-hook (the sub-ring made up of the master and its slaves, if any) from the hyper-ring and returns the old predecessor of the hyper-hook.
Within the detached hyper-hook, the relationship master hook
The returned hook, if not NULL, is byforce a master.
If the hook (this) is a slave :
The function inserts the hook immediately before <masterHook>
and returns this masterHook.
<masterHook>
is not a master hook.If the hook (this) is a master :
Let us consider the hyper-ring made upon hyper-hooks. Then, the function attaches the the hyper-hook (the sub-ring made up of this master hook and its slaves, if any) before the <masterHook>
and returns this masterHook.
<masterHook>
is not a master hook. merges the rings represented by the two hooks which both must be masters, returns <masterHook>
.
This function doesn't change the two relatioships master-slaves but modifies the connection request between corresponding hyper-hooks.
Generated by doxygen 1.9.1 on Thu Aug 11 2022 | Return to top of page |
Hurricane VLSI Database | Copyright © 2000-2020 Bull S.A. All rights reserved |