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

#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_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 NTG_NAMESPACE_SIZE   98317

Referenced by _init(), and ntg_address_hash().


Typedef Documentation

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


Enumeration Type Documentation

enum outlining namespace types

Enumerator:
NTG_NS_OSC 
NTG_NS_DBUS 
NTG_NS_XML_RPC 

Function Documentation

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 
)

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