GATE
Loading...
Searching...
No Matches
gate_msgqueue_t Interface Reference

A message queue registers targets where messages can be sent to and received from. More...

#include <queues.h>

Inheritance diagram for gate_msgqueue_t:
gate_startable_t gate_object_t

Public Member Functions

gate_result_t start ()
 Starts message queue.
 
gate_result_t stop ()
 Stops message queue.
 
gate_enumint_t get_status ()
 Returns a status indicator about the message queue's operation mode.
 
gate_result_t add_target (gate_string_t const *target_address, gate_msgqueue_target_id_t *ptr_target_id)
 Registers a native target address and reserves a target_id were messages are sent to.
 
gate_result_t get_target (gate_msgqueue_target_id_t target_id, gate_string_t *ptr_target_address)
 Returns a status indicator about the message queue's operation mode.
 
gate_result_t resolve_target (gate_string_t const *target_address, gate_msgqueue_target_id_t *ptr_target_id)
 Returns a status indicator about the message queue's operation mode.
 
gate_result_t remove_target (gate_msgqueue_target_id_t target_id)
 Returns a status indicator about the message queue's operation mode.
 
gate_result_t publish (gate_msgqueue_target_id_t target_id, gate_uint32_t message_type, void const *data, gate_size_t length)
 Publishes a message to a registered target.
 
gate_result_t subscribe (gate_msgqueue_target_id_t target_id, gate_msgqueue_receiver_t receiver, void *user_param, gate_msgqueue_subscriber_t *ptr_subscriber)
 Registers a callback to receive message from a registered target.
 
gate_result_t unsubscribe (gate_msgqueue_subscriber_t subscriber)
 Unregisters a callback by its subscriber id from subscribe()
 
- Public Member Functions inherited from gate_startable_t
- Public Member Functions inherited from gate_object_t
char const * get_interface_name ()
 Returns on object's interface path name.
 
void release ()
 Decrease object's reference counter, releases the object when count reaches zero.
 
int retain ()
 Increase object's reference counter.
 

Detailed Description

A message queue registers targets where messages can be sent to and received from.

Member Function Documentation

◆ start()

gate_result_t start ( )

Starts message queue.

Returns
GATE_RESULT_* result code

Implements gate_startable_t.

◆ stop()

gate_result_t stop ( )

Stops message queue.

Returns
GATE_RESULT_* result code

Implements gate_startable_t.

◆ get_status()

gate_enumint_t get_status ( )

Returns a status indicator about the message queue's operation mode.

Returns
GATE_MSGQUEUE_STATUS_* status code

Implements gate_startable_t.

◆ add_target()

gate_result_t add_target ( gate_string_t const * target_address,
gate_msgqueue_target_id_t * ptr_target_id )

Registers a native target address and reserves a target_id were messages are sent to.

Parameters
[in]target_addressunique address to be interpreted by implementation
[out]ptr_target_idpointer to target_id, a generated unique identifier
Returns
GATE_RESULT_* result code

◆ get_target()

gate_result_t get_target ( gate_msgqueue_target_id_t target_id,
gate_string_t * ptr_target_address )

Returns a status indicator about the message queue's operation mode.

Parameters
[in]target_idx
[out]ptr_target_addressx
Returns
GATE_RESULT_* result code

◆ resolve_target()

gate_result_t resolve_target ( gate_string_t const * target_address,
gate_msgqueue_target_id_t * ptr_target_id )

Returns a status indicator about the message queue's operation mode.

Parameters
[in]target_addressx
[out]ptr_target_idx
Returns
GATE_RESULT_* result code

◆ remove_target()

gate_result_t remove_target ( gate_msgqueue_target_id_t target_id)

Returns a status indicator about the message queue's operation mode.

Parameters
[in]target_idx
Returns
GATE_RESULT_* result code

◆ publish()

gate_result_t publish ( gate_msgqueue_target_id_t target_id,
gate_uint32_t message_type,
void const * data,
gate_size_t length )

Publishes a message to a registered target.

Parameters
[in]target_idTarget ID to which the message is published
[in]message_typeprotocol specific message ID
[in]datapointer to message content to be published
[in]lengthlenght of published message content in bytes
Returns
GATE_RESULT_* result code

◆ subscribe()

gate_result_t subscribe ( gate_msgqueue_target_id_t target_id,
gate_msgqueue_receiver_t receiver,
void * user_param,
gate_msgqueue_subscriber_t * ptr_subscriber )

Registers a callback to receive message from a registered target.

Parameters
[in]target_idRegistered message target ID to receive messages from
[in]receiverCallback function to receive messages
[in]user_paramUser parameter to be added to each callback invocation
[out]ptr_subscriberPointer to subscriber Id that identifies this subscription
Returns
GATE_RESULT_* result code

◆ unsubscribe()

gate_result_t unsubscribe ( gate_msgqueue_subscriber_t subscriber)

Unregisters a callback by its subscriber id from subscribe()

Parameters
[in]subscriberSubscriber-ID to be unregistered
Returns
GATE_RESULT_* result code

The documentation for this interface was generated from the following file: