Gazebo Transport

API Reference

13.5.0
CIface.h File Reference
#include "gz/transport/Export.hh"

Go to the source code of this file.

Classes

struct  SubscribeOpts
 

Typedefs

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

Functions

int gzTransportAdvertise (GzTransportNode *_node, const char *_topic, const char *_msgType)
 Advertise a topic. More...
 
GzTransportNodegzTransportNodeCreate (const char *_partition)
 Create a transport node. More...
 
void gzTransportNodeDestroy (GzTransportNode **_node)
 Destroy a transport node. More...
 
int gzTransportPublish (GzTransportNode *_node, const char *_topic, const void *_data, const char *_msgType)
 Publishes a message on a topic. More...
 
int gzTransportSubscribe (GzTransportNode *_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 gzTransportSubscribeNonConst (GzTransportNode *_node, char *_topic, void(*_callback)(char *, size_t, char *, void *), void *_userData)
 Subscribe to a topic, and register a callback. More...
 
int gzTransportSubscribeOptions (GzTransportNode *_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 gzTransportUnsubscribe (GzTransportNode *_node, const char *_topic)
 Unsubscribe from a topic. More...
 
void gzTransportWaitForShutdown ()
 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...
 

Variables

const auto ignTransportAdvertise = gzTransportAdvertise
 
const auto ignTransportNodeCreate = gzTransportNodeCreate
 
const auto ignTransportNodeDestroy = gzTransportNodeDestroy
 
const auto ignTransportPublish = gzTransportPublish
 
const auto ignTransportSubscribe = gzTransportSubscribe
 
const auto ignTransportSubscribeNonConst = gzTransportSubscribeNonConst
 
const auto ignTransportSubscribeOptions = gzTransportSubscribeOptions
 
const auto ignTransportUnsubscribe = gzTransportUnsubscribe
 
const auto ignTransportWaitForShutdown = gzTransportWaitForShutdown
 

Typedef Documentation

◆ GzTransportNode

A transport node.

◆ SubscribeOpts

typedef struct SubscribeOpts SubscribeOpts

Function Documentation

◆ gzTransportAdvertise()

int gzTransportAdvertise ( GzTransportNode _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.

◆ gzTransportNodeCreate()

GzTransportNode* gzTransportNodeCreate ( 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 GZ_PARTITION environment variable.
Returns
A pointer to a new transport node. Do not manually delete this pointer, instead use gzTransportNodeDestroy.

◆ gzTransportNodeDestroy()

void gzTransportNodeDestroy ( GzTransportNode **  _node)

Destroy a transport node.

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

◆ gzTransportPublish()

int gzTransportPublish ( GzTransportNode _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.

◆ gzTransportSubscribe()

int gzTransportSubscribe ( GzTransportNode _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.

◆ gzTransportSubscribeNonConst()

int gzTransportSubscribeNonConst ( GzTransportNode _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.

◆ gzTransportSubscribeOptions()

int gzTransportSubscribeOptions ( GzTransportNode _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]_optsSubscriber options.
[in]_callbackThe function to call when a message is received.
[in]_userDataArbitrary user data pointer.
Returns
0 on success.

◆ gzTransportUnsubscribe()

int gzTransportUnsubscribe ( GzTransportNode _node,
const char *  _topic 
)

Unsubscribe from a topic.

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

◆ gzTransportWaitForShutdown()

void gzTransportWaitForShutdown ( )

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.

Variable Documentation

◆ ignTransportAdvertise

const auto ignTransportAdvertise = gzTransportAdvertise

◆ ignTransportNodeCreate

const auto ignTransportNodeCreate = gzTransportNodeCreate

◆ ignTransportNodeDestroy

const auto ignTransportNodeDestroy = gzTransportNodeDestroy

◆ ignTransportPublish

const auto ignTransportPublish = gzTransportPublish

◆ ignTransportSubscribe

const auto ignTransportSubscribe = gzTransportSubscribe

◆ ignTransportSubscribeNonConst

const auto ignTransportSubscribeNonConst = gzTransportSubscribeNonConst

◆ ignTransportSubscribeOptions

const auto ignTransportSubscribeOptions = gzTransportSubscribeOptions

◆ ignTransportUnsubscribe

const auto ignTransportUnsubscribe = gzTransportUnsubscribe

◆ ignTransportWaitForShutdown

const auto ignTransportWaitForShutdown = gzTransportWaitForShutdown