O2 2.0
A communication protocol for interactive music and media applications.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Services_entry Class Reference
Inheritance diagram for Services_entry:
O2node O2obj

Public Member Functions

 Services_entry (const char *service_name)
 
void show (int indent)
 
int proc_service_index (Proxy_info *proc)
 
Service_providerproc_service_find (Proxy_info *proc)
 
bool add_service (O2string our_ip_port, O2node *service, char *properties)
 
O2err service_remove (const char *srv_name, int index, Proxy_info *proc)
 
O2err insert_tap (O2string tapper, Proxy_info *proxy, O2tap_send_mode send_mode)
 
O2err tap_remove (Proxy_info *proc, const char *tapper)
 
void pick_service_provider ()
 
void remove_if_empty ()
 
- Public Member Functions inherited from O2node
 O2node (const char *key_, int tag_)
 
virtual const char * get_proc_name ()
 
virtual O2status status (const char **process)
 
- Public Member Functions inherited from O2obj
void * operator new (size_t size)
 
void operator delete (void *ptr)
 

Static Public Member Functions

static Services_entry ** find (const char *service_name)
 
static Service_providerfind_local_entry (const char *service_name)
 
static O2nodeservice_find (const char *service_name, Services_entry **services)
 Use initial part of an O2 address to find an o2_service using a hash table lookup. More...
 
static Services_entry ** find_from_msg (O2message_ptr msg)
 
static Services_entrymust_get_services (O2string service_name)
 
static O2err service_new (O2string padded_name)
 
static O2err service_provider_new (O2string name, const char *properties, O2node *service, Proxy_info *proc)
 
static O2err service_provider_replace (const char *service_name, O2node **node_ptr, O2node *new_service)
 
static O2err proc_service_remove (const char *service_name, Proxy_info *proc, Services_entry *ss, int index)
 
static void list_services (Vec< Services_entry * > &list)
 
static O2err remove_services_by (Proxy_info *proc)
 

Public Attributes

Vec< Service_providerservices
 
Vec< Service_taptaps
 
- Public Attributes inherited from O2node
int tag
 
O2string key
 
O2nodenext
 

Member Function Documentation

◆ proc_service_index()

int Services_entry::proc_service_index ( Proxy_info proc)

find address of service in services that is offered by proc, if any. Note that if proc is the local process (o2_ctx->proc), the result can be an OSC or BRIDGE node, since these are proxies for the local process.

◆ service_find()

O2node * Services_entry::service_find ( const char *  service_name,
Services_entry **  services 
)
static

Use initial part of an O2 address to find an o2_service using a hash table lookup.

Parameters
namepoints to the service name (do not include the initial '!' or '/' from the O2 address).
Returns
The pointer to the service, which is a Hash_node, Handler_node, or Proxy_info (Proc_info, OSC_info or Bridge_info)

◆ service_provider_replace()

O2err Services_entry::service_provider_replace ( const char *  service_name,
O2node **  node_ptr,
O2node new_service 
)
static

replace the service named service_name offered by proc with new_service. This happens when we change from all-service handler to per-node handlers or vice versa. Also happens when we delete a service, and when we remove a remote service when it disconnects.

precondition: service_name does not have '/' && new_service != NULL

CASE 1: called from o2_method_new(), installing a global handler for service, maybe replacing an existing one, maybe not. CASE 2: called from o2_method_new(), replacing a global handler with a hash_node where we can install a Hash_node based on the next node in the address. (no more cases because we moved others to o2_service_remove)

◆ show()

void Services_entry::show ( int  indent)
virtual

Reimplemented from O2node.


The documentation for this class was generated from the following files: