#include <assert.h>
#include <stdlib.h>
#include "graph.h"
#include "gr.h"
#include "actions.h"
Go to the source code of this file.
Defines | |
| #define | ASSERT_GR(g) assert(gr && gr->magic == GR_GRAPH_MAGIC && "wrong graph instance") |
| #define | ASSERT_INST(g) assert(g && g->magic == GR_GENERATION_MAGIC && "wrong generation instance") |
Functions | |
| static void | gr_graph_add_node (gr_graph_t *gr, gr_id_t id, void *context) |
| static void | gr_graph_add_edge (gr_graph_t *gr, gr_id_t id, void *context) |
| static void | gr_graph_set_node_type (gr_graph_t *gr, gr_id_t id, void *context) |
| static void | gr_act_match (const gr_actions_t *acts, const gr_match_t *match, void *context) |
| static void | gr_act_before_finish (const gr_actions_t *acts, const gr_match_t *match, void *context) |
| static void | gr_act_after_finish (const gr_actions_t *acts, const gr_match_t *match, void *context) |
| void | gr_install_generations (gr_graph_t *gr, gr_actions_t *acts, gr_id_t node_gen_attr, gr_id_t edge_gen_attr, unsigned flags) |
| int | gr_get_cur_generation (gr_graph_t *gr) |
| int | gr_get_next_generation (gr_graph_t *gr) |
| void | gr_set_cur_generation (gr_graph_t *gr, int count) |
Definition in file generation.c.
|
|
Definition at line 40 of file generation.c. |
|
|
Definition at line 41 of file generation.c. Referenced by gr_act_after_finish(), gr_act_before_finish(), gr_act_match(), gr_get_cur_generation(), gr_get_next_generation(), gr_graph_add_edge(), gr_graph_add_node(), gr_graph_set_node_type(), and gr_set_cur_generation(). |
|
||||||||||||||||
|
Called, after an action was finished. Increases the generation if no update was specified, so nodes after the match wil get one. Definition at line 152 of file generation.c. References ASSERT_INST, _gr_generation_t::flags, _gr_generation_t::generation, and GR_GENERATION_INC_AFTER_FINISH_FLAG. Referenced by gr_install_generations(). |
|
||||||||||||||||
|
Called, before an action was finished. Increases the generation if update was specified, so newly created thinks will get a new one. Definition at line 137 of file generation.c. References ASSERT_INST, _gr_generation_t::flags, _gr_generation_t::generation, and GR_GENERATION_INC_BEFORE_FINISH_FLAG. Referenced by gr_install_generations(). |
|
||||||||||||||||
|
Called, after an action was matched. Sets a new generation for all matched nodes/edges if requested Definition at line 98 of file generation.c. References ASSERT_INST, _gr_generation_t::edge_generation_attr, _gr_generation_t::flags, _gr_generation_t::generation, GR_GENERATION_INC_ON_MATCH_FLAG, GR_GENERATION_UPD_ON_MATCH_FLAG, gr_id_is_valid, gr_kind_integer, gr_set_edge_attr(), gr_set_node_attr(), gr_value_init, gr_value_set_integer(), and _gr_generation_t::node_generation_attr. Referenced by gr_install_generations(). |
|
|
Gets the current generation count.
Definition at line 206 of file generation.c. References ASSERT_GR, ASSERT_INST, and _gr_generation_t::generation. Referenced by gr_graph_add_edge(), gr_graph_add_node(), and gr_graph_set_node_type(). |
|
|
Gets the next generation count. Can be used to increase the generation manualy.
Definition at line 214 of file generation.c. References ASSERT_GR, ASSERT_INST, and _gr_generation_t::generation. |
|
||||||||||||||||
|
Called, after an edge was added Definition at line 64 of file generation.c. References ASSERT_INST, gr_get_cur_generation(), gr_kind_integer, gr_set_edge_attr(), gr_value_init, gr_value_set_integer(), and _gr_generation_t::node_generation_attr. Referenced by gr_install_generations(). |
|
||||||||||||||||
|
Called, after a node was added Definition at line 48 of file generation.c. References ASSERT_INST, gr_get_cur_generation(), gr_kind_integer, gr_set_node_attr(), gr_value_init, gr_value_set_integer(), and _gr_generation_t::node_generation_attr. Referenced by gr_install_generations(). |
|
||||||||||||||||
|
Called, when a node gets another type Definition at line 80 of file generation.c. References ASSERT_INST, gr_get_cur_generation(), gr_kind_integer, gr_set_node_attr(), gr_value_init, gr_value_set_integer(), and _gr_generation_t::node_generation_attr. Referenced by gr_install_generations(). |
|
||||||||||||||||||||||||
|
||||||||||||
|
Sets the current generation count.
Definition at line 222 of file generation.c. References ASSERT_GR, ASSERT_INST, and _gr_generation_t::generation. |
1.4.1