|
Graphviz 16.1.3~dev.20261121.1645
|
unordered set of Agsubnode_t *
More...
Go to the source code of this file.
Typedefs | |
| typedef struct graphviz_node_set | node_set_t |
| an unordered set | |
Functions | |
| node_set_t * | node_set_new (void) |
| void | node_set_add (node_set_t *self, Agsubnode_t *item) |
| Agsubnode_t * | node_set_find (node_set_t *self, IDTYPE key) |
| void | node_set_remove (node_set_t *self, IDTYPE item) |
| size_t | node_set_size (const node_set_t *self) |
| static bool | node_set_is_empty (const node_set_t *self) |
| void | node_set_free (node_set_t **self) |
| typedef struct graphviz_node_set node_set_t |
Definition at line 12 of file node_set.h.
| void node_set_add | ( | node_set_t * | self, |
| Agsubnode_t * | item | ||
| ) |
add an item to the set
If the backing store is not large enough, it is expanded on demand. On allocation failure, exit is called.
It is assumed the item being added does not already exist in the set. That is, insertion does not check for duplicates.
| self | Set to add to |
| item | Element to add |
Definition at line 418 of file node.c.
References graphviz_node_set::capacity_exp, free(), gv_calloc(), hash, graphviz_node_set::max, graphviz_node_set::min, graphviz_node_set::min_initialized, node_set_add(), node_set_get_capacity(), node_set_hash(), NULL, graphviz_node_set::size, graphviz_node_set::slots, TOMBSTONE, and UNREACHABLE.
Referenced by dict_relabel(), installnode(), and node_set_add().
| Agsubnode_t * node_set_find | ( | node_set_t * | self, |
| IDTYPE | key | ||
| ) |
lookup an existing item in a set
| self | Set to search |
| key | Identifier of node to look for |
NULL if it was not in the set Definition at line 483 of file node.c.
References agsubnodeideq(), hash, graphviz_node_set::max, graphviz_node_set::min_initialized, node_set_get_capacity(), node_set_hash(), NULL, graphviz_node_set::slots, and TOMBSTONE.
Referenced by agfindnode_by_id(), and agsubrep().
| void node_set_free | ( | node_set_t ** | self | ) |
|
inlinestatic |
is this set empty?
| self | Set to query |
Definition at line 58 of file node_set.h.
References node_set_size(), and NULL.
Referenced by agclose().
| node_set_t * node_set_new | ( | void | ) |
construct a new set
Calls exit on failure (out-of-memory).
Definition at line 406 of file node.c.
References gv_alloc().
Referenced by agopen1().
| void node_set_remove | ( | node_set_t * | self, |
| IDTYPE | item | ||
| ) |
remove an item from a set
If the given item was not in the set, this is a no-op.
| self | Set to remove from |
| item | Identifier of element to remove |
Definition at line 518 of file node.c.
References agsubnodeideq(), hash, node_set_get_capacity(), node_set_hash(), NULL, graphviz_node_set::size, graphviz_node_set::slots, and TOMBSTONE.
Referenced by agdelnodeimage(), and dict_relabel().
| size_t node_set_size | ( | const node_set_t * | self | ) |
get the number of items in a set
| self | Set to query |
Definition at line 546 of file node.c.
References NULL, and graphviz_node_set::size.
Referenced by agnnodes_z(), graphviz_tred(), installnode(), and node_set_is_empty().