#include <aleph-graph.H>
Collaboration diagram for Aleph::Graph_Attr:Public Member Functions | |
| void | reset () |
| Reset all attributes to their default value. | |
Public Attributes | |
| Bit_Fields | control_bits |
| long | counter = 0 |
| void * | cookie = nullptr |
General attributes for nodes and arc of graphs.
Each node and arc of a Aleph-w graph manages three fixed attributes:
control_bits: a field of type Bit_Fields for storing little state.counter: a long allowing to represent a much more wider state (colors, visit order, etc)cookie: a cookie is an opaque void pointer. Thes pointer could be used in order to associate to the node or arc state wider or different beyond the possibilities allowed by the bit fields and the counter. The three main uses of this pointer are:cookie and to perform an map. This has the great advantage that the map is deterministically
, by contrast with the probabilistic
of a hash table or the
of a binary search tree. In addition, this alternative, when required, is less space expensive.cookie pointer. Of course, be careful and be sure of deallocating it when it is not longer needed. Also, consider that you will need to cast the cookie to the type of information that you have defined.