Gazebo Transport

API Reference

8.5.0
gz/transport/CIface.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef INCLUDE_GZ_TRANSPORT_CIFACE_H_
19 #define INCLUDE_GZ_TRANSPORT_CIFACE_H_
20 
21 #include "gz/transport/Export.hh"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26  typedef struct SubscribeOpts
27  {
28  // cppcheck-suppress unusedStructMember
29  unsigned int msgsPerSec;
30  } SubscribeOpts;
31 
34 
41  IgnTransportNode IGNITION_TRANSPORT_VISIBLE *ignTransportNodeCreate(
42  const char *_partition);
43 
46  void IGNITION_TRANSPORT_VISIBLE
48 
54  int IGNITION_TRANSPORT_VISIBLE
56  const char *_topic,
57  const char *_msgType);
58 
59 
66  int IGNITION_TRANSPORT_VISIBLE
68  const char *_topic,
69  const void *_data,
70  const char *_msgType);
71 
78  int IGNITION_TRANSPORT_VISIBLE
80  const char *_topic,
81  void (*_callback)(const char *, size_t, const char *, void *),
82  void *_userData);
83 
91  int IGNITION_TRANSPORT_VISIBLE
93  const char *_topic, SubscribeOpts _opts,
94  void (*_callback)(const char *, size_t, const char *, void *),
95  void *_userData);
96 
103  int IGNITION_TRANSPORT_VISIBLE
104  ignTransportSubscribeNonConst(IgnTransportNode *_node, char *_topic,
105  void (*_callback)(char *, size_t, char *, void *),
106  void *_userData);
107 
112  int IGNITION_TRANSPORT_VISIBLE
113  ignTransportUnsubscribe(IgnTransportNode *_node, const char *_topic);
114 
118  void IGNITION_TRANSPORT_VISIBLE ignTransportWaitForShutdown();
119 
120 #ifdef __cplusplus
121 }
122 #endif // INCLUDE_GZ_TRANSPORT_CIFACE_H_
123 #endif
void IGNITION_TRANSPORT_VISIBLE ignTransportWaitForShutdown()
Block the current thread until a SIGINT or SIGTERM is received. Note that this function registers a s...
int IGNITION_TRANSPORT_VISIBLE ignTransportAdvertise(IgnTransportNode *_node, const char *_topic, const char *_msgType)
Advertise a topic.
int IGNITION_TRANSPORT_VISIBLE ignTransportPublish(IgnTransportNode *_node, const char *_topic, const void *_data, const char *_msgType)
Publishes a message on a topic.
struct IgnTransportNode IgnTransportNode
A transport node.
Definition: gz/transport/CIface.h:33
void IGNITION_TRANSPORT_VISIBLE ignTransportNodeDestroy(IgnTransportNode **_node)
Destroy a transport node.
struct SubscribeOpts SubscribeOpts
unsigned int msgsPerSec
Definition: gz/transport/CIface.h:29
int IGNITION_TRANSPORT_VISIBLE ignTransportUnsubscribe(IgnTransportNode *_node, const char *_topic)
Unsubscribe from a topic.
IgnTransportNode IGNITION_TRANSPORT_VISIBLE * ignTransportNodeCreate(const char *_partition)
Create a transport node.
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.
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.
Definition: gz/transport/CIface.h:26
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.