/mnt/hgfs/jamie_On_My_Mac/store/version_control/svn/integralive/library/trunk/src/namespace.c File Reference

#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_portntg_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 Documentation

#define get16bits (  ) 
Value:
((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
                       +(uint32_t)(((const uint8_t *)(d))[0]) )

Referenced by SuperFastHash().


Function Documentation

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.

Parameters:
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.

Parameters:
*definition A pointer to the definition we want to get the namespace for
*addresses A pointer to the 'to be allocated' address array
Note:
*addresses can safely be freed with ntg_free()

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.

Parameters:
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 
)
uint32_t SuperFastHash ( const char *  data,
int  len 
)

References get16bits.


Generated on Tue Jan 5 14:02:29 2010 for LibIntegra by  doxygen 1.6.1