#include "Integra/integra_core_schema.h"
#include "Integra/integra_port.h"
Go to the source code of this file.
Data Structures | |
struct | ntg_namespace_ |
Struct to hold data about the namespace and the port list. More... | |
struct | ntg_address_list_ |
Struct representing holding a list of addresses. More... | |
Defines | |
#define | NTG_NAMESPACE_SIZE 98317 |
Typedefs | |
typedef struct ntg_namespace_ | ntg_namespace |
Struct to hold data about the namespace and the port list. | |
typedef struct ntg_address_list_ | ntg_address_list |
Struct representing holding a list of addresses. | |
Enumerations | |
enum | ntg_ns_types_ { NTG_NS_OSC, NTG_NS_DBUS, NTG_NS_XML_RPC } |
enum outlining namespace types More... | |
Functions | |
void | ntg_get_namespace (const ntg_definition *definition, ntg_address_list *address_list) |
Populate an array with strings representing the namespace for a given class. | |
void | ntg_register_namespace (const char *instance_name, ntg_id instance_id, const unsigned int total_attributes, const unsigned int port_offset, const ntg_definition *definition) |
Create a namespace entry for a module instance. | |
unsigned int | ntg_address_hash (const char *address) |
Create a hash from an OSC address. | |
ntg_port * | ntg_address_resolve (const char *address) |
Resolve a namespace addres to a port. | |
char * | ntg_name_reformat (const char *name) |
Create an Integra formatted name. | |
char * | ntg_address_construct (const char *class_name, const char *attribute_name, const int type) |
Construct an Integra address string. |
#define NTG_NAMESPACE_SIZE 98317 |
Referenced by _init(), and ntg_address_hash().
typedef struct ntg_address_list_ ntg_address_list |
Struct representing holding a list of addresses.
typedef struct ntg_namespace_ ntg_namespace |
Struct to hold data about the namespace and the port list.
The namespace works by resolving symbolic addresses to Integra ports. For example /mymodule1/freq could correspond to module id: 143, port: 3
enum ntg_ns_types_ |
char* ntg_address_construct | ( | const char * | class_name, | |
const char * | attribute_name, | |||
const int | type | |||
) |
Construct an Integra address string.
class_name | Integra formatted class name | |
attribute_name | Integra formatted attribute name | |
Address | type code |
Can safely be freed with ntg_free()
References ntg_malloc(), and NTG_NS_OSC.
Referenced by ntg_get_namespace(), and ntg_register_namespace().
unsigned int ntg_address_hash | ( | const char * | address | ) |
Create a hash from an OSC address.
References MurmurHash2(), and NTG_NAMESPACE_SIZE.
Referenced by ntg_address_resolve(), and ntg_register_namespace().
ntg_port* ntg_address_resolve | ( | const char * | address | ) |
Resolve a namespace addres to a port.
References integra_namespace, ntg_address_hash(), and ntg_namespace_::ports.
Referenced by handler_namespace_method().
void ntg_get_namespace | ( | const ntg_definition * | definition, | |
ntg_address_list * | address_list | |||
) |
Populate an array with strings representing the namespace for a given class.
*definition | A pointer to the definition we want to get the namespace for | |
*addresses | A pointer to the 'to be allocated' address array |
References ntg_address_list_::addresses, _ntg_definition::id_parent, ntg_address_list_::n_addresses, ntg_address_construct(), ntg_free(), ntg_get_namespace(), ntg_name_reformat(), and NTG_NS_OSC.
Referenced by handler_module_nodelist(), and ntg_get_namespace().
char* ntg_name_reformat | ( | const char * | name | ) |
Create an Integra formatted name.
class_name | lowerCamelCase or CamelCase name |
Memory is allocated for a newly formatted name following the Integra name syntax:
tokens-separated-by-dashes
Can safely be freed with ntg_free()
References ntg_malloc(), and NTG_NULL_BYTES.
Referenced by handler_module_load(), ntg_get_namespace(), ntg_instance_register_namespace(), and ntg_register_namespace().
void ntg_register_namespace | ( | const char * | instance_name, | |
ntg_id | instance_id, | |||
const unsigned int | total_attributes, | |||
const unsigned int | port_offset, | |||
const ntg_definition * | definition | |||
) |
Create a namespace entry for a module instance.
References DB_NAMESPACE, DEBUG_POST(), _ntg_definition::id_parent, integra_namespace, ntg_port_::module_id, ntg_namespace_::n_registered_modules, ntg_namespace_::n_registered_ports, ntg_address_construct(), ntg_address_hash(), ntg_free(), ntg_name_reformat(), NTG_NS_OSC, ntg_register_namespace(), ntg_namespace_::port_counts, and ntg_namespace_::ports.
Referenced by ntg_instance_register_namespace(), and ntg_register_namespace().