Expose module registry
This commit is contained in:
parent
68a189dba1
commit
5969a1df8e
|
@ -1,7 +1,6 @@
|
||||||
#include "module_registry.h"
|
#include "module_registry.h"
|
||||||
#include "hash_table.h"
|
|
||||||
|
|
||||||
static TYPED_HASH_TABLE(GraphNodeSpecification*) registry;
|
static GraphNodeSpecificationRegistry registry;
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -34,7 +33,13 @@ lookup_graph_node_specification(const char * name)
|
||||||
return registry.value_array[idx];
|
return registry.value_array[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
const GraphNodeSpecificationRegistry *
|
||||||
|
get_graph_node_specification_registy()
|
||||||
|
{
|
||||||
|
ensure_initialized();
|
||||||
|
return ®istry;
|
||||||
|
}
|
||||||
|
|
||||||
__attribute__((destructor)) void
|
__attribute__((destructor)) void
|
||||||
destroy_graph_node_specification_registry()
|
destroy_graph_node_specification_registry()
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,9 +2,13 @@
|
||||||
#define MODULE_REGISTRY_H_
|
#define MODULE_REGISTRY_H_
|
||||||
|
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
|
#include "hash_table.h"
|
||||||
|
|
||||||
|
typedef TYPED_HASH_TABLE(GraphNodeSpecification*) GraphNodeSpecificationRegistry;
|
||||||
|
|
||||||
void register_graph_node_specification(GraphNodeSpecification * spec);
|
void register_graph_node_specification(GraphNodeSpecification * spec);
|
||||||
GraphNodeSpecification * lookup_graph_node_specification(const char * name);
|
GraphNodeSpecification * lookup_graph_node_specification(const char * name);
|
||||||
void destroy_graph_node_specification_registry();
|
void destroy_graph_node_specification_registry();
|
||||||
|
const GraphNodeSpecificationRegistry * get_graph_node_specification_registy();
|
||||||
|
|
||||||
#endif /* end of include guard: MODULE_REGISTRY_H_ */
|
#endif /* end of include guard: MODULE_REGISTRY_H_ */
|
||||||
|
|
Loading…
Reference in New Issue