OSSIA
Open Scenario System for Interactive Application
Message queue

When threads cannot be used from the client side. More...

Detailed Description

When threads cannot be used from the client side.

Usage:

ossia_mq_t mq = ossia_mq_create(device);
...
ossia::parameter_t param;
ossia_value_t val;
while(ossia_mq_pop(mq, &param, &val)) {
// Do things with param & val
}
int ossia_mq_pop(ossia_mq_t mq, ossia_parameter_t *address, ossia_value_t *val)
Get the head of the message queue if any.
Definition: ossia_parameter.cpp:826
ossia_mq_t ossia_mq_create(ossia_device_t dev)
Create a message queue for a given device.
Definition: ossia_parameter.cpp:811
void ossia_mq_free(ossia_mq_t mq)
Remove a message queue.
Definition: ossia_parameter.cpp:840

Typedefs

typedef void * ossia_mq_t
 

Functions

OSSIA_EXPORT ossia_mq_t ossia_mq_create (ossia_device_t)
 Create a message queue for a given device. More...
 
OSSIA_EXPORT void ossia_mq_register (ossia_mq_t, ossia_parameter_t)
 Register a parameter into a message queue.
 
OSSIA_EXPORT void ossia_mq_unregister (ossia_mq_t, ossia_parameter_t)
 Unregister a parameter from a message queue.
 
OSSIA_EXPORT int ossia_mq_pop (ossia_mq_t mq, ossia_parameter_t *param, ossia_value_t *val)
 Get the head of the message queue if any. More...
 
OSSIA_EXPORT void ossia_mq_free (ossia_mq_t)
 Remove a message queue.
 

Function Documentation

◆ ossia_mq_create()

OSSIA_EXPORT ossia_mq_t ossia_mq_create ( ossia_device_t  dev)

Create a message queue for a given device.

The queue is single-produce single-consumer. The values are produced by received network messages, in a network thread.

This can be used to safely get the values in another thread.

◆ ossia_mq_pop()

OSSIA_EXPORT int ossia_mq_pop ( ossia_mq_t  mq,
ossia_parameter_t *  param,
ossia_value_t *  val 
)

Get the head of the message queue if any.

Returns
1 if the queue could be read successfully