Public Member Functions | |
NodeAddress () | |
Default constructor; creates a new, empty NodeAddress. | |
NodeAddress (const NodeAddress &addrParent, GenericNode *nd) | |
Creates a new node address for the node nd , where the node address of nd s parent node is addrParent . | |
NodeAddress (const NodeAddress &addrParent, char *id) | |
Creates a new node address leading to a node with node ID id . | |
NodeAddress (NodeAddress &) | |
Copy constructor. | |
~NodeAddress () | |
Deletes all data members and destroys the instance. | |
bool | contains (char *id) const |
Tests whether a node address contains a given node ID. | |
bool | operator== (const NodeAddress &na) const |
Equality operator. | |
NodeAddress | operator= (const NodeAddress &na) |
Assignment operator. | |
void | parentAddress (NodeAddress &pa) |
Calculates the node address of the immediate parent node. | |
const char * | nodeID (void) const |
Returns the node ID of the node this address points to in a static buffer. | |
void | print () const |
Prints the node address to stdout . | |
void | sprint (char *buf) |
Prints the node address to a string buffer. | |
Public Attributes | |
unsigned char * | addr |
An array that contains the node address. | |
unsigned int | len |
The length of the addr array. |
Although feature structures can contain shared data, the visible properties of two instances of a shared feature structure (e.g. visible vs. hidden, expanded vs. collapsed) can be different. Therefore, every node that can be displayed must have a unique address that not only encodes which data node it is associated with but also its exact position in the overall feature structure. This unique address is essentially a path from the topmost node in the overall structure to the substructure it identifies, very much like paths in standard feature structure descriptions. The format of a node address is as follows: Every single node in the data structure passed to grisu specifies an integer number in the "id" field of the record (see the communications protocol EBNF). This number is converted into an array of individual integers, each representing one indivdual digit, so 2436 becomes [2,4,3,6]. The full address of a node is calculated by concatenating all the id's of all the nodes from the root to this node. Node id's are prepended; thus the id of the root node will always end up to be the rightmost. The two uppper bits in each entry are reserved, where 0x80 indicates that the id of a new node starts at this position, and 0x40 indicates that the id of a node ends at this position.
|
Default constructor; creates a new, empty NodeAddress. Note that an empty node address is not equal to the node address of the root node, which contains exactly one node ID, the node ID of the root node in the data package. |
|
Creates a new node address for the node
|
|
Creates a new node address leading to a node with node ID
|
|
Copy constructor.
|
|
Deletes all data members and destroys the instance.
|
|
Tests whether a node address contains a given node ID.
|
|
Returns the node ID of the node this address points to in a static buffer.
|
|
Assignment operator.
|
|
Equality operator.
|
|
Calculates the node address of the immediate parent node.
|
|
Prints the node address to
|
|
Prints the node address to a string buffer.
|
|
An array that contains the node address.
|
|
The length of the addr array.
|