Ignition Transport

API Reference

8.1.0
CIface.h File Reference
#include "ignition/transport/Export.hh"

Go to the source code of this file.

Classes

struct  SubscribeOpts
 

Typedefs

typedef struct IgnTransportNode IgnTransportNode
 A transport node. More...
 
typedef struct SubscribeOpts SubscribeOpts
 

Functions

int IGNITION_TRANSPORT_VISIBLE ignTransportAdvertise (IgnTransportNode *_node, const char *_topic, const char *_msgType)
 Advertise a topic. More...
 
IgnTransportNode IGNITION_TRANSPORT_VISIBLE * ignTransportNodeCreate (const char *_partition)
 Create a transport node. More...
 
void IGNITION_TRANSPORT_VISIBLE ignTransportNodeDestroy (IgnTransportNode **_node)
 Destroy a transport node. More...
 
int IGNITION_TRANSPORT_VISIBLE ignTransportPublish (IgnTransportNode *_node, const char *_topic, const void *_data, const char *_msgType)
 Publishes a message on a topic. More...
 
int IGNITION_TRANSPORT_VISIBLE ignTransportSubscribe (IgnTransportNode *_node, const char *_topic, void(*_callback)(const char *, size_t, const char *, void *), void *_userData)
 Subscribe to a topic, and register a callback. More...
 
int IGNITION_TRANSPORT_VISIBLE ignTransportSubscribeNonConst (IgnTransportNode *_node, char *_topic, void(*_callback)(char *, size_t, char *, void *), void *_userData)
 Subscribe to a topic, and register a callback. More...
 
int IGNITION_TRANSPORT_VISIBLE ignTransportSubscribeOptions (IgnTransportNode *_node, const char *_topic, SubscribeOpts _opts, void(*_callback)(const char *, size_t, const char *, void *), void *_userData)
 Subscribe to a topic, and register a callback. More...
 
int IGNITION_TRANSPORT_VISIBLE ignTransportUnsubscribe (IgnTransportNode *_node, const char *_topic)
 Unsubscribe from a topic. More...
 
void IGNITION_TRANSPORT_VISIBLE ignTransportWaitForShutdown ()
 Block the current thread until a SIGINT or SIGTERM is received. Note that this function registers a signal handler. Do not use this function if you want to manage yourself SIGINT/SIGTERM. More...
 

Typedef Documentation

◆ IgnTransportNode

A transport node.

◆ SubscribeOpts

typedef struct SubscribeOpts SubscribeOpts

Function Documentation

◆ ignTransportAdvertise()

int IGNITION_TRANSPORT_VISIBLE ignTransportAdvertise ( IgnTransportNode _node,
const char *  _topic,
const char *  _msgType 
)

Advertise a topic.

Parameters
[in]_nodePointer to a node.
[in]_topicTopic on which to publish the message.
[in]_msgTypeName of the message type.
Returns
0 on success.

◆ ignTransportNodeCreate()

IgnTransportNode IGNITION_TRANSPORT_VISIBLE* ignTransportNodeCreate ( const char *  _partition)

Create a transport node.

Parameters
[in]_partitionOptional name of the partition to use. Use nullptr to use the default value, which is specified via the IGN_PARTITION environment variable.
Returns
A pointer to a new transport node. Do not manually delete this pointer, instead use ignTransportNodeDestroy.

◆ ignTransportNodeDestroy()

void IGNITION_TRANSPORT_VISIBLE ignTransportNodeDestroy ( IgnTransportNode **  _node)

Destroy a transport node.

Parameters
[in,out]_nodeThe transport node to destroy.

◆ ignTransportPublish()

int IGNITION_TRANSPORT_VISIBLE ignTransportPublish ( IgnTransportNode _node,
const char *  _topic,
const void *  _data,
const char *  _msgType 
)

Publishes a message on a topic.

Parameters
[in]_nodePointer to a node.
[in]_topicTopic on which to publish the message.
[in]_dataByte array of serialized data to publish.
[in]_msgTypeName of the message type.
Returns
0 on success.

◆ ignTransportSubscribe()

int IGNITION_TRANSPORT_VISIBLE ignTransportSubscribe ( IgnTransportNode _node,
const char *  _topic,
void(*)(const char *, size_t, const char *, void *)  _callback,
void *  _userData 
)

Subscribe to a topic, and register a callback.

Parameters
[in]_nodePointer to a node.
[in]_topicName of the topic.
[in]_callbackThe function to call when a message is received.
[in]_userDataArbitrary user data pointer.
Returns
0 on success.

◆ ignTransportSubscribeNonConst()

int IGNITION_TRANSPORT_VISIBLE ignTransportSubscribeNonConst ( IgnTransportNode _node,
char *  _topic,
void(*)(char *, size_t, char *, void *)  _callback,
void *  _userData 
)

Subscribe to a topic, and register a callback.

Parameters
[in]_nodePointer to a node.
[in]_topicName of the topic.
[in]_callbackThe function to call when a message is received.
[in]_userDataArbitrary user data pointer.
Returns
0 on success.

◆ ignTransportSubscribeOptions()

int IGNITION_TRANSPORT_VISIBLE ignTransportSubscribeOptions ( IgnTransportNode _node,
const char *  _topic,
SubscribeOpts  _opts,
void(*)(const char *, size_t, const char *, void *)  _callback,
void *  _userData 
)

Subscribe to a topic, and register a callback.

Parameters
[in]_nodePointer to a node.
[in]_topicName of the topic.
[in]_callbackThe function to call when a message is received.
[in]_userDataArbitrary user data pointer.
Returns
0 on success.

◆ ignTransportUnsubscribe()

int IGNITION_TRANSPORT_VISIBLE ignTransportUnsubscribe ( IgnTransportNode _node,
const char *  _topic 
)

Unsubscribe from a topic.

Parameters
[in]_nodePointer to a node.
[in]_topicName of the topic.
Returns
0 on success.

◆ ignTransportWaitForShutdown()

void IGNITION_TRANSPORT_VISIBLE ignTransportWaitForShutdown ( )

Block the current thread until a SIGINT or SIGTERM is received. Note that this function registers a signal handler. Do not use this function if you want to manage yourself SIGINT/SIGTERM.