#include "stdint.h"#include <stdlib.h>#include <string.h>#include <stdio.h>#include <assert.h>#include <ctype.h>#include "Integra/integra_core_schema.h"#include "namespace.h"#include "helper.h"#include "memory.h"#include "globals.h"#include "debug.h"Defines | |
| #define | get16bits(d) |
Functions | |
| uint32_t | SuperFastHash (const char *data, int len) |
| unsigned int | MurmurHash2 (const void *key, int len, unsigned int seed) |
| 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 get16bits | ( | d | ) |
((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ +(uint32_t)(((const uint8_t *)(d))[0]) )
Referenced by SuperFastHash().
| unsigned int MurmurHash2 | ( | const void * | key, | |
| int | len, | |||
| unsigned int | seed | |||
| ) |
Referenced by ntg_address_hash().
| 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().
| uint32_t SuperFastHash | ( | const char * | data, | |
| int | len | |||
| ) |
References get16bits.
1.6.1