rmw_dds_common  master
Define a common interface between DDS implementations of ROS middleware.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
context.hpp
1 // Copyright 2019 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RMW_DDS_COMMON__CONTEXT_HPP_
16 #define RMW_DDS_COMMON__CONTEXT_HPP_
17 
18 #include <atomic>
19 #include <mutex>
20 #include <thread>
21 
22 #include "rmw/types.h"
23 
24 #include "rmw_dds_common/graph_cache.hpp"
25 #include "rmw_dds_common/visibility_control.h"
26 
27 namespace rmw_dds_common
28 {
29 
32 struct Context
33 {
47  std::atomic_bool thread_is_running;
52 };
53 
54 } // namespace rmw_dds_common
55 
56 #endif // RMW_DDS_COMMON__CONTEXT_HPP_
rmw_dds_common::Context::gid
rmw_gid_t gid
Global ID of the Participant that the Context uses.
Definition: context.hpp:35
rmw_dds_common::Context::graph_guard_condition
rmw_guard_condition_t * graph_guard_condition
Guard condition that should be triggered when the graph changes.
Definition: context.hpp:51
rmw_dds_common::GraphCache
Graph cache data structure.
Definition: graph_cache.hpp:50
rmw_guard_condition_t
rmw_dds_common::Context
Definition: context.hpp:32
rmw_dds_common::Context::graph_cache
GraphCache graph_cache
Cached graph from discovery data.
Definition: context.hpp:41
rmw_dds_common::Context::thread_is_running
std::atomic_bool thread_is_running
Indicates if the listener thread is running.
Definition: context.hpp:47
rmw_dds_common::Context::listener_thread_gc
rmw_guard_condition_t * listener_thread_gc
Awakes listener thread when finishing the context.
Definition: context.hpp:49
rmw_subscription_t
rmw_dds_common::Context::listener_thread
std::thread listener_thread
Thread to listen to discovery data.
Definition: context.hpp:45
std::thread
rmw_dds_common::Context::node_update_mutex
std::mutex node_update_mutex
Mutex that should be locked when updating graph cache and publishing a graph message.
Definition: context.hpp:43
rmw_publisher_t
rmw_gid_t
std::mutex
rmw_dds_common::Context::sub
rmw_subscription_t * sub
Subscriber used to listen to ParticipantEntitiesInfo discovery data.
Definition: context.hpp:39
types.h
rmw_dds_common::Context::pub
rmw_publisher_t * pub
Publisher used to publish ParticipantEntitiesInfo discovery data.
Definition: context.hpp:37