hk239 commited on
Commit
ca6f001
·
verified ·
1 Parent(s): aa9b27c

Upload third-party source (skip LFS pointer assets) (part 7)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TContentFilteredTopic.hpp +160 -0
  2. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TFilter.hpp +186 -0
  3. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TMultiTopic.hpp +74 -0
  4. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TTopic.hpp +429 -0
  5. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TTopicDescription.hpp +85 -0
  6. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/Topic.hpp +41 -0
  7. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TopicDescription.hpp +33 -0
  8. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TopicInstance.hpp +116 -0
  9. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TopicListener.hpp +144 -0
  10. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TopicTraits.hpp +92 -0
  11. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/ddstopic.hpp +31 -0
  12. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/AnyTopic.hpp +30 -0
  13. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/BuiltinTopic.hpp +46 -0
  14. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/BuiltinTopicKey.hpp +29 -0
  15. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/ContentFilteredTopic.hpp +470 -0
  16. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/Filter.hpp +25 -0
  17. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/MultiTopic.hpp +135 -0
  18. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TAnyTopicImpl.hpp +73 -0
  19. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TBuiltinTopicImpl.hpp +580 -0
  20. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TBuiltinTopicKeyImpl.hpp +48 -0
  21. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TContentFilteredTopicImpl.hpp +77 -0
  22. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TFilterImpl.hpp +105 -0
  23. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TTopicDescriptionImpl.hpp +54 -0
  24. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TTopicImpl.hpp +395 -0
  25. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/Topic.hpp +131 -0
  26. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TopicDescription.hpp +30 -0
  27. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TopicInstanceImpl.hpp +83 -0
  28. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/ddstopic.hpp +20 -0
  29. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/discovery.hpp +100 -0
  30. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/find.hpp +46 -0
  31. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/discovery.hpp +153 -0
  32. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/find.hpp +53 -0
  33. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/qos/TopicQos.hpp +36 -0
  34. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/qos/detail/TopicQos.hpp +93 -0
  35. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/ForwardDeclarations.hpp +120 -0
  36. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/DDScObjectDelegate.hpp +74 -0
  37. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/EntityDelegate.hpp +140 -0
  38. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/EntityRegistry.hpp +95 -0
  39. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/EntitySet.hpp +94 -0
  40. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/InstanceHandleDelegate.hpp +71 -0
  41. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ListenerDispatcher.hpp +57 -0
  42. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/MiscUtils.hpp +90 -0
  43. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/Missing.hpp +36 -0
  44. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/Mutex.hpp +51 -0
  45. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ObjectDelegate.hpp +71 -0
  46. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ObjectSet.hpp +80 -0
  47. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/QosProviderDelegate.hpp +81 -0
  48. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ReportUtils.hpp +191 -0
  49. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ScopedLock.hpp +103 -0
  50. third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/TimeHelper.hpp +91 -0
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TContentFilteredTopic.hpp ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_T_TOPIC_CONTENT_FILTERED_TOPIC_HPP_
2
+ #define OMG_DDS_T_TOPIC_CONTENT_FILTERED_TOPIC_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Inc.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <vector>
23
+
24
+ #include <dds/core/detail/conformance.hpp>
25
+ #include <dds/core/types.hpp>
26
+ #include <dds/topic/Topic.hpp>
27
+ #include <dds/topic/Filter.hpp>
28
+
29
+ #ifdef OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT
30
+
31
+ namespace dds
32
+ {
33
+ namespace topic
34
+ {
35
+ template <typename T, template <typename Q> class DELEGATE>
36
+ class ContentFilteredTopic;
37
+ }
38
+ }
39
+
40
+
41
+ /**
42
+ * @brief
43
+ * ContentFilteredTopic is a specialization of TopicDescription that allows
44
+ * for content-based subscriptions.
45
+ *
46
+ * ContentFilteredTopic describes a more sophisticated subscription which
47
+ * indicates that the Subscriber does not necessarily want to see all values of each
48
+ * instance published under the Topic. Rather, it only wants to see the values whose
49
+ * contents satisfy certain criteria. Therefore this class must be used to request
50
+ * content-based subscriptions.
51
+ *
52
+ * The selection of the content is done using the SQL based filter with parameters to
53
+ * adapt the filter clause.
54
+ *
55
+ * <b><i>Example</i></b>
56
+ * @code{.cpp}
57
+ * // Default creation of a Topic
58
+ * dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
59
+ * dds::topic::Topic<Foo::Bar> topic(participant, "TopicName");
60
+ *
61
+ * // Creation of a ContentFilteredTopic (assume Foo::Bar contains long_1 element).
62
+ * std::vector<std::string> params;
63
+ * params.push_back("1");
64
+ * dds::topic::Filter filter("long_1=%0", params);
65
+ * dds::topic::ContentFilteredTopic<Foo::Bar> cfTopic(topic,
66
+ * "ContentFilteredTopicName",
67
+ * filter);
68
+ *
69
+ * // The ContentFilteredTopic can be used to create readers
70
+ * dds::sub::Subscriber subscriber(participant);
71
+ * dds::sub::DataReader<Foo::Bar> reader(subscriber, cfTopic);
72
+ * @endcode
73
+ *
74
+ * @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
75
+ */
76
+ template <typename T, template <typename Q> class DELEGATE>
77
+ class dds::topic::ContentFilteredTopic : public dds::topic::TTopicDescription< DELEGATE<T> >
78
+ {
79
+ public:
80
+ OMG_DDS_REF_TYPE_PROTECTED_DC_T(ContentFilteredTopic, dds::topic::TTopicDescription, T, DELEGATE)
81
+ OMG_DDS_IMPLICIT_REF_BASE(ContentFilteredTopic)
82
+
83
+ /**
84
+ * Convenience typedef for the type of the data sample.
85
+ */
86
+ typedef T DataType;
87
+
88
+ public:
89
+ /**
90
+ * Creates a ContentFilteredTopic be used as to perform content-based
91
+ * subscriptions.
92
+ *
93
+ * The ContentFilteredTopic only relates to samples published under that
94
+ * Topic, filtered according to their content. The filtering is done by
95
+ * means of evaluating a logical expression that involves the values of
96
+ * some of the data-fields in the sample.
97
+ *
98
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
99
+ *
100
+ * @param topic the related Topic
101
+ * @param name the name of the ContentFilteredTopic
102
+ * @param filter the filter expression
103
+ * @throw dds::core::Exception
104
+ */
105
+ ContentFilteredTopic(const Topic<T>& topic, const std::string& name, const dds::topic::Filter& filter);
106
+
107
+ /** @cond */
108
+ virtual ~ContentFilteredTopic();
109
+ /** @endcond */
110
+
111
+ public:
112
+ /**
113
+ * Get the filter expression.
114
+ *
115
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
116
+ *
117
+ * @return the filter expression
118
+ */
119
+ const std::string& filter_expression() const;
120
+
121
+ /**
122
+ * Get the filter expression parameters.
123
+ *
124
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
125
+ *
126
+ * @return the filter parameters as a sequence
127
+ */
128
+ const dds::core::StringSeq filter_parameters() const;
129
+
130
+ /**
131
+ * Sets the query parameters.
132
+ *
133
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
134
+ *
135
+ * @param begin Iterator pointing to the beginning of the parameters to set
136
+ * @param end Iterator pointing to the end of the parameters to set
137
+ * @throws dds::core::Error
138
+ * An internal error has occurred.
139
+ * @throws dds::core::NullReferenceError
140
+ * The entity was not properly created and references to dds::core::null.
141
+ */
142
+ template <typename FWDIterator>
143
+ void filter_parameters(const FWDIterator& begin, const FWDIterator& end);
144
+
145
+ /**
146
+ * Return the associated Topic.
147
+ *
148
+ * @return the Topic
149
+ * @throws dds::core::Error
150
+ * An internal error has occurred.
151
+ * @throws dds::core::NullReferenceError
152
+ * The entity was not properly created and references to dds::core::null.
153
+ */
154
+ const dds::topic::Topic<T>& topic() const;
155
+ };
156
+
157
+ #endif // OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT
158
+
159
+
160
+ #endif /* OMG_DDS_T_TOPIC_CONTENT_FILTERED_TOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TFilter.hpp ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef DDS_TOPIC_TFILTER__HPP_
2
+ #define DDS_TOPIC_TFILTER__HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/core/types.hpp>
23
+ #include <dds/core/Value.hpp>
24
+
25
+ namespace dds
26
+ {
27
+ namespace topic
28
+ {
29
+ template <typename D>
30
+ class TFilter;
31
+ }
32
+ }
33
+
34
+ /**
35
+ * @brief
36
+ * Filter objects contain SQL expressions that allow the application to specify
37
+ * a filter on the locally available data.
38
+ *
39
+ * A Filter is used to create a ContentFilteredTopic.
40
+ *
41
+ * @anchor anchor_dds_topic_filter_expression
42
+ * \par SQL Expression
43
+ * The SQL query string is set by expression which must be a subset of the
44
+ * SQL query language. In this query expression, parameters may be used, which must
45
+ * be set in the sequence of strings defined by the parameter query_parameters. A
46
+ * parameter is a string which can define an integer, float, string or enumeration. The
47
+ * number of values in query_parameters must be equal or greater than the highest
48
+ * referenced %n token in the query_expression (e.g. if %1 and %8 are used as
49
+ * parameters in the query_expression, the query_parameters should at least
50
+ * contain n+1 = 9 values).<br>
51
+ * Look @ref DCPS_Queries_and_Filters "here" for the specific query expression syntax.
52
+ *
53
+ * @see dds::topic::ContentFilteredTopic
54
+ * @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
55
+ */
56
+ template <typename D>
57
+ class dds::topic::TFilter: public dds::core::Value<D>
58
+ {
59
+ public:
60
+ /**
61
+ * Iterator for the query expression parameters.
62
+ */
63
+ typedef typename D::iterator iterator;
64
+
65
+ /**
66
+ * Iterator for the query expression parameters.
67
+ */
68
+ typedef typename D::const_iterator const_iterator;
69
+
70
+ public:
71
+ /**
72
+ * Create a Filter based on a query expression.
73
+ *
74
+ * @param query_expression an @ref anchor_dds_topic_filter_expression "SQL expression"
75
+ * @throw dds::core::Exception
76
+ */
77
+ TFilter(const std::string& query_expression);
78
+
79
+ /**
80
+ * Create a Filter based on a query expression and an iterable parameter container.
81
+ *
82
+ * @param query_expression an @ref anchor_dds_topic_filter_expression "SQL expression"
83
+ * @param params_begin Iterator pointing to the beginning of the parameters to set
84
+ * @param params_end Iterator pointing to the end of the parameters to set
85
+ * @throw dds::core::Exception
86
+ */
87
+ template <typename FWIterator>
88
+ TFilter(const std::string& query_expression, const FWIterator& params_begin,
89
+ const FWIterator& params_end);
90
+
91
+ /**
92
+ * Create a Filter based on a query expression and parameter vector.
93
+ *
94
+ * @param query_expression an @ref anchor_dds_topic_filter_expression "SQL expression"
95
+ * @param params Vector containing SQL expression parameters
96
+ * @throw dds::core::Exception
97
+ */
98
+ TFilter(const std::string& query_expression,
99
+ const std::vector<std::string>& params);
100
+
101
+ /**
102
+ * Get the query expression.
103
+ *
104
+ * @return std::string The @ref anchor_dds_topic_filter_expression "SQL expression".
105
+ * @throw dds::core::Exception
106
+ */
107
+ const std::string& expression() const;
108
+
109
+ /**
110
+ * Provides the begin iterator to the SQL expression parameter list.
111
+ *
112
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
113
+ *
114
+ * @return dds::topic::Filter::const_iterator
115
+ * The begin iterator
116
+ * @throw dds::core::Exception
117
+ */
118
+ const_iterator begin() const;
119
+
120
+ /**
121
+ * The end iterator to the SQL expression parameter list.
122
+ *
123
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
124
+ *
125
+ * @return dds::topic::Filter::const_iterator
126
+ * The end iterator
127
+ * @throw dds::core::Exception
128
+ */
129
+ const_iterator end() const;
130
+
131
+ /**
132
+ * Provides the begin iterator to the SQL expression parameter list.
133
+ *
134
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
135
+ *
136
+ * @return dds::topic::Filter::iterator
137
+ * The begin iterator
138
+ * @throw dds::core::Exception
139
+ */
140
+ iterator begin();
141
+
142
+ /**
143
+ * The end iterator to the SQL expression parameter list.
144
+ *
145
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
146
+ *
147
+ * @return dds::topic::Filter::iterator
148
+ * The end iterator
149
+ * @throw dds::core::Exception
150
+ */
151
+ iterator end();
152
+
153
+ /**
154
+ * Sets the query parameters.
155
+ *
156
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
157
+ *
158
+ * @param begin Iterator pointing to the beginning of the parameters to set
159
+ * @param end Iterator pointing to the end of the parameters to set
160
+ * @throw dds::core::Exception
161
+ */
162
+ template <typename FWIterator>
163
+ void parameters(const FWIterator& begin, const FWIterator end);
164
+
165
+ /**
166
+ * Adds a parameter to the query.
167
+ *
168
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
169
+ *
170
+ * @param param The parameter to add
171
+ * @throw dds::core::Exception
172
+ */
173
+ void add_parameter(const std::string& param);
174
+
175
+ /**
176
+ * Gets the number of parameters in the query of the filter.
177
+ *
178
+ * See @ref anchor_dds_topic_filter_expression "SQL expression info"
179
+ *
180
+ * @return uint32_t The number of parameters in the query
181
+ * @throw dds::core::Exception
182
+ */
183
+ uint32_t parameters_length() const;
184
+ };
185
+
186
+ #endif /* DDS_TOPIC_TFILTER__HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TMultiTopic.hpp ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_T_TOPIC_MULTI_TOPIC_HPP_
2
+ #define OMG_DDS_T_TOPIC_MULTI_TOPIC_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Inc.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <vector>
23
+
24
+ #include <dds/core/detail/conformance.hpp>
25
+ #include <dds/core/types.hpp>
26
+ #include <dds/topic/TopicDescription.hpp>
27
+
28
+ namespace dds
29
+ {
30
+ namespace topic
31
+ {
32
+
33
+ #ifdef OMG_DDS_MULTI_TOPIC_SUPPORT
34
+
35
+ /**
36
+ * <b><i>This operation is not yet implemented. It is scheduled for a future release.</i></b>
37
+ *
38
+ * @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
39
+ */
40
+ template <typename T, template <typename Q> class DELEGATE>
41
+ class MultiTopic : public TTopicDescription< DELEGATE<T> >
42
+ {
43
+ public:
44
+ OMG_DDS_REF_TYPE_PROTECTED_DC_T(MultiTopic, dds::topic::TTopicDescription, T, DELEGATE)
45
+ OMG_DDS_IMPLICIT_REF_BASE(MultiTopic)
46
+
47
+ public:
48
+ template <typename FWDIterator>
49
+ MultiTopic(const dds::domain::DomainParticipant& dp,
50
+ const std::string& name,
51
+ const std::string expression,
52
+ const FWDIterator& params_begin,
53
+ const FWDIterator& params_end);
54
+
55
+ virtual ~MultiTopic();
56
+
57
+ public:
58
+ const std::string expression() const;
59
+
60
+ template <typename FWDIterator>
61
+ void expression_parameters(const FWDIterator& params_begin,
62
+ const FWDIterator& params_end);
63
+
64
+ dds::core::StringSeq void expression_parameters() const;
65
+
66
+ };
67
+
68
+ #endif // OMG_DDS_MULTI_TOPIC_SUPPORT
69
+
70
+ }
71
+ }
72
+
73
+
74
+ #endif /* OMG_DDS_T_TOPIC_CONTENT_FILTERED_TOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TTopic.hpp ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TTOPIC_TOPIC_HPP_
2
+ #define OMG_DDS_TTOPIC_TOPIC_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/core/conformance.hpp>
23
+ #include <dds/core/types.hpp>
24
+ #include <dds/core/ref_traits.hpp>
25
+ #include <dds/domain/DomainParticipant.hpp>
26
+ #include <dds/topic/qos/TopicQos.hpp>
27
+ #include <dds/topic/TopicDescription.hpp>
28
+ #include <dds/topic/AnyTopic.hpp>
29
+
30
+
31
+ namespace dds
32
+ {
33
+ namespace topic
34
+ {
35
+ template <typename T, template <typename Q> class DELEGATE>
36
+ class Topic;
37
+
38
+ template <typename T>
39
+ class TopicListener;
40
+ }
41
+ }
42
+
43
+
44
+ /**
45
+ * @brief
46
+ * Topic is the most basic description of the data to be published and
47
+ * subscribed.
48
+ *
49
+ * A Topic is identified by its name, which must be unique in the whole Domain.
50
+ * In addition (by virtue of extending TopicDescription) it fully specifies the
51
+ * type of the data that can be communicated when publishing or subscribing to
52
+ * the Topic.
53
+ *
54
+ * Topic is the only TopicDescription that can be used for publications and
55
+ * therefore associated with a DataWriter.
56
+ *
57
+ * <b><i>Example</i></b>
58
+ * @code{.cpp}
59
+ * // Default creation of a Topic
60
+ * dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
61
+ * dds::topic::Topic<Foo::Bar> topic(participant, "TopicName");
62
+ *
63
+ * // The Topic can be used to create readers and writers
64
+ * // DataReader
65
+ * dds::sub::Subscriber subscriber(participant);
66
+ * dds::sub::DataReader<Foo::Bar> reader(subscriber, topic);
67
+ * // DataWriter
68
+ * dds::pub::Publisher publisher(participant);
69
+ * dds::pub::DataWriter<Foo::Bar> writer(publisher, topic);
70
+ * @endcode
71
+ *
72
+ * @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
73
+ */
74
+ template <typename T, template <typename Q> class DELEGATE>
75
+ class dds::topic::Topic : public dds::topic::TAnyTopic< DELEGATE<T> >
76
+ {
77
+ public:
78
+ /**
79
+ * Convenience typedef for the type of the data sample.
80
+ */
81
+ typedef T DataType;
82
+
83
+ /**
84
+ * Local convenience typedef for dds::topic::TopicListener.
85
+ */
86
+ typedef TopicListener<T> Listener;
87
+
88
+ public:
89
+ OMG_DDS_REF_TYPE_PROTECTED_DC_T(Topic, ::dds::topic::TAnyTopic, T, DELEGATE)
90
+ OMG_DDS_IMPLICIT_REF_BASE(Topic)
91
+ OMG_DDS_COMPLETE_RULE_OF_FIVE_VIRTUAL_DEFAULT(Topic)
92
+
93
+ public:
94
+
95
+ /**
96
+ * Create a new Topic.
97
+ *
98
+ * This operation creates a reference to a new or existing Topic under the given name,
99
+ * for a specific data type.
100
+ *
101
+ * <i>QoS</i><br>
102
+ * The Topic will be created with the QoS values specified on the last
103
+ * successful call to @link dds::domain::DomainParticipant::default_topic_qos(const ::dds::topic::qos::TopicQos& qos)
104
+ * dp.default_topic_qos(qos) @endlink or, if the call was never made, the
105
+ * @ref anchor_dds_topic_qos_defaults "default" values.
106
+ *
107
+ * <i>Existing Topic Name</i><br>
108
+ * Before creating a new Topic, this operation performs a
109
+ * lookup_topicdescription for the specified topic_name. When a Topic is
110
+ * found with the same name in the current domain, the QoS and type_name of the
111
+ * found Topic are matched against the parameters qos and type_name. When they
112
+ * are the same, no Topic is created but a new proxy of the existing Topic is returned.
113
+ * When they are not exactly the same, no Topic is created and dds::core::Error is thrown.
114
+ *
115
+ * <i>Local Proxy</i><br>
116
+ * Since a Topic is a global concept in the system, access is provided through a local
117
+ * proxy. In other words, the reference returned is actually not a reference to a Topic
118
+ * but to a locally created proxy. The Data Distribution Service propagates Topics
119
+ * and makes remotely created Topics locally available through this proxy. The deletion
120
+ * of a Topic object will not delete the Topic from the domain, just the local proxy is
121
+ * deleted.
122
+ *
123
+ * @param dp the domain participant on which the topic will be defined
124
+ * @param topic_name the name of the Topic to be created
125
+ * @throws dds::core::Error
126
+ * A other Topic with the same name but different type or QoS was
127
+ * detected in the current domain or another internal error has occurred.
128
+ * @throws dds::core::OutOfResourcesError
129
+ * The Data Distribution Service ran out of resources to
130
+ * complete this operation.
131
+ */
132
+ Topic(const dds::domain::DomainParticipant& dp,
133
+ const std::string& topic_name);
134
+
135
+ /**
136
+ * Create a new Topic.
137
+ *
138
+ * This operation creates a reference to a new or existing Topic under the given name,
139
+ * for a specific data type and type_name.
140
+ *
141
+ * <i>QoS</i><br>
142
+ * The Topic will be created with the QoS values specified on the last
143
+ * successful call to @link dds::domain::DomainParticipant::default_topic_qos(const ::dds::topic::qos::TopicQos& qos)
144
+ * dp.default_topic_qos(qos) @endlink or, if the call was never made, the
145
+ * @ref anchor_dds_topic_qos_defaults "default" values.
146
+ *
147
+ * <i>Existing Topic Name</i><br>
148
+ * Before creating a new Topic, this operation performs a
149
+ * lookup_topicdescription for the specified topic_name. When a Topic is
150
+ * found with the same name in the current domain, the QoS and type_name of the
151
+ * found Topic are matched against the parameters qos and type_name. When they
152
+ * are the same, no Topic is created but a new proxy of the existing Topic is returned.
153
+ * When they are not exactly the same, no Topic is created and dds::core::Error is thrown.
154
+ *
155
+ * <i>Local Proxy</i><br>
156
+ * Since a Topic is a global concept in the system, access is provided through a local
157
+ * proxy. In other words, the reference returned is actually not a reference to a Topic
158
+ * but to a locally created proxy. The Data Distribution Service propagates Topics
159
+ * and makes remotely created Topics locally available through this proxy. The deletion
160
+ * of a Topic object will not delete the Topic from the domain, just the local proxy is
161
+ * deleted.
162
+ *
163
+ * @param dp the domain participant on which the topic will be defined
164
+ * @param topic_name the topic's name
165
+ * @param type_name a local alias of the data type
166
+ * @throws dds::core::Error
167
+ * A other Topic with the same name but different type or QoS was
168
+ * detected in the current domain or another internal error has occurred.
169
+ * @throws dds::core::OutOfResourcesError
170
+ * The Data Distribution Service ran out of resources to
171
+ * complete this operation.
172
+ */
173
+ Topic(const dds::domain::DomainParticipant& dp,
174
+ const std::string& topic_name,
175
+ const std::string& type_name);
176
+
177
+ /**
178
+ * Create a new Topic.
179
+ *
180
+ * This operation creates a reference to a new or existing Topic under the given name,
181
+ * for a specific data type.
182
+ *
183
+ * <i>QoS</i><br>
184
+ * A possible application pattern to construct the TopicQos for the
185
+ * Topic is to:
186
+ * @code{.cpp}
187
+ * // 1) Retrieve the QosPolicy settings on the associated DomainParticipant
188
+ * dds::topic::qos::TopicQos topicQos = participant.default_datareader_qos();
189
+ * // 2) Selectively modify QosPolicy settings as desired.
190
+ * topicQos << dds::core::policy::Durability::Transient();
191
+ * // 3) Use the resulting QoS to construct the DataReader.
192
+ * dds::topic::Topic<Foo::Bar> topic(participant, "TopicName", topicQos);
193
+ * @endcode
194
+ *
195
+ * <i>Existing Topic Name</i><br>
196
+ * Before creating a new Topic, this operation performs a
197
+ * lookup_topicdescription for the specified topic_name. When a Topic is
198
+ * found with the same name in the current domain, the QoS and type_name of the
199
+ * found Topic are matched against the parameters qos and type_name. When they
200
+ * are the same, no Topic is created but a new proxy of the existing Topic is returned.
201
+ * When they are not exactly the same, no Topic is created and dds::core::Error is thrown.
202
+ *
203
+ * <i>Local Proxy</i><br>
204
+ * Since a Topic is a global concept in the system, access is provided through a local
205
+ * proxy. In other words, the reference returned is actually not a reference to a Topic
206
+ * but to a locally created proxy. The Data Distribution Service propagates Topics
207
+ * and makes remotely created Topics locally available through this proxy. The deletion
208
+ * of a Topic object will not delete the Topic from the domain, just the local proxy is
209
+ * deleted.
210
+ *
211
+ * <i>Listener</i><br>
212
+ * The following statuses are applicable to the TopicListener:
213
+ * - dds::core::status::StatusMask::inconsistent_topic()
214
+ *
215
+ * See @ref DCPS_Modules_Infrastructure_Listener "listener concept",
216
+ * @ref anchor_dds_topic_listener_commstatus "communication status" and
217
+ * @ref anchor_dds_topic_listener_commpropagation "communication propagation"
218
+ * for more information.
219
+ *
220
+ * @param dp the domain participant on which the topic will be defined
221
+ * @param topic_name the topic's name
222
+ * @param qos the topic listener
223
+ * @param listener the topic listener
224
+ * @param mask the listener event mask
225
+ * @throws dds::core::Error
226
+ * A other Topic with the same name but different type or QoS was
227
+ * detected in the current domain or another internal error has occurred.
228
+ * @throws dds::core::OutOfResourcesError
229
+ * The Data Distribution Service ran out of resources to
230
+ * complete this operation.
231
+ */
232
+ Topic(const dds::domain::DomainParticipant& dp,
233
+ const std::string& topic_name,
234
+ const dds::topic::qos::TopicQos& qos,
235
+ dds::topic::TopicListener<T>* listener = NULL,
236
+ const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none());
237
+
238
+ /**
239
+ * Create a new Topic.
240
+ *
241
+ * This operation creates a reference to a new or existing Topic under the given name,
242
+ * for a specific data type and type_name.
243
+ *
244
+ * <i>QoS</i><br>
245
+ * A possible application pattern to construct the TopicQos for the
246
+ * Topic is to:
247
+ * @code{.cpp}
248
+ * // 1) Retrieve the QosPolicy settings on the associated DomainParticipant
249
+ * dds::topic::qos::TopicQos topicQos = participant.default_datareader_qos();
250
+ * // 2) Selectively modify QosPolicy settings as desired.
251
+ * topicQos << dds::core::policy::Durability::Transient();
252
+ * // 3) Use the resulting QoS to construct the DataReader.
253
+ * dds::topic::Topic<Foo::Bar> topic(participant, "TopicName", "TypeName", topicQos);
254
+ * @endcode
255
+ *
256
+ * <i>Existing Topic Name</i><br>
257
+ * Before creating a new Topic, this operation performs a
258
+ * lookup_topicdescription for the specified topic_name. When a Topic is
259
+ * found with the same name in the current domain, the QoS and type_name of the
260
+ * found Topic are matched against the parameters qos and type_name. When they
261
+ * are the same, no Topic is created but a new proxy of the existing Topic is returned.
262
+ * When they are not exactly the same, no Topic is created and dds::core::Error is thrown.
263
+ *
264
+ * <i>Local Proxy</i><br>
265
+ * Since a Topic is a global concept in the system, access is provided through a local
266
+ * proxy. In other words, the reference returned is actually not a reference to a Topic
267
+ * but to a locally created proxy. The Data Distribution Service propagates Topics
268
+ * and makes remotely created Topics locally available through this proxy. The deletion
269
+ * of a Topic object will not delete the Topic from the domain, just the local proxy is
270
+ * deleted.
271
+ *
272
+ * <i>Listener</i><br>
273
+ * The following statuses are applicable to the TopicListener:
274
+ * - dds::core::status::StatusMask::inconsistent_topic()
275
+ *
276
+ * See @ref DCPS_Modules_Infrastructure_Listener "listener concept",
277
+ * @ref anchor_dds_topic_listener_commstatus "communication status" and
278
+ * @ref anchor_dds_topic_listener_commpropagation "communication propagation"
279
+ * for more information.
280
+ *
281
+ * @param dp the domain participant on which the topic will be defined
282
+ * @param topic_name the topic's name
283
+ * @param type_name a local alias of the data type
284
+ * @param qos the topic listener
285
+ * @param listener the topic listener
286
+ * @param mask the listener event mask
287
+ * @throws dds::core::Error
288
+ * A other Topic with the same name but different type or QoS was
289
+ * detected in the current domain or another internal error has occurred.
290
+ * @throws dds::core::OutOfResourcesError
291
+ * The Data Distribution Service ran out of resources to
292
+ * complete this operation.
293
+ */
294
+ Topic(const dds::domain::DomainParticipant& dp,
295
+ const std::string& topic_name,
296
+ const std::string& type_name,
297
+ const dds::topic::qos::TopicQos& qos,
298
+ dds::topic::TopicListener<T>* listener = NULL,
299
+ const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none());
300
+
301
+ #if defined (OMG_DDS_X_TYPE_DYNAMIC_TYPES_SUPPORT)
302
+ /**
303
+ * Create a new topic with a dynamic type description. Notice that in this
304
+ * case the data type has to be DynamicData, so the Topic type will be
305
+ * Topic<DynamicData>.
306
+ *
307
+ * @param dp the domain participant on which the topic will be defined
308
+ * @param topic_name the topic's name. The QoS will be set to
309
+ * dp.default_topic_qos().
310
+ * @param type the topic type
311
+ * @throws dds::core::Error
312
+ * A other Topic with the same name but different type or QoS was
313
+ * detected in the current domain or another internal error has occurred.
314
+ * @throws dds::core::OutOfResourcesError
315
+ * The Data Distribution Service ran out of resources to
316
+ * complete this operation.
317
+ */
318
+ Topic(const dds::domain::DomainParticipant& dp,
319
+ const std::string& topic_name,
320
+ const dds::core::xtypes::DynamicType type);
321
+
322
+ /**
323
+ * Create a new topic with a dynamic type description. Notice that in this
324
+ * case the data type has to be DynamicData, so the Topic type will be
325
+ * Topic<DynamicData>.
326
+ *
327
+ * @param dp the domain participant on which the topic will be defined
328
+ * @param topic_name the topic's name
329
+ * @param type the topic type
330
+ * @param qos the topic listener
331
+ * @param listener the topic listener
332
+ * @param mask the listener event mask
333
+ * @throws dds::core::Error
334
+ * A other Topic with the same name but different type or QoS was
335
+ * detected in the current domain or another internal error has occurred.
336
+ * @throws dds::core::OutOfResourcesError
337
+ * The Data Distribution Service ran out of resources to
338
+ * complete this operation.
339
+ */
340
+ Topic(const dds::domain::DomainParticipant& dp,
341
+ const std::string& topic_name,
342
+ const dds::core::xtypes::DynamicType type
343
+ const dds::topic::qos::TopicQos& qos,
344
+ dds::topic::TopicListener<T>* listener = NULL,
345
+ const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none());
346
+
347
+ #endif /* OMG_DDS_X_TYPE_DYNAMIC_TYPES_SUPPORT */
348
+
349
+ public:
350
+ /**
351
+ * Register a listener with the Topic.
352
+ *
353
+ * This operation attaches a TopicListener to the Topic. Only one
354
+ * TopicListener can be attached to each Topic. If a
355
+ * TopicListener was already attached, the operation will replace it with the
356
+ * new one. When the listener is the NULL pointer, it represents a listener that is
357
+ * treated as a NOOP for all statuses activated in the bit mask.
358
+ *
359
+ * Listener un-registration is performed by setting the listener to NULL and mask none().
360
+ *
361
+ * @anchor anchor_dds_topic_listener_commstatus
362
+ * <i>Communication Status</i><br>
363
+ * For each communication status, the StatusChangedFlag flag is initially set to
364
+ * FALSE. It becomes TRUE whenever that communication status changes. For each
365
+ * communication status activated in the mask, the associated TopicListener
366
+ * operation is invoked and the communication status is reset to FALSE, as the listener
367
+ * implicitly accesses the status which is passed as a parameter to that operation. The
368
+ * status is reset prior to calling the listener, so if the application calls the
369
+ * get_<status_name>_status from inside the listener it will see the status
370
+ * already reset. An exception to this rule is the NULL listener, which does not reset the
371
+ * communication statuses for which it is invoked.
372
+ *
373
+ * The following statuses are applicable to the TopicListener:
374
+ * - dds::core::status::StatusMask::inconsistent_topic()
375
+ *
376
+ * Status bits are declared as a constant and can be used by the application in an OR
377
+ * operation to create a tailored mask. The special constant dds::core::status::StatusMask::none()
378
+ * can be used to indicate that the created entity should not respond to any of its available
379
+ * statuses. The DDS will therefore attempt to propagate these statuses to its factory.
380
+ * The special constant dds::core::status::StatusMask::all() can be used to select all applicable
381
+ * statuses specified in the “Data Distribution Service for Real-time Systems Version
382
+ * 1.2” specification which are applicable to the PublisherListener.
383
+ *
384
+ * @anchor anchor_dds_topic_listener_commpropagation
385
+ * <i>Status Propagation</i><br>
386
+ * In case a communication status is not activated in the mask of the
387
+ * TopicListener, the DomainParticipantListener of the containing DomainParticipant
388
+ * is invoked (if attached and activated for the status that occurred). This allows the
389
+ * application to set a default behaviour in the DomainParticipantListener of the containing
390
+ * DomainParticipant and a Topic specific behaviour when needed. In case the
391
+ * communication status is not activated in the mask of the DomainParticipantListener as
392
+ * well, the application is not notified of the change.
393
+ *
394
+ * See also @ref DCPS_Modules_Infrastructure_Listener "listener information".
395
+ *
396
+ * @param listener the listener
397
+ * @param event_mask the mask defining the events for which the listener
398
+ * will be notified.
399
+ * @throws dds::core::Error
400
+ * An internal error has occurred.
401
+ * @throws dds::core::NullReferenceError
402
+ * The entity was not properly created and references to dds::core::null.
403
+ * @throws dds::core::AlreadyClosedError
404
+ * The entity has already been closed.
405
+ * @throws dds::core::UnsupportedError
406
+ * A status was selected that cannot be supported because
407
+ * the infrastructure does not maintain the required connectivity information.
408
+ * @throws dds::core::OutOfResourcesError
409
+ * The Data Distribution Service ran out of resources to
410
+ * complete this operation.
411
+ */
412
+ void listener(Listener* listener,
413
+ const ::dds::core::status::StatusMask& event_mask);
414
+
415
+ /**
416
+ * Get the listener of this Topic.
417
+ *
418
+ * See also @ref DCPS_Modules_Infrastructure_Listener "listener information".
419
+ *
420
+ * @return the listener
421
+ * @throws dds::core::NullReferenceError
422
+ * The entity was not properly created and references to dds::core::null.
423
+ */
424
+ Listener* listener() const;
425
+
426
+ };
427
+
428
+
429
+ #endif /* OMG_DDS_TTOPIC_TOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TTopicDescription.hpp ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_T_TOPIC_TOPIC_DESCRIPTION_HPP_
2
+ #define OMG_DDS_T_TOPIC_TOPIC_DESCRIPTION_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/core/TEntity.hpp>
23
+ #include <dds/topic/TopicTraits.hpp>
24
+ #include <dds/domain/DomainParticipant.hpp>
25
+
26
+ namespace dds
27
+ {
28
+ namespace topic
29
+ {
30
+ template <typename DELEGATE>
31
+ class TTopicDescription;
32
+ }
33
+ }
34
+
35
+
36
+ /**
37
+ * @brief
38
+ * This class is the base for Topic, ContentFilteredTopic and MultiTopic.
39
+ *
40
+ * The TopicDescription attribute type_name defines an unique data type that is
41
+ * made available to the Data Distribution Service when a Topic is created with
42
+ * that type.<br>
43
+ * TopicDescription has also a name that allows it to be retrieved locally.
44
+ *
45
+ * @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
46
+ */
47
+ template <typename DELEGATE>
48
+ class dds::topic::TTopicDescription : public virtual dds::core::Reference<DELEGATE>
49
+ {
50
+ public:
51
+ OMG_DDS_REF_TYPE_PROTECTED_DC(TTopicDescription, dds::core::Reference, DELEGATE)
52
+ OMG_DDS_IMPLICIT_REF_BASE(TTopicDescription)
53
+ OMG_DDS_COMPLETE_RULE_OF_FIVE_VIRTUAL_EXPLICIT(TTopicDescription)
54
+
55
+ public:
56
+ /**
57
+ * This operation returns the name used to create the TopicDescription.
58
+ *
59
+ * @return the TopicDescription name
60
+ */
61
+ const std::string& name() const;
62
+
63
+ /**
64
+ * This operation returns the registered name of the data type associated
65
+ * with the TopicDescription.
66
+ *
67
+ * @return the type_name
68
+ */
69
+ const std::string& type_name() const;
70
+
71
+ /**
72
+ * This operation returns the DomainParticipant associated with the
73
+ * TopicDescription.
74
+ *
75
+ * Note that there is exactly one DomainParticipant associated with
76
+ * each TopicDescription.
77
+ *
78
+ * @return the DomainParticipant
79
+ */
80
+ const dds::domain::DomainParticipant& domain_participant() const;
81
+
82
+ };
83
+
84
+
85
+ #endif /* OMG_DDS_T_TOPIC_TOPIC_DESCRIPTION_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/Topic.hpp ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Copyright 2010, Object Management Group, Inc.
2
+ * Copyright 2010, PrismTech, Corp.
3
+ * Copyright 2010, Real-Time Innovations, Inc.
4
+ * All rights reserved.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ #ifndef OMG_DDS_TOPIC_TOPIC_HPP_
19
+ #define OMG_DDS_TOPIC_TOPIC_HPP_
20
+
21
+ #include <dds/topic/detail/Topic.hpp>
22
+
23
+ namespace dds
24
+ {
25
+ namespace topic
26
+ {
27
+ template <typename T, template <typename Q> class DELEGATE = dds::topic::detail::Topic>
28
+ class Topic;
29
+ }
30
+ }
31
+
32
+ /**
33
+ * @todo RTF Issue - moved include
34
+ * @note This include was moved here as MSVC appears to ignore any
35
+ * attempt to 're-declare' a template class with a default argument like:
36
+ * dds/pub/detail/DataWriter.hpp(54): error C2976: 'dds::topic::Topic' : too few template arguments
37
+ * dds/topic/TTopic.hpp(50) : see declaration of 'dds::topic::Topic'
38
+ */
39
+ #include <dds/topic/TTopic.hpp>
40
+
41
+ #endif /* OMG_DDS_TOPIC_TOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TopicDescription.hpp ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_TOPIC_DESCRIPTION_HPP_
2
+ #define OMG_DDS_TOPIC_TOPIC_DESCRIPTION_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Inc.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/topic/detail/TopicDescription.hpp>
23
+
24
+
25
+ namespace dds
26
+ {
27
+ namespace topic
28
+ {
29
+ typedef ::dds::topic::detail::TopicDescription TopicDescription;
30
+ }
31
+ }
32
+
33
+ #endif /* OMG_DDS_TOPIC_TOPIC_DESCRIPTION_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TopicInstance.hpp ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_TOPIC_INSTANCE_HPP_
2
+ #define OMG_DDS_TOPIC_TOPIC_INSTANCE_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/core/Time.hpp>
23
+ #include <dds/core/InstanceHandle.hpp>
24
+
25
+ namespace dds
26
+ {
27
+ namespace topic
28
+ {
29
+ template <typename T>
30
+ class TopicInstance;
31
+ }
32
+ }
33
+
34
+ /**
35
+ * @brief
36
+ * A TopicInstance encapsulates a dds::sub::Sample and its associated
37
+ * dds::core::InstanceHandle.
38
+ *
39
+ * @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
40
+ * @see for more information: @ref dds::sub::Sample
41
+ * @see for more information: @ref dds::core::InstanceHandle
42
+ */
43
+ template <typename T>
44
+ class dds::topic::TopicInstance
45
+ {
46
+ public:
47
+ /**
48
+ * Construct a TopicInstance.
49
+ */
50
+ TopicInstance();
51
+
52
+ /**
53
+ * Construct a TopicInstance with an InstanceHandle.
54
+ *
55
+ * @param h the InstanceHandle
56
+ */
57
+ explicit TopicInstance(const ::dds::core::InstanceHandle& h);
58
+
59
+ /**
60
+ * Construct a TopicInstance with an InstanceHandle and a sample type.
61
+ *
62
+ * @param h the InstanceHandle
63
+ * @param sample the <Type>
64
+ */
65
+ TopicInstance(const ::dds::core::InstanceHandle& h, const T& sample);
66
+
67
+ public:
68
+ /**
69
+ * Conversion operator to get the InstanceHandle.
70
+ *
71
+ * @return the InstanceHandle for the TopicInstance
72
+ */
73
+ operator const ::dds::core::InstanceHandle() const;
74
+
75
+ /**
76
+ * Get the InstanceHandle.
77
+ *
78
+ * @return the InstanceHandle for the TopicInstance
79
+ */
80
+ const ::dds::core::InstanceHandle handle() const;
81
+
82
+ /**
83
+ * Set the InstanceHandle.
84
+ *
85
+ * @param h the InstanceHandle to set to the TopicInstance
86
+ */
87
+ void handle(const ::dds::core::InstanceHandle& h);
88
+
89
+ /**
90
+ * Get the data sample
91
+ *
92
+ * @return the sample for the TopicInstance
93
+ */
94
+ const T& sample() const;
95
+
96
+ /**
97
+ * Get the data sample
98
+ *
99
+ * @return the sample for the TopicInstance
100
+ */
101
+ T& sample();
102
+
103
+ /**
104
+ * Set the data sample
105
+ *
106
+ * @param sample send a sample for this TopicInstance
107
+ */
108
+ void sample(const T& sample);
109
+
110
+ private:
111
+ ::dds::core::InstanceHandle h_;
112
+ T sample_;
113
+ };
114
+
115
+
116
+ #endif /* OMG_DDS_TOPIC_TOPIC_INSTANCE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TopicListener.hpp ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_TOPIC_LISTENER_HPP_
2
+ #define OMG_DDS_TOPIC_TOPIC_LISTENER_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include "dds/topic/Topic.hpp"
23
+
24
+ namespace dds
25
+ {
26
+ namespace topic
27
+ {
28
+
29
+ /**
30
+ * @brief
31
+ * Topic events Listener
32
+ *
33
+ * Since a Topic is an Entity, it has the ability to have a Listener
34
+ * associated with it. In this case, the associated Listener should be of type
35
+ * TopicListener. This interface must be implemented by the
36
+ * application. A user-defined class must be provided by the application which must
37
+ * extend from the TopicListener class.
38
+ *
39
+ * <b><i>
40
+ * All operations for this interface must be implemented in the user-defined class, it is
41
+ * up to the application whether an operation is empty or contains some functionality.
42
+ * </i></b>
43
+ *
44
+ * The TopicListener provides a generic mechanism (actually a
45
+ * callback function) for the Data Distribution Service to notify the application of
46
+ * relevant asynchronous status change events, such as a missed deadline, violation of
47
+ * a QosPolicy setting, etc. The TopicListener is related to
48
+ * changes in communication status StatusConditions.
49
+ *
50
+ * @code{.cpp}
51
+ * // Application example listener
52
+ * class ExampleListener :
53
+ * public virtual dds::topic::TopicListener<Foo::Bar>
54
+ * {
55
+ * public:
56
+ * virtual void on_inconsistent_topic (
57
+ * dds::topic::Topic<Foo::Bar>& topic,
58
+ * const dds::core::status::InconsistentTopicStatus& status)
59
+ * {
60
+ * std::cout << "on_inconsistent_topic" << std::endl;
61
+ * }
62
+ * };
63
+ *
64
+ * // Create Topic with the listener
65
+ * dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
66
+ * dds::topic::Topic<Foo::Bar> topic(participant,
67
+ * "TopicName",
68
+ * participant.default_topic_qos(),
69
+ * new ExampleListener(),
70
+ * dds::core::status::StatusMask::all());
71
+ *
72
+ * @endcode
73
+ *
74
+ * @see for more information: @ref DCPS_Modules_Topic "Topic"
75
+ * @see for more information: @ref DCPS_Modules_Infrastructure_Listener "Listener information"
76
+ */
77
+ template <typename T>
78
+ class TopicListener
79
+ {
80
+ public:
81
+ /** @cond */
82
+ virtual ~TopicListener() { }
83
+ /** @endcond */
84
+
85
+ public:
86
+ /**
87
+ * This operation is called by the Data Distribution Service when the
88
+ * InconsistentTopicStatus changes.
89
+ *
90
+ * The implementation may be left empty
91
+ * when this functionality is not needed. This operation will only be called when the
92
+ * relevant TopicListener is installed and enabled with the
93
+ * StatusMask::inconsistent_topic(). The InconsistentTopicStatus will change
94
+ * when another Topic exists with the same topic_name but different
95
+ * characteristics.
96
+ *
97
+ * @param topic contain a pointer to the Topic on which the conflict
98
+ * occurred (this is an input to the application).
99
+ * @param status contain the InconsistentTopicStatus object (this is
100
+ * an input to the application).
101
+ */
102
+ virtual void on_inconsistent_topic(
103
+ Topic<T>& topic,
104
+ const dds::core::status::InconsistentTopicStatus& status) = 0;
105
+ };
106
+
107
+
108
+ /**
109
+ * @brief
110
+ * Topic events Listener
111
+ *
112
+ * This listener is just like TopicListener, except
113
+ * that the application doesn't have to implement all operations.
114
+ *
115
+ * @code{.cpp}
116
+ * class ExampleListener : public virtual dds::topic::NoOpTopicListener<Foo::Bar>
117
+ * {
118
+ * // Not necessary to implement any Listener operations.
119
+ * };
120
+ * @endcode
121
+ *
122
+ * @see dds::topic::TopicListener
123
+ */
124
+ template <typename T>
125
+ class NoOpTopicListener : public virtual TopicListener<T>
126
+ {
127
+ /** @cond
128
+ * All these functions have already been documented in the non-NoOp listener.
129
+ * Ignore these functions for the doxygen API documentation for clarity.
130
+ */
131
+ public:
132
+ virtual ~NoOpTopicListener() { }
133
+
134
+ public:
135
+ virtual void on_inconsistent_topic(
136
+ Topic<T>&,
137
+ const dds::core::status::InconsistentTopicStatus&) { }
138
+ /** @endcond */
139
+ };
140
+
141
+ }
142
+ }
143
+
144
+ #endif /* OMG_DDS_TOPIC_TOPIC_LISTENER_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/TopicTraits.hpp ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_TOPIC_TRAITS_HPP_
2
+ #define OMG_DDS_TOPIC_TOPIC_TRAITS_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <string>
23
+
24
+ //==============================================================================
25
+ namespace dds
26
+ {
27
+ namespace topic
28
+ {
29
+ template <typename T>
30
+ struct is_topic_type;
31
+
32
+ /** @cond */
33
+ template <typename T>
34
+ struct topic_type_support;
35
+ /** @endcond */
36
+
37
+ /**
38
+ * @brief
39
+ * Support functionality to get the default type_name of a Topic type.
40
+ *
41
+ * @code{.cpp}
42
+ * std::string typeName = dds::topic::topic_type_name<Foo::Bar>::value();
43
+ * @endcode
44
+ */
45
+ template <typename T>
46
+ struct topic_type_name
47
+ {
48
+ static std::string value()
49
+ {
50
+ return "Undefined";
51
+ }
52
+ };
53
+
54
+ }
55
+ }
56
+
57
+ //==============================================================================
58
+ /**
59
+ * @brief
60
+ * Support functionality to check if a given object type is a Topic.
61
+ *
62
+ * @code{.cpp}
63
+ * if (dds::topic::is_topic_type<Foo::Bar>::value) {
64
+ * // Foo::Bar type is considered a Topic
65
+ * } else {
66
+ * // Foo::Bar type is NOT considered a Topic
67
+ * }
68
+ * @endcode
69
+ */
70
+ template <typename T>
71
+ struct dds::topic::is_topic_type
72
+ {
73
+ enum {value = 0 };
74
+ };
75
+
76
+
77
+ /** @cond
78
+ * IsoCpp doesn't know the TypeSupport concept. The type is automatically
79
+ * registered when an Topic is created. So, what does this function do?
80
+ */
81
+ template <typename T>
82
+ struct dds::topic::topic_type_support { };
83
+ /** @endcond */
84
+
85
+
86
+ #define REGISTER_TOPIC_TYPE(TOPIC_TYPE) \
87
+ namespace dds { namespace topic { \
88
+ template<> struct is_topic_type<TOPIC_TYPE> { \
89
+ enum { value = 1 }; \
90
+ }; } }
91
+
92
+ #endif /* OMG_DDS_TOPIC_TOPIC_TRAITS_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/ddstopic.hpp ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Copyright 2010, Object Management Group, Inc.
2
+ * Copyright 2010, PrismTech, Corp.
3
+ * Copyright 2010, Real-Time Innovations, Inc.
4
+ * All rights reserved.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ #ifndef OMG_DDS_TOPIC_PACKAGE_INCLUDE_HPP_
19
+ #define OMG_DDS_TOPIC_PACKAGE_INCLUDE_HPP_
20
+
21
+ #include <dds/topic/qos/TopicQos.hpp>
22
+ #include <dds/topic/TopicDescription.hpp>
23
+ #include <dds/topic/Topic.hpp>
24
+ #include <dds/topic/AnyTopic.hpp>
25
+ #include <dds/topic/ContentFilteredTopic.hpp>
26
+ #include <dds/topic/discovery.hpp>
27
+ #include <dds/topic/find.hpp>
28
+
29
+ #include <dds/topic/detail/ddstopic.hpp>
30
+
31
+ #endif /* OMG_DDS_TOPIC_PACKAGE_INCLUDE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/AnyTopic.hpp ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef OMG_DDS_TOPIC_DETAIL_ANY_TOPIC_HPP_
13
+ #define OMG_DDS_TOPIC_DETAIL_ANY_TOPIC_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ // Implementation
20
+
21
+ #include <dds/topic/detail/TAnyTopicImpl.hpp>
22
+ #include <org/eclipse/cyclonedds/topic/AnyTopicDelegate.hpp>
23
+
24
+ namespace dds { namespace topic { namespace detail {
25
+ typedef dds::topic::TAnyTopic<org::eclipse::cyclonedds::topic::AnyTopicDelegate> AnyTopic;
26
+ } } }
27
+
28
+ // End of implementation
29
+
30
+ #endif /* OMG_DDS_TOPIC_DETAIL_ANY_TOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/BuiltinTopic.hpp ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_HPP_
2
+ #define OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/topic/Topic.hpp>
23
+ #include <dds/topic/detail/TTopicImpl.hpp>
24
+ #include <dds/topic/detail/TBuiltinTopicImpl.hpp>
25
+ #include <org/eclipse/cyclonedds/topic/BuiltinTopicDelegate.hpp>
26
+ #include <org/eclipse/cyclonedds/topic/BuiltinTopic.hpp>
27
+
28
+ namespace dds { namespace topic { namespace detail {
29
+
30
+ typedef dds::topic::TParticipantBuiltinTopicData<org::eclipse::cyclonedds::topic::ParticipantBuiltinTopicDataDelegate>
31
+ ParticipantBuiltinTopicData;
32
+
33
+ typedef dds::topic::TTopicBuiltinTopicData<org::eclipse::cyclonedds::topic::TopicBuiltinTopicDataDelegate>
34
+ TopicBuiltinTopicData;
35
+
36
+ typedef dds::topic::TPublicationBuiltinTopicData<org::eclipse::cyclonedds::topic::PublicationBuiltinTopicDataDelegate>
37
+ PublicationBuiltinTopicData;
38
+
39
+ typedef dds::topic::TSubscriptionBuiltinTopicData<org::eclipse::cyclonedds::topic::SubscriptionBuiltinTopicDataDelegate>
40
+ SubscriptionBuiltinTopicData;
41
+
42
+ } } }
43
+
44
+
45
+
46
+ #endif /* OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/BuiltinTopicKey.hpp ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_KEY_HPP_
2
+ #define OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_KEY_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <org/eclipse/cyclonedds/topic/BuiltinTopicKeyDelegate.hpp>
23
+ #include <dds/topic/detail/TBuiltinTopicKeyImpl.hpp>
24
+
25
+ namespace dds { namespace topic { namespace detail {
26
+ typedef dds::topic::TBuiltinTopicKey<org::eclipse::cyclonedds::topic::BuiltinTopicKeyDelegate> BuiltinTopicKey;
27
+ } } }
28
+
29
+ #endif /* OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_KEY_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/ContentFilteredTopic.hpp ADDED
@@ -0,0 +1,470 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_
2
+ #define OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Inc.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <string>
23
+ #include <vector>
24
+
25
+ #include <dds/core/detail/conformance.hpp>
26
+ #include <dds/core/types.hpp>
27
+ #include <dds/topic/Topic.hpp>
28
+ #include <dds/topic/Filter.hpp>
29
+ #include <org/eclipse/cyclonedds/topic/TopicDescriptionDelegate.hpp>
30
+ #include <org/eclipse/cyclonedds/core/ScopedLock.hpp>
31
+ #include <org/eclipse/cyclonedds/sub/AnyDataReaderDelegate.hpp>
32
+
33
+ #ifdef OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT
34
+
35
+ // Required for C++11
36
+ #if __cplusplus == 201103L
37
+ #include <org/eclipse/cyclonedds/core/Missing.hpp>
38
+ #endif
39
+
40
+ // meta-programming helpers
41
+ namespace detail
42
+ {
43
+ template<typename T>
44
+ struct remove_first_from_tuple;
45
+
46
+ template<typename T, typename ... Ts>
47
+ struct remove_first_from_tuple<std::tuple<T, Ts...>>
48
+ {
49
+ using type = std::tuple<Ts...>;
50
+ };
51
+
52
+ template<typename T>
53
+ using remove_first_from_tuple_t = typename remove_first_from_tuple<T>::type;
54
+
55
+ template<class F>
56
+ struct callable_traits;
57
+
58
+ template<class R, class ... Args>
59
+ struct callable_traits<R(Args...)>
60
+ {
61
+ using return_type = R;
62
+
63
+ static constexpr std::size_t Arity = sizeof...(Args);
64
+
65
+ template < std::size_t N, std::enable_if_t<N<Arity> * = nullptr>
66
+ struct argument
67
+ {
68
+ using type = typename std::tuple_element<N, std::tuple<Args...>>::type;
69
+ };
70
+
71
+ using argument_tuple = std::tuple<Args...>;
72
+ };
73
+
74
+ // function pointer
75
+ template<class R, class ... Args>
76
+ struct callable_traits<R (*)(Args...)>
77
+ : public callable_traits<R(Args...)> {};
78
+
79
+ // member function pointer
80
+ template<class C, class R, class ... Args>
81
+ struct callable_traits<R (C::*)(Args...)>
82
+ : public callable_traits<R(C &, Args...)> {};
83
+
84
+ // const member function pointer
85
+ template<class C, class R, class ... Args>
86
+ struct callable_traits<R (C::*)(Args...) const>
87
+ : public callable_traits<R(C &, Args...)> {};
88
+
89
+ // member object pointer
90
+ template<class C, class R>
91
+ struct callable_traits<R(C::*)>
92
+ : public callable_traits<R(C &)> {};
93
+
94
+ // functor
95
+ template<class F>
96
+ struct callable_traits
97
+ {
98
+ private:
99
+ using call_type = callable_traits<decltype(&F::operator())>;
100
+
101
+ public:
102
+ using return_type = typename call_type::return_type;
103
+
104
+ static constexpr std::size_t Arity = call_type::Arity - 1;
105
+
106
+ template < std::size_t N, std::enable_if_t<N<Arity> * = nullptr>
107
+ struct argument
108
+ {
109
+ using type = typename call_type::template argument<N + 1>::type;
110
+ };
111
+
112
+ using argument_tuple = remove_first_from_tuple_t<typename call_type::argument_tuple>;
113
+ };
114
+
115
+ template<class F>
116
+ struct callable_traits<F &>
117
+ : public callable_traits<F> {};
118
+
119
+ template<class F>
120
+ struct callable_traits<F &&>
121
+ : public callable_traits<F> {};
122
+
123
+ // Concepts of possible callbacks
124
+ template<class F, class T>
125
+ using sample_only_t = std::enable_if_t<callable_traits<std::decay_t<F>>::Arity == 1 &&
126
+ std::is_same<typename callable_traits<std::decay_t<F>>::template argument<0>::type,
127
+ const T &>::value &&
128
+ std::is_same<typename callable_traits<std::decay_t<F>>::return_type, bool>::value
129
+ >;
130
+
131
+ template<class F>
132
+ using sample_info_only_t = std::enable_if_t<callable_traits<std::decay_t<F>>::Arity == 1 &&
133
+ std::is_same<typename callable_traits<std::decay_t<F>>::template argument<0>::type,
134
+ const dds::sub::SampleInfo &>::value &&
135
+ std::is_same<typename callable_traits<std::decay_t<F>>::return_type, bool>::value
136
+ >;
137
+
138
+ template<class F, class T>
139
+ using sample_and_sample_info_t = std::enable_if_t<callable_traits<std::decay_t<F>>::Arity == 2 &&
140
+ std::is_same<typename callable_traits<std::decay_t<F>>::template argument<0>::type,
141
+ const T &>::value &&
142
+ std::is_same<typename callable_traits<std::decay_t<F>>::template argument<1>::type,
143
+ const dds::sub::SampleInfo &>::value &&
144
+ std::is_same<typename callable_traits<std::decay_t<F>>::return_type, bool>::value
145
+ >;
146
+
147
+ } // namespace detail
148
+
149
+
150
+ namespace dds {
151
+ namespace topic {
152
+ namespace detail {
153
+
154
+ class FunctorHolderBase
155
+ {
156
+ public:
157
+ FunctorHolderBase() = default;
158
+ virtual ~FunctorHolderBase() = default;
159
+ FunctorHolderBase(const FunctorHolderBase &) = default;
160
+ FunctorHolderBase & operator=(const FunctorHolderBase &) = default;
161
+ FunctorHolderBase(FunctorHolderBase &&) = default;
162
+ FunctorHolderBase & operator=(FunctorHolderBase &&) = default;
163
+
164
+ virtual bool check_sample(const void * sample, const dds_sample_info_t * sample_info) = 0;
165
+
166
+ static bool c99_check_sample(const void *sample, void *arg)
167
+ {
168
+ auto funcHolder = static_cast<FunctorHolderBase *>(arg);
169
+ return funcHolder->check_sample(sample, nullptr);
170
+ }
171
+
172
+ static bool c99_check_sample_info(const dds_sample_info_t * sampleinfo, void * arg)
173
+ {
174
+ auto funcHolder = static_cast<FunctorHolderBase *>(arg);
175
+ return funcHolder->check_sample(nullptr, sampleinfo);
176
+ }
177
+
178
+ static bool c99_check_sample_and_sample_info(
179
+ const void * sample,
180
+ const dds_sample_info_t * sampleinfo, void * arg)
181
+ {
182
+ auto funcHolder = static_cast<FunctorHolderBase *>(arg);
183
+ return funcHolder->check_sample(sample, sampleinfo);
184
+ }
185
+ };
186
+
187
+ template<typename FUN, typename T, class = void>
188
+ class FunctorHolder;
189
+
190
+ template <typename FUN, typename T>
191
+ class FunctorHolder<FUN, T, ::detail::sample_only_t<FUN, T>>: public FunctorHolderBase
192
+ {
193
+ public:
194
+ /* Remove const to be able to call non-const functors. */
195
+ FunctorHolder(FUN functor)
196
+ : myFunctor(std::move(functor)) {}
197
+
198
+ bool check_sample(const void * sample, const dds_sample_info_t *) override
199
+ {
200
+ return myFunctor(*(reinterpret_cast<const T*>(sample)));
201
+ }
202
+
203
+ private:
204
+ FUN myFunctor;
205
+ };
206
+
207
+ template<typename FUN, typename T>
208
+ class FunctorHolder<FUN, T, ::detail::sample_info_only_t<FUN>>: public FunctorHolderBase
209
+ {
210
+ public:
211
+ /* Remove const to be able to call non-const functors. */
212
+ FunctorHolder(FUN functor)
213
+ : myFunctor(std::move(functor)) {}
214
+
215
+ bool check_sample(const void *, const dds_sample_info_t * sampleinfo) override
216
+ {
217
+ dds::sub::SampleInfo cxxSampleInfo;
218
+ org::eclipse::cyclonedds::sub::AnyDataReaderDelegate::copy_sample_infos(
219
+ *sampleinfo,
220
+ cxxSampleInfo);
221
+ return myFunctor(cxxSampleInfo);
222
+ }
223
+
224
+ private:
225
+ FUN myFunctor;
226
+ };
227
+
228
+ template<typename FUN, typename T>
229
+ class FunctorHolder<FUN, T, ::detail::sample_and_sample_info_t<FUN, T>>: public FunctorHolderBase
230
+ {
231
+ public:
232
+ /* Remove const to be able to call non-const functors. */
233
+ FunctorHolder(FUN functor)
234
+ : myFunctor(std::move(functor)) {}
235
+
236
+ bool check_sample(const void * sample, const dds_sample_info_t * sampleinfo) override
237
+ {
238
+ dds::sub::SampleInfo cxxSampleInfo;
239
+ org::eclipse::cyclonedds::sub::AnyDataReaderDelegate::copy_sample_infos(*sampleinfo,
240
+ cxxSampleInfo);
241
+ return myFunctor(*(reinterpret_cast<const T*>(sample)), cxxSampleInfo);
242
+ }
243
+
244
+ private:
245
+ FUN myFunctor;
246
+ };
247
+
248
+ template <typename T>
249
+ class ContentFilteredTopic :
250
+ public virtual org::eclipse::cyclonedds::topic::TopicDescriptionDelegate,
251
+ public virtual org::eclipse::cyclonedds::core::DDScObjectDelegate
252
+ {
253
+ public:
254
+ ContentFilteredTopic(
255
+ const dds::topic::Topic<T>& topic,
256
+ const std::string& name,
257
+ const dds::topic::Filter& filter)
258
+ : org::eclipse::cyclonedds::core::DDScObjectDelegate(),
259
+ org::eclipse::cyclonedds::topic::TopicDescriptionDelegate(topic.domain_participant(), name, topic.type_name()),
260
+ myTopic(topic),
261
+ myFilter(filter),
262
+ myFunctor(nullptr)
263
+ {
264
+ topic.delegate()->incrNrDependents();
265
+ this->myParticipant.delegate()->add_cfTopic(*this);
266
+ this->ser_type_ = topic->get_ser_type();
267
+ }
268
+
269
+ virtual ~ContentFilteredTopic()
270
+ {
271
+ if (!this->closed) {
272
+ try {
273
+ this->close();
274
+ } catch (...) {
275
+ /* Empty: the exception throw should have already traced an error. */
276
+ }
277
+ }
278
+ // delete the functor
279
+ delete myFunctor;
280
+ myFunctor = nullptr;
281
+ }
282
+
283
+ virtual void close()
284
+ {
285
+ org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
286
+
287
+ myTopic.delegate()->decrNrDependents();
288
+
289
+ // Remove the ContentFilteredTopic from the list of topics in its participant.
290
+ this->myParticipant.delegate()->remove_cfTopic(*this);
291
+
292
+ org::eclipse::cyclonedds::core::ObjectDelegate::close();
293
+ }
294
+
295
+ void
296
+ init(org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type weak_ref)
297
+ {
298
+ /* Set weak_ref before passing ourselves to other isocpp objects. */
299
+ this->set_weak_ref(weak_ref);
300
+ /* Register topic at participant. */
301
+ this->myParticipant.delegate()->add_cfTopic(*this);
302
+ }
303
+
304
+ private:
305
+ #if 0
306
+ void validate_filter()
307
+ {
308
+ q_expr expr = NULL;
309
+ uint32_t length;
310
+ c_value *params;
311
+
312
+ length = myFilter.parameters_length();
313
+ if (length < 100) {
314
+ expr = q_parse(myFilter.expression().c_str());
315
+ if (!expr ) {
316
+ ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
317
+ "filter_expression '%s' is invalid", myFilter.expression().c_str());
318
+ }
319
+ } else {
320
+ ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
321
+ "Invalid number of filter_parameters '%d', maximum is 99", length);
322
+ }
323
+
324
+ u_topic uTopic = (u_topic)(myTopic.delegate()->get_user_handle());
325
+
326
+ params = reader_parameters();
327
+ if (!u_topicContentFilterValidate2(uTopic, expr, params)) {
328
+ ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
329
+ "filter_expression '%s' is invalid.", myFilter.expression().c_str());
330
+ }
331
+ q_dispose(expr);
332
+ os_free(params);
333
+ }
334
+ #endif
335
+ public:
336
+ std::string reader_expression() const
337
+ {
338
+ std::string rExpr;
339
+
340
+ rExpr += "select * from ";
341
+ rExpr += myTopic.name();
342
+ rExpr += " where ";
343
+ rExpr += myFilter.expression();
344
+ return rExpr;
345
+ }
346
+ #if 0
347
+ c_value *reader_parameters() const
348
+ {
349
+ c_value *params = NULL;
350
+ uint32_t n, length;
351
+ org::eclipse::cyclonedds::topic::FilterDelegate::const_iterator paramIterator;
352
+
353
+ length = myFilter.parameters_length();
354
+ params = (c_value *)os_malloc(length * sizeof(struct c_value));
355
+ for (n = 0, paramIterator = myFilter.begin(); n < length; n++, paramIterator++) {
356
+ params[n] = c_stringValue(const_cast<char *>(paramIterator->c_str()));
357
+ }
358
+ return params;
359
+ }
360
+ #endif
361
+ /**
362
+ * @internal Accessor to return the topic filter.
363
+ * @return The dds::topic::Filter in effect on this topic.
364
+ */
365
+ const dds::topic::Filter& filter() const
366
+ {
367
+ return myFilter;
368
+ }
369
+
370
+ /**
371
+ * @internal Sets the filter parameters for this content filtered topic.
372
+ * @param begin The iterator holding the first string param
373
+ * @param end The last item in the string iteration
374
+ */
375
+ template <typename FWIterator>
376
+ void filter_parameters(const FWIterator& begin, const FWIterator& end)
377
+ {
378
+ ISOCPP_THROW_EXCEPTION(ISOCPP_UNSUPPORTED_ERROR, "Changing of Filter parameters is currently not supported.");
379
+ myFilter.parameters(begin, end);
380
+ //@todo validate_filter();
381
+ }
382
+
383
+ const dds::topic::Topic<T>& topic() const
384
+ {
385
+ return myTopic;
386
+ }
387
+
388
+ const std::string& filter_expression() const
389
+ {
390
+ return myFilter.expression();
391
+ }
392
+
393
+ const dds::core::StringSeq filter_parameters() const
394
+ {
395
+ return dds::core::StringSeq(myFilter.begin(), myFilter.end());
396
+ }
397
+ #if 0
398
+ dds::topic::TTopicDescription<TopicDescriptionDelegate> clone()
399
+ {
400
+ org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
401
+
402
+ typename dds::topic::ContentFilteredTopic<T, ContentFilteredTopic>::DELEGATE_REF_T ref(
403
+ new ContentFilteredTopic<T>(this->myTopic, this->myTopicName, this->myFilter));
404
+ ref->init(ref);
405
+
406
+ return dds::topic::ContentFilteredTopic<T, ContentFilteredTopic>(ref);
407
+ }
408
+ #endif
409
+
410
+ template<class Functor, ::detail::sample_only_t<Functor, T> * = nullptr>
411
+ void filter_function(Functor && func)
412
+ {
413
+ dds_topic_filter flt;
414
+ flt.mode = DDS_TOPIC_FILTER_SAMPLE_ARG;
415
+ flt.f.sample_arg = &FunctorHolderBase::c99_check_sample;
416
+ filter_function_internal(std::forward<Functor>(func), &flt);
417
+ }
418
+
419
+ template<class Functor, ::detail::sample_info_only_t<Functor> * = nullptr>
420
+ void filter_function(Functor && func)
421
+ {
422
+ dds_topic_filter flt;
423
+ flt.mode = DDS_TOPIC_FILTER_SAMPLEINFO_ARG;
424
+ flt.f.sampleinfo_arg = &FunctorHolderBase::c99_check_sample_info;
425
+ filter_function_internal(std::forward<Functor>(func), &flt);
426
+ }
427
+
428
+ template<class Functor, ::detail::sample_and_sample_info_t<Functor, T> * = nullptr>
429
+ void filter_function(Functor && func)
430
+ {
431
+ dds_topic_filter flt;
432
+ flt.mode = DDS_TOPIC_FILTER_SAMPLE_SAMPLEINFO_ARG;
433
+ flt.f.sample_sampleinfo_arg = &FunctorHolderBase::c99_check_sample_and_sample_info;
434
+ filter_function_internal(std::forward<Functor>(func), &flt);
435
+ }
436
+
437
+ private:
438
+ template <typename Functor>
439
+ void filter_function_internal(Functor && func, dds_topic_filter * flt)
440
+ {
441
+ /* Make a private copy of the topic so my filter doesn't bother the original topic. */
442
+ dds_qos_t* ddsc_qos = myTopic.qos()->ddsc_qos();
443
+ ddsi_sertype *st = org::eclipse::cyclonedds::topic::TopicTraits<T>::getSerType();
444
+ dds_entity_t cfTopic = dds_create_topic_sertype(
445
+ myTopic.domain_participant().delegate()->get_ddsc_entity(), myTopic.name().c_str(), &st, ddsc_qos, NULL, NULL);
446
+ dds_delete_qos(ddsc_qos);
447
+ this->set_ddsc_entity(cfTopic);
448
+
449
+ org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
450
+ if (this->myFunctor)
451
+ {
452
+ delete this->myFunctor;
453
+ }
454
+ myFunctor = new FunctorHolder<Functor, T>(std::forward<Functor>(func));
455
+ flt->arg = myFunctor;
456
+ dds_set_topic_filter_extended(cfTopic, flt);
457
+ }
458
+
459
+ dds::topic::Topic<T> myTopic;
460
+ dds::topic::Filter myFilter;
461
+ FunctorHolderBase *myFunctor;
462
+ };
463
+
464
+ }
465
+ }
466
+ }
467
+
468
+ #endif /* OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT */
469
+
470
+ #endif /* OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/Filter.hpp ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef DDS_TOPIC_DETAIL_QUERY_HPP_
13
+ #define DDS_TOPIC_DETAIL_QUERY_HPP_
14
+
15
+ #include <dds/topic/detail/TFilterImpl.hpp>
16
+ #include <org/eclipse/cyclonedds/topic/FilterDelegate.hpp>
17
+
18
+ namespace dds {
19
+ namespace topic {
20
+ namespace detail {
21
+ typedef ::dds::topic::TFilter< ::org::eclipse::cyclonedds::topic::FilterDelegate > Filter;
22
+ }
23
+ }
24
+ }
25
+ #endif /* DDS_TOPIC_DETAIL_QUERY_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/MultiTopic.hpp ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_DETAIL_MULTI_TOPIC_HPP_
2
+ #define OMG_DDS_TOPIC_DETAIL_MULTI_TOPIC_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Inc.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <string>
23
+ #include <vector>
24
+
25
+ #include <dds/core/types.hpp>
26
+ #include <dds/domain/DomainParticipant.hpp>
27
+ #include <dds/topic/detail/TopicDescription.hpp>
28
+ #include <dds/core/Query.hpp>
29
+
30
+ #ifdef OMG_DDS_MULTI_TOPIC_SUPPORT
31
+
32
+ namespace dds { namespace topic { namespace detail {
33
+
34
+
35
+ template <typename T>
36
+ class MultiTopic : public org::eclipse::cyclonedds::topic::TopicDescriptionDelegate
37
+ {
38
+ public:
39
+ MultiTopic(
40
+ const dds::domain::DomainParticipant& dp,
41
+ const std::string& name,
42
+ const std::string expression,
43
+ const FWDIterator& params_begin,
44
+ const FWDIterator& params_end)
45
+ : ::dds::core::Reference< DELEGATE<T> >(
46
+ new dds::topic::detail::MultiTopic<T>(dp, name, expression, params_begin, params_end))
47
+ {
48
+ // Set the correct (IDL) type_name in the TopicDescription.
49
+ dds::topic::detail::TopicDescription<T>::myTypeName = org::eclipse::cyclonedds::topic::TopicTraits<T>::getTypeName();
50
+
51
+ //@todo validate_filter();
52
+ }
53
+
54
+ virtual ~MultiTopic()
55
+ {
56
+ // Assume destructor of Filter attribute cleans up itself.
57
+ }
58
+
59
+ private:
60
+ #if 0
61
+ void validate_filter()
62
+ {
63
+ q_expr expr = NULL;
64
+ uint32_t length;
65
+ c_value *params;
66
+
67
+ length = myFilter.parameters_length();
68
+ if (length < 100) {
69
+ expr = q_parse(myFilter.expression().c_str());
70
+ if (!expr ) {
71
+ ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
72
+ "filter_expression '%s' is invalid", myFilter.expression().c_str());
73
+ }
74
+ } else {
75
+ ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
76
+ "Invalid number of filter_parameters '%d', maximum is 99", length);
77
+ }
78
+
79
+ params = reader_parameters();
80
+ /* The function below does not exist yet, but probably a function like it will need to be developed. */
81
+ if (!u_topicMultiExprValidate(dp.delegate()->get_user_handle(), myFilter.expression().c_str(), params)) {
82
+ ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
83
+ "filter_expression '%s' is invalid.", myFilter.expression().c_str());
84
+ }
85
+ q_dispose(expr);
86
+ os_free(params);
87
+ }
88
+ #endif
89
+ public:
90
+ std::string reader_expression() const
91
+ {
92
+ return myFilter.expression();
93
+ }
94
+ #if 0
95
+ c_value *reader_parameters() const
96
+ {
97
+ c_value *params = NULL;
98
+ uint32_t n, length;
99
+ org::eclipse::cyclonedds::topic::FilterDelegate::const_iterator paramIterator;
100
+
101
+ length = myFilter.parameters_length();
102
+ params = (c_value *)os_malloc(length * sizeof(struct c_value));
103
+ for (n = 0, paramIterator = myFilter.begin(); n < length; n++, paramIterator++) {
104
+ params[n] = c_stringValue(const_cast<char *>(paramIterator->c_str()));
105
+ }
106
+ return params;
107
+ }
108
+ #endif
109
+ const std::string expression() const
110
+ {
111
+ return myFilter.expression();
112
+ }
113
+
114
+ template <typename FWIterator>
115
+ void expression_parameters(const FWIterator& params_begin, const FWIterator& params_end)
116
+ {
117
+ myFilter.parameters(begin, end);
118
+ validate_filter();
119
+ }
120
+
121
+ const dds::core::StringSeq expression_parameters() const
122
+ {
123
+ return dds::core::StringSeq(myFilter.begin(), myFilter.end());
124
+ }
125
+
126
+ private:
127
+ dds::topic::Filter myFilter;
128
+ };
129
+
130
+ }
131
+ }
132
+ }
133
+ #endif /* OMG_DDS_MULTI_TOPIC_SUPPORT */
134
+
135
+ #endif /* OMG_DDS_TOPIC_DETAIL_MULTI_TOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TAnyTopicImpl.hpp ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2021 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_TANYTOPIC_IMPL_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_TANYTOPIC_IMPL_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ /*
20
+ * OMG PSM class declaration
21
+ */
22
+ #include <dds/topic/TAnyTopic.hpp>
23
+
24
+ // Implementation
25
+ namespace dds
26
+ {
27
+ namespace topic
28
+ {
29
+
30
+ template <typename DELEGATE>
31
+ dds::topic::qos::TopicQos
32
+ TAnyTopic<DELEGATE>::qos() const
33
+ {
34
+ return this->delegate()->qos();
35
+ }
36
+
37
+ template <typename DELEGATE>
38
+ void
39
+ TAnyTopic<DELEGATE>::qos(const dds::topic::qos::TopicQos& qos)
40
+ {
41
+ this->delegate()->qos(qos);
42
+ }
43
+
44
+ template <typename DELEGATE>
45
+ TAnyTopic<DELEGATE>&
46
+ TAnyTopic<DELEGATE>::operator << (const dds::topic::qos::TopicQos& qos)
47
+ {
48
+ this->delegate()->qos(qos);
49
+ return *this;
50
+ }
51
+
52
+ template <typename DELEGATE>
53
+ const TAnyTopic<DELEGATE>&
54
+ TAnyTopic<DELEGATE>::operator >> (dds::topic::qos::TopicQos& qos) const
55
+ {
56
+ qos = this->delegate()->qos();
57
+ return *this;
58
+ }
59
+
60
+ template <typename DELEGATE>
61
+ dds::core::status::InconsistentTopicStatus
62
+ TAnyTopic<DELEGATE>::inconsistent_topic_status() const
63
+ {
64
+ return this->delegate()->inconsistent_topic_status();
65
+ }
66
+
67
+
68
+ }
69
+ }
70
+
71
+ // End of implementation
72
+
73
+ #endif /* CYCLONEDDS_DDS_TOPIC_TANYTOPIC_IMPL_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TBuiltinTopicImpl.hpp ADDED
@@ -0,0 +1,580 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_TBUILTINTOPIC_IMPL_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_TBUILTINTOPIC_IMPL_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ /*
20
+ * OMG PSM class declaration
21
+ */
22
+ #include <dds/topic/TBuiltinTopic.hpp>
23
+
24
+ // Implementation
25
+ namespace dds
26
+ {
27
+ namespace topic
28
+ {
29
+
30
+ //TParticipantBuiltinTopicData
31
+ template <typename D>
32
+ const dds::topic::BuiltinTopicKey& TParticipantBuiltinTopicData<D>::key() const
33
+ {
34
+ return this->delegate().key();
35
+ }
36
+
37
+ template <typename D>
38
+ const ::dds::core::policy::UserData& TParticipantBuiltinTopicData<D>::user_data() const
39
+ {
40
+ return this->delegate().user_data();
41
+ }
42
+
43
+ //TTopicBuiltinTopicData
44
+ template <typename D>
45
+ const dds::topic::BuiltinTopicKey& TTopicBuiltinTopicData<D>::key() const
46
+ {
47
+ return this->delegate().key();
48
+ }
49
+
50
+ template <typename D>
51
+ const std::string& TTopicBuiltinTopicData<D>::name() const
52
+ {
53
+ return this->delegate().name();
54
+ }
55
+
56
+ template <typename D>
57
+ const std::string& TTopicBuiltinTopicData<D>::type_name() const
58
+ {
59
+ return this->delegate().type_name();
60
+ }
61
+
62
+ template <typename D>
63
+ const ::dds::core::policy::Durability& TTopicBuiltinTopicData<D>::durability() const
64
+ {
65
+ return this->delegate().durability();
66
+ }
67
+
68
+ #ifdef OMG_DDS_PERSISTENCE_SUPPORT
69
+ template <typename D>
70
+ const ::dds::core::policy::DurabilityService& TTopicBuiltinTopicData<D>::durability_service() const
71
+ {
72
+ return this->delegate().durability_service();
73
+ }
74
+
75
+ #endif // OMG_DDS_PERSISTENCE_SUPPORT
76
+
77
+ template <typename D>
78
+ const ::dds::core::policy::Deadline& TTopicBuiltinTopicData<D>::deadline() const
79
+ {
80
+ return this->delegate().deadline();
81
+ }
82
+
83
+ template <typename D>
84
+ const ::dds::core::policy::LatencyBudget& TTopicBuiltinTopicData<D>::latency_budget() const
85
+ {
86
+ return this->delegate().latency_budget();
87
+ }
88
+
89
+ template <typename D>
90
+ const ::dds::core::policy::Liveliness& TTopicBuiltinTopicData<D>::liveliness() const
91
+ {
92
+ return this->delegate().liveliness();
93
+ }
94
+
95
+ template <typename D>
96
+ const ::dds::core::policy::Reliability& TTopicBuiltinTopicData<D>::reliability() const
97
+ {
98
+ return this->delegate().reliability();
99
+ }
100
+
101
+ template <typename D>
102
+ const ::dds::core::policy::TransportPriority& TTopicBuiltinTopicData<D>::transport_priority() const
103
+ {
104
+ return this->delegate().transport_priority();
105
+ }
106
+
107
+ template <typename D>
108
+ const ::dds::core::policy::Lifespan& TTopicBuiltinTopicData<D>::lifespan() const
109
+ {
110
+ return this->delegate().lifespan();
111
+ }
112
+
113
+ template <typename D>
114
+ const ::dds::core::policy::DestinationOrder& TTopicBuiltinTopicData<D>::destination_order() const
115
+ {
116
+ return this->delegate().destination_order();
117
+ }
118
+
119
+ template <typename D>
120
+ const ::dds::core::policy::History& TTopicBuiltinTopicData<D>::history() const
121
+ {
122
+ return this->delegate().history();
123
+ }
124
+
125
+ template <typename D>
126
+ const ::dds::core::policy::ResourceLimits& TTopicBuiltinTopicData<D>::resource_limits() const
127
+ {
128
+ return this->delegate().resource_limits();
129
+ }
130
+
131
+ template <typename D>
132
+ const ::dds::core::policy::Ownership& TTopicBuiltinTopicData<D>::ownership() const
133
+ {
134
+ return this->delegate().ownership();
135
+ }
136
+
137
+ template <typename D>
138
+ const ::dds::core::policy::TopicData& TTopicBuiltinTopicData<D>::topic_data() const
139
+ {
140
+ return this->delegate().topic_data();
141
+ }
142
+
143
+ //TPublicationBuiltinTopicData
144
+
145
+ template <typename D>
146
+ const dds::topic::BuiltinTopicKey& TPublicationBuiltinTopicData<D>::key() const
147
+ {
148
+ return this->delegate().key();
149
+ }
150
+
151
+ template <typename D>
152
+ const dds::topic::BuiltinTopicKey& TPublicationBuiltinTopicData<D>::participant_key() const
153
+ {
154
+ return this->delegate().key();
155
+ }
156
+
157
+ template <typename D>
158
+ const std::string& TPublicationBuiltinTopicData<D>::topic_name() const
159
+ {
160
+ return this->delegate().topic_name();
161
+ }
162
+
163
+ template <typename D>
164
+ const std::string& TPublicationBuiltinTopicData<D>::type_name() const
165
+ {
166
+ return this->delegate().type_name();
167
+ }
168
+
169
+ template <typename D>
170
+ const ::dds::core::policy::Durability& TPublicationBuiltinTopicData<D>::durability() const
171
+ {
172
+ return this->delegate().durability();
173
+ }
174
+
175
+ #ifdef OMG_DDS_PERSISTENCE_SUPPORT
176
+
177
+ template <typename D>
178
+ const ::dds::core::policy::DurabilityService& TPublicationBuiltinTopicData<D>::durability_service() const
179
+ {
180
+ return this->delegate().durability_service();
181
+ }
182
+ #endif // OMG_DDS_PERSISTENCE_SUPPORT
183
+
184
+ template <typename D>
185
+ const ::dds::core::policy::Deadline& TPublicationBuiltinTopicData<D>::deadline() const
186
+ {
187
+ return this->delegate().deadline();
188
+ }
189
+
190
+ template <typename D>
191
+ const ::dds::core::policy::LatencyBudget& TPublicationBuiltinTopicData<D>::latency_budget() const
192
+ {
193
+ return this->delegate().latency_budget();
194
+ }
195
+
196
+ template <typename D>
197
+ const ::dds::core::policy::Liveliness& TPublicationBuiltinTopicData<D>::liveliness() const
198
+ {
199
+ return this->delegate().liveliness();
200
+ }
201
+
202
+ template <typename D>
203
+ const ::dds::core::policy::Reliability& TPublicationBuiltinTopicData<D>::reliability() const
204
+ {
205
+ return this->delegate().reliability();
206
+ }
207
+
208
+
209
+ template <typename D>
210
+ const ::dds::core::policy::Lifespan& TPublicationBuiltinTopicData<D>::lifespan() const
211
+ {
212
+ return this->delegate().lifespan();
213
+ }
214
+
215
+ template <typename D>
216
+ const ::dds::core::policy::UserData& TPublicationBuiltinTopicData<D>::user_data() const
217
+ {
218
+ return this->delegate().user_data();
219
+ }
220
+
221
+ template <typename D>
222
+ const ::dds::core::policy::Ownership& TPublicationBuiltinTopicData<D>::ownership() const
223
+ {
224
+ return this->delegate().ownership();
225
+ }
226
+
227
+ #ifdef OMG_DDS_OWNERSHIP_SUPPORT
228
+
229
+ template <typename D>
230
+ const ::dds::core::policy::OwnershipStrength& TPublicationBuiltinTopicData<D>::ownership_strength() const
231
+ {
232
+ return this->delegate().ownership_strength();
233
+ }
234
+ #endif // OMG_DDS_OWNERSHIP_SUPPORT
235
+
236
+
237
+ template <typename D>
238
+ const ::dds::core::policy::DestinationOrder& TPublicationBuiltinTopicData<D>::destination_order() const
239
+ {
240
+ return this->delegate().destination_order();
241
+ }
242
+
243
+ template <typename D>
244
+ const ::dds::core::policy::Presentation& TPublicationBuiltinTopicData<D>::presentation() const
245
+ {
246
+ return this->delegate().presentation();
247
+ }
248
+
249
+ template <typename D>
250
+ const ::dds::core::policy::Partition& TPublicationBuiltinTopicData<D>::partition() const
251
+ {
252
+ return this->delegate().partition();
253
+ }
254
+
255
+ template <typename D>
256
+ const ::dds::core::policy::TopicData& TPublicationBuiltinTopicData<D>::topic_data() const
257
+ {
258
+ return this->delegate().topic_data();
259
+ }
260
+
261
+ template <typename D>
262
+ const ::dds::core::policy::GroupData& TPublicationBuiltinTopicData<D>::group_data() const
263
+ {
264
+ return this->delegate().group_data();
265
+ }
266
+
267
+
268
+
269
+ template <typename D>
270
+ const dds::topic::BuiltinTopicKey& TSubscriptionBuiltinTopicData<D>::key() const
271
+ {
272
+ return this->delegate().key();
273
+ }
274
+
275
+ template <typename D>
276
+ const dds::topic::BuiltinTopicKey& TSubscriptionBuiltinTopicData<D>::participant_key() const
277
+ {
278
+ return this->delegate().key();
279
+ }
280
+
281
+ template <typename D>
282
+ const std::string& TSubscriptionBuiltinTopicData<D>::topic_name() const
283
+ {
284
+ return this->delegate().topic_name();
285
+ }
286
+
287
+ template <typename D>
288
+ const std::string& TSubscriptionBuiltinTopicData<D>::type_name() const
289
+ {
290
+ return this->delegate().type_name();
291
+ }
292
+
293
+ template <typename D>
294
+ const ::dds::core::policy::Durability& TSubscriptionBuiltinTopicData<D>::durability() const
295
+ {
296
+ return this->delegate().durability();
297
+ }
298
+
299
+ template <typename D>
300
+ const ::dds::core::policy::Deadline& TSubscriptionBuiltinTopicData<D>::deadline() const
301
+ {
302
+ return this->delegate().deadline();
303
+ }
304
+
305
+ template <typename D>
306
+ const ::dds::core::policy::LatencyBudget& TSubscriptionBuiltinTopicData<D>::latency_budget() const
307
+ {
308
+ return this->delegate().latency_budget();
309
+ }
310
+
311
+ template <typename D>
312
+ const ::dds::core::policy::Liveliness& TSubscriptionBuiltinTopicData<D>::liveliness() const
313
+ {
314
+ return this->delegate().liveliness();
315
+ }
316
+
317
+ template <typename D>
318
+ const ::dds::core::policy::Reliability& TSubscriptionBuiltinTopicData<D>::reliability() const
319
+ {
320
+ return this->delegate().reliability();
321
+ }
322
+
323
+ template <typename D>
324
+ const ::dds::core::policy::Ownership& TSubscriptionBuiltinTopicData<D>::ownership() const
325
+ {
326
+ return this->delegate().ownership();
327
+ }
328
+
329
+ template <typename D>
330
+ const ::dds::core::policy::DestinationOrder& TSubscriptionBuiltinTopicData<D>::destination_order() const
331
+ {
332
+ return this->delegate().destination_order();
333
+ }
334
+
335
+ template <typename D>
336
+ const ::dds::core::policy::UserData& TSubscriptionBuiltinTopicData<D>::user_data() const
337
+ {
338
+ return this->delegate().user_data();
339
+ }
340
+
341
+ template <typename D>
342
+ const ::dds::core::policy::TimeBasedFilter& TSubscriptionBuiltinTopicData<D>::time_based_filter() const
343
+ {
344
+ return this->delegate().time_based_filter();
345
+ }
346
+
347
+ template <typename D>
348
+ const ::dds::core::policy::Presentation& TSubscriptionBuiltinTopicData<D>::presentation() const
349
+ {
350
+ return this->delegate().presentation();
351
+ }
352
+
353
+ template <typename D>
354
+ const ::dds::core::policy::Partition& TSubscriptionBuiltinTopicData<D>::partition() const
355
+ {
356
+ return this->delegate().partition();
357
+ }
358
+
359
+ template <typename D>
360
+ const ::dds::core::policy::TopicData& TSubscriptionBuiltinTopicData<D>::topic_data() const
361
+ {
362
+ return this->delegate().topic_data();
363
+ }
364
+
365
+ template <typename D>
366
+ const ::dds::core::policy::GroupData& TSubscriptionBuiltinTopicData<D>::group_data() const
367
+ {
368
+ return this->delegate().group_data();
369
+ }
370
+
371
+ #if 0
372
+
373
+ //TCMParticipantBuiltinTopicData
374
+
375
+ template <typename D>
376
+ const dds::topic::BuiltinTopicKey& TCMParticipantBuiltinTopicData<D>::key() const
377
+ {
378
+ return ((D)this->delegate()).key();
379
+ }
380
+
381
+ template <typename D>
382
+ const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMParticipantBuiltinTopicData<D>::product() const
383
+ {
384
+ return ((D)this->delegate()).product();
385
+ }
386
+
387
+ //TCMPublisherBuiltinTopicData
388
+
389
+ template <typename D>
390
+ const dds::topic::BuiltinTopicKey& TCMPublisherBuiltinTopicData<D>::key() const
391
+ {
392
+ return ((D)this->delegate()).key();
393
+ }
394
+
395
+ template <typename D>
396
+ const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMPublisherBuiltinTopicData<D>::product() const
397
+ {
398
+ return ((D)this->delegate()).product();
399
+ }
400
+
401
+ template <typename D>
402
+ const dds::topic::BuiltinTopicKey& TCMPublisherBuiltinTopicData<D>::participant_key() const
403
+ {
404
+ return ((D)this->delegate()).participant_key();
405
+ }
406
+
407
+ template <typename D>
408
+ const std::string& TCMPublisherBuiltinTopicData<D>::name() const
409
+ {
410
+ return ((D)this->delegate()).name();
411
+ }
412
+
413
+ template <typename D>
414
+ const ::dds::core::policy::EntityFactory& TCMPublisherBuiltinTopicData<D>::entity_factory() const
415
+ {
416
+ return ((D)this->delegate()).entity_factory();
417
+ }
418
+
419
+ template <typename D>
420
+ const ::dds::core::policy::Partition& TCMPublisherBuiltinTopicData<D>::partition() const
421
+ {
422
+ return ((D)this->delegate()).partition();
423
+ }
424
+
425
+ //TCMSubscriberBuiltinTopicData
426
+
427
+ template <typename D>
428
+ const dds::topic::BuiltinTopicKey& TCMSubscriberBuiltinTopicData<D>::key() const
429
+ {
430
+ return ((D)this->delegate()).key();
431
+ }
432
+
433
+ template <typename D>
434
+ const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMSubscriberBuiltinTopicData<D>::product() const
435
+ {
436
+ return ((D)this->delegate()).product();
437
+ }
438
+
439
+ template <typename D>
440
+ const dds::topic::BuiltinTopicKey& TCMSubscriberBuiltinTopicData<D>::participant_key() const
441
+ {
442
+ return ((D)this->delegate()).participant_key();
443
+ }
444
+
445
+ template <typename D>
446
+ const std::string& TCMSubscriberBuiltinTopicData<D>::name() const
447
+ {
448
+ return ((D)this->delegate()).name();
449
+ }
450
+
451
+ template <typename D>
452
+ const ::dds::core::policy::EntityFactory& TCMSubscriberBuiltinTopicData<D>::entity_factory() const
453
+ {
454
+ return ((D)this->delegate()).entity_factory();
455
+ }
456
+
457
+ template <typename D>
458
+ const ::dds::core::policy::Partition& TCMSubscriberBuiltinTopicData<D>::partition() const
459
+ {
460
+ return ((D)this->delegate()).partition();
461
+ }
462
+
463
+ template <typename D>
464
+ const ::org::eclipse::cyclonedds::core::policy::Share& TCMSubscriberBuiltinTopicData<D>::share() const
465
+ {
466
+ return ((D)this->delegate()).share();
467
+ }
468
+
469
+ //TCMDataWriterBuiltinTopicData
470
+
471
+ template <typename D>
472
+ const dds::topic::BuiltinTopicKey& TCMDataWriterBuiltinTopicData<D>::key() const
473
+ {
474
+ return ((D)this->delegate()).key();
475
+ }
476
+
477
+ template <typename D>
478
+ const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMDataWriterBuiltinTopicData<D>::product() const
479
+ {
480
+ return ((D)this->delegate()).product();
481
+ }
482
+
483
+ template <typename D>
484
+ const dds::topic::BuiltinTopicKey& TCMDataWriterBuiltinTopicData<D>::publisher_key() const
485
+ {
486
+ return ((D)this->delegate()).publisher_key();
487
+ }
488
+
489
+ template <typename D>
490
+ const std::string& TCMDataWriterBuiltinTopicData<D>::name() const
491
+ {
492
+ return ((D)this->delegate()).name();
493
+ }
494
+
495
+ template <typename D>
496
+ const ::dds::core::policy::History& TCMDataWriterBuiltinTopicData<D>::history() const
497
+ {
498
+ return ((D)this->delegate()).history();
499
+ }
500
+
501
+ template <typename D>
502
+ const ::dds::core::policy::ResourceLimits& TCMDataWriterBuiltinTopicData<D>::resource_limits() const
503
+ {
504
+ return ((D)this->delegate()).resource_limits();
505
+ }
506
+
507
+ template <typename D>
508
+ const ::dds::core::policy::WriterDataLifecycle& TCMDataWriterBuiltinTopicData<D>::writer_data_lifecycle() const
509
+ {
510
+ return ((D)this->delegate()).writer_data_lifecycle();
511
+ }
512
+
513
+ //TCMDataReaderBuiltinTopicData
514
+
515
+ template <typename D>
516
+ const dds::topic::BuiltinTopicKey& TCMDataReaderBuiltinTopicData<D>::key() const
517
+ {
518
+ return ((D)this->delegate()).key();
519
+ }
520
+
521
+ template <typename D>
522
+ const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMDataReaderBuiltinTopicData<D>::product() const
523
+ {
524
+ return ((D)this->delegate()).product();
525
+ }
526
+
527
+ template <typename D>
528
+ const dds::topic::BuiltinTopicKey& TCMDataReaderBuiltinTopicData<D>::subscriber_key() const
529
+ {
530
+ return ((D)this->delegate()).subscriber_key();
531
+ }
532
+
533
+ template <typename D>
534
+ const std::string& TCMDataReaderBuiltinTopicData<D>::name() const
535
+ {
536
+ return ((D)this->delegate()).name();
537
+ }
538
+
539
+ template <typename D>
540
+ const ::dds::core::policy::History& TCMDataReaderBuiltinTopicData<D>::history() const
541
+ {
542
+ return ((D)this->delegate()).history();
543
+ }
544
+
545
+ template <typename D>
546
+ const ::dds::core::policy::ResourceLimits& TCMDataReaderBuiltinTopicData<D>::resource_limits() const
547
+ {
548
+ return ((D)this->delegate()).resource_limits();
549
+ }
550
+
551
+ template <typename D>
552
+ const ::dds::core::policy::ReaderDataLifecycle& TCMDataReaderBuiltinTopicData<D>::reader_data_lifecycle() const
553
+ {
554
+ return ((D)this->delegate()).reader_data_lifecycle();
555
+ }
556
+
557
+ template <typename D>
558
+ const ::org::eclipse::cyclonedds::core::policy::SubscriptionKey& TCMDataReaderBuiltinTopicData<D>::subscription_keys() const
559
+ {
560
+ return ((D)this->delegate()).subscription_keys();
561
+ }
562
+
563
+ template <typename D>
564
+ const ::org::eclipse::cyclonedds::core::policy::ReaderLifespan& TCMDataReaderBuiltinTopicData<D>::reader_lifespan() const
565
+ {
566
+ return ((D)this->delegate()).reader_lifespan();
567
+ }
568
+
569
+ template <typename D>
570
+ const ::org::eclipse::cyclonedds::core::policy::Share& TCMDataReaderBuiltinTopicData<D>::share() const
571
+ {
572
+ return ((D)this->delegate()).share();
573
+ }
574
+ #endif
575
+
576
+ }
577
+ }
578
+ // End of implementation
579
+
580
+ #endif /* CYCLONEDDS_DDS_TOPIC_TBUILTINTOPIC_IMPL_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TBuiltinTopicKeyImpl.hpp ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_TBUILTINTOPICKEY_IMPL_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_DETAIL_TBUILTINTOPICKEY_IMPL_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ /*
20
+ * OMG PSM class declaration
21
+ */
22
+ #include <dds/topic/TBuiltinTopicKey.hpp>
23
+
24
+ // Implementation
25
+
26
+ namespace dds
27
+ {
28
+ namespace topic
29
+ {
30
+
31
+ template <typename D>
32
+ const int32_t* TBuiltinTopicKey<D>::value() const
33
+ {
34
+ return this->delegate().value();
35
+ }
36
+
37
+ template <typename D>
38
+ void TBuiltinTopicKey<D>::value(int32_t v[])
39
+ {
40
+ return this->delegate().value(v);
41
+ }
42
+
43
+ }
44
+ }
45
+
46
+ // End of implementation
47
+
48
+ #endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_TBUILTINTOPICKEY_IMPL_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TContentFilteredTopicImpl.hpp ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_TCONTENTFILTEREDTOPIC_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_TCONTENTFILTEREDTOPIC_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ /*
20
+ * OMG PSM class declaration
21
+ */
22
+ #include <dds/topic/TContentFilteredTopic.hpp>
23
+
24
+ // Implementation
25
+
26
+ namespace dds
27
+ {
28
+ namespace topic
29
+ {
30
+ template <typename T, template <typename Q> class DELEGATE>
31
+ ContentFilteredTopic<T, DELEGATE>::ContentFilteredTopic(const Topic<T>& topic,
32
+ const std::string& name,
33
+ const dds::topic::Filter& filter) :
34
+ ::dds::core::Reference< DELEGATE<T> >(
35
+ new dds::topic::detail::ContentFilteredTopic<T>(topic, name, filter))
36
+ {
37
+ this->delegate()->init(::dds::core::Reference< DELEGATE<T> >::impl_);
38
+ }
39
+
40
+ template <typename T, template <typename Q> class DELEGATE>
41
+ ContentFilteredTopic<T, DELEGATE>::~ContentFilteredTopic()
42
+ {
43
+ // Nothing to be done yet....
44
+ }
45
+
46
+ template <typename T, template <typename Q> class DELEGATE>
47
+ const std::string& ContentFilteredTopic<T, DELEGATE>::filter_expression() const
48
+ {
49
+ return this->delegate()->filter_expression();
50
+ }
51
+
52
+ template <typename T, template <typename Q> class DELEGATE>
53
+ const dds::core::StringSeq ContentFilteredTopic<T, DELEGATE>::filter_parameters() const
54
+ {
55
+ return this->delegate()->filter_parameters();
56
+ }
57
+
58
+ template <typename T, template <typename Q> class DELEGATE>
59
+ template <typename FWDIterator>
60
+ void ContentFilteredTopic<T, DELEGATE>::filter_parameters(const FWDIterator& begin, const FWDIterator& end)
61
+ {
62
+ this->delegate()->filter_parameters(begin, end);
63
+ }
64
+
65
+ template <typename T, template <typename Q> class DELEGATE>
66
+ const dds::topic::Topic<T>& ContentFilteredTopic<T, DELEGATE>::topic() const
67
+ {
68
+ return this->delegate()->topic();
69
+ }
70
+
71
+
72
+ }
73
+ }
74
+
75
+ // End of implementation
76
+
77
+ #endif /* CYCLONEDDS_DDS_TOPIC_TCONTENTFILTEREDTOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TFilterImpl.hpp ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_TFILTER_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_TFILTER_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ /*
20
+ * OMG PSM class declaration
21
+ */
22
+ #include <dds/topic/TFilter.hpp>
23
+
24
+ // Implementation
25
+
26
+ namespace dds
27
+ {
28
+ namespace topic
29
+ {
30
+
31
+ template<typename D>
32
+ TFilter<D>::TFilter(const std::string& query_expression) :
33
+ dds::core::Value<D>(query_expression)
34
+ {
35
+ }
36
+
37
+ template<typename D>
38
+ template<typename FWIterator>
39
+ TFilter<D>::TFilter(const std::string& query_expression, const FWIterator& params_begin,
40
+ const FWIterator& params_end)
41
+ : dds::core::Value<D>(query_expression, params_begin, params_end)
42
+ { }
43
+
44
+ template<typename D>
45
+ TFilter<D>::TFilter(const std::string& query_expression,
46
+ const std::vector<std::string>& params) :
47
+ dds::core::Value<D>(query_expression, params.begin(), params.end())
48
+ {
49
+ }
50
+
51
+ template<typename D>
52
+ const std::string& TFilter<D>::expression() const
53
+ {
54
+ return this->delegate().expression();
55
+ }
56
+
57
+ template<typename D>
58
+ typename TFilter<D>::const_iterator TFilter<D>::begin() const
59
+ {
60
+ return this->delegate().begin();
61
+ }
62
+
63
+ template<typename D>
64
+ typename TFilter<D>::const_iterator TFilter<D>::end() const
65
+ {
66
+ return this->delegate().end();
67
+ }
68
+
69
+ template<typename D>
70
+ typename TFilter<D>::iterator TFilter<D>::begin()
71
+ {
72
+ return this->delegate().begin();
73
+ }
74
+
75
+ template<typename D>
76
+ typename TFilter<D>::iterator TFilter<D>::end()
77
+ {
78
+ return this->delegate().end();
79
+ }
80
+
81
+ template<typename D>
82
+ template<typename FWIterator>
83
+ void TFilter<D>::parameters(const FWIterator& begin, const FWIterator end)
84
+ {
85
+ this->delegate().parameters(begin, end);
86
+ }
87
+
88
+ template<typename D>
89
+ void TFilter<D>::add_parameter(const std::string& param)
90
+ {
91
+ this->delegate().add_parameter(param);
92
+ }
93
+
94
+ template<typename D>
95
+ uint32_t TFilter<D>::parameters_length() const
96
+ {
97
+ return this->delegate().parameters_length();
98
+ }
99
+
100
+ }
101
+ }
102
+
103
+ // End of implementation
104
+
105
+ #endif /* CYCLONEDDS_DDS_TOPIC_TFILTER_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TTopicDescriptionImpl.hpp ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2021 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_TTOPICDESCRIPTION_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_TTOPICDESCRIPTION_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ /*
20
+ * OMG PSM class declaration
21
+ */
22
+ #include <dds/topic/TTopicDescription.hpp>
23
+
24
+ // Implementation
25
+
26
+ namespace dds
27
+ {
28
+ namespace topic
29
+ {
30
+
31
+ template <typename DELEGATE>
32
+ const std::string& TTopicDescription<DELEGATE>::name() const
33
+ {
34
+ return this->delegate()->name();
35
+ }
36
+
37
+ template <typename DELEGATE>
38
+ const std::string& TTopicDescription<DELEGATE>::type_name() const
39
+ {
40
+ return this->delegate()->type_name();
41
+ }
42
+
43
+ template <typename DELEGATE>
44
+ const dds::domain::DomainParticipant& TTopicDescription<DELEGATE>::domain_participant() const
45
+ {
46
+ return this->delegate()->domain_participant();
47
+ }
48
+
49
+ }
50
+ }
51
+
52
+ // End of implementation
53
+
54
+ #endif /* CYCLONEDDS_DDS_TOPIC_TTOPICDESCRIPTION_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TTopicImpl.hpp ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2021 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_TTOPIC_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_TTOPIC_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ /*
20
+ * OMG PSM class declaration
21
+ */
22
+ #include <dds/topic/TTopic.hpp>
23
+ #include "org/eclipse/cyclonedds/topic/TopicTraits.hpp"
24
+ #include "org/eclipse/cyclonedds/topic/TopicListener.hpp"
25
+
26
+ #include <dds/dds.h>
27
+ #include <functional>
28
+
29
+ #define MAX_TOPIC_NAME_LEN 1024
30
+
31
+ // Implementation
32
+
33
+ namespace dds
34
+ {
35
+ namespace topic
36
+ {
37
+
38
+
39
+ /***************************************************************************
40
+ *
41
+ * dds/topic/Topic<> WRAPPER implementation.
42
+ * Declaration can be found in dds/topic/TTopic.hpp
43
+ *
44
+ ***************************************************************************/
45
+
46
+
47
+ template <typename T, template <typename Q> class DELEGATE>
48
+ Topic<T, DELEGATE>::Topic(const dds::domain::DomainParticipant& dp,
49
+ const std::string& topic_name) :
50
+ ::dds::core::Reference< DELEGATE<T> >(new DELEGATE<T>(
51
+ dp,
52
+ topic_name,
53
+ "",
54
+ dp.default_topic_qos(),
55
+ NULL,
56
+ dds::core::status::StatusMask::none()))
57
+ {
58
+ this->delegate()->init(this->impl_);
59
+ }
60
+
61
+ template <typename T, template <typename Q> class DELEGATE>
62
+ Topic<T, DELEGATE>::Topic(const dds::domain::DomainParticipant& dp,
63
+ const std::string& topic_name,
64
+ const std::string& type_name) :
65
+ ::dds::core::Reference< DELEGATE<T> >(new DELEGATE<T>(
66
+ dp,
67
+ topic_name,
68
+ type_name,
69
+ dp.default_topic_qos(),
70
+ NULL,
71
+ dds::core::status::StatusMask::none())),
72
+ ::dds::topic::TAnyTopic< DELEGATE<T> >(::dds::core::Reference< DELEGATE<T> >::delegate())
73
+ {
74
+ throw dds::core::UnsupportedError(std::string("Only Topics with default type_names are supported"));
75
+ /* this->delegate()->init(this->impl_); */
76
+ }
77
+
78
+ template <typename T, template <typename Q> class DELEGATE>
79
+ Topic<T, DELEGATE>::Topic(const dds::domain::DomainParticipant& dp,
80
+ const std::string& topic_name,
81
+ const dds::topic::qos::TopicQos& qos,
82
+ dds::topic::TopicListener<T>* listener,
83
+ const dds::core::status::StatusMask& mask) :
84
+ ::dds::core::Reference< DELEGATE<T> >(new DELEGATE<T>(
85
+ dp,
86
+ topic_name,
87
+ "",
88
+ qos,
89
+ listener,
90
+ mask)),
91
+ ::dds::topic::TAnyTopic< DELEGATE<T> >(::dds::core::Reference< DELEGATE<T> >::delegate())
92
+ {
93
+ this->delegate()->init(this->impl_);
94
+ }
95
+
96
+ template <typename T, template <typename Q> class DELEGATE>
97
+ Topic<T, DELEGATE>::Topic(const dds::domain::DomainParticipant& dp,
98
+ const std::string& topic_name,
99
+ const std::string& type_name,
100
+ const dds::topic::qos::TopicQos& qos,
101
+ dds::topic::TopicListener<T>* listener,
102
+ const dds::core::status::StatusMask& mask) :
103
+ ::dds::core::Reference< DELEGATE<T> >(new DELEGATE<T>(
104
+ dp,
105
+ topic_name,
106
+ type_name,
107
+ qos,
108
+ listener,
109
+ mask)),
110
+ ::dds::topic::TAnyTopic< DELEGATE<T> >(::dds::core::Reference< DELEGATE<T> >::delegate())
111
+ {
112
+ throw dds::core::UnsupportedError(std::string("Only Topics with default type_names are supported"));
113
+ /* this->delegate()->init(this->impl_); */
114
+ }
115
+
116
+ /** @internal @todo Relates to OMG_DDS_X_TYPE_DYNAMIC_TYPE_SUPPORT OSPL-1736 no implementation */
117
+ template <typename T, template <typename Q> class DELEGATE>
118
+ void Topic<T, DELEGATE>::listener(Listener* listener,
119
+ const ::dds::core::status::StatusMask& event_mask)
120
+ {
121
+ this->delegate()->listener(listener, event_mask);
122
+ }
123
+
124
+ /** @internal @todo Relates to OMG_DDS_X_TYPE_DYNAMIC_TYPE_SUPPORT OSPL-1736 no implementation */
125
+ template <typename T, template <typename Q> class DELEGATE>
126
+ typename Topic<T, DELEGATE>::Listener* Topic<T, DELEGATE>::listener() const
127
+ {
128
+ return this->delegate()->listener();
129
+ }
130
+
131
+
132
+ }
133
+ }
134
+
135
+
136
+
137
+
138
+ /***************************************************************************
139
+ *
140
+ * dds/topic/detail/Topic<> DELEGATE implementation.
141
+ * Declaration can be found in dds/topic/detail/Topic.hpp
142
+ *
143
+ * Implementation and declaration have been separated because some circular
144
+ * dependencies, like with TopicListener and AnyTopic.
145
+ *
146
+ ***************************************************************************/
147
+
148
+ #include <dds/topic/detail/Topic.hpp>
149
+ #include <dds/topic/AnyTopic.hpp>
150
+ #include <dds/topic/TopicListener.hpp>
151
+ //#include <dds/domain/DomainParticipantListener.hpp>
152
+ #include <org/eclipse/cyclonedds/core/ScopedLock.hpp>
153
+ #include <org/eclipse/cyclonedds/core/ListenerDispatcher.hpp>
154
+
155
+ #include "dds/ddsi/ddsi_sertype.h"
156
+
157
+ template <typename T>
158
+ dds::topic::detail::Topic<T>::Topic(const dds::domain::DomainParticipant& dp,
159
+ const std::string& name,
160
+ const std::string& type_name,
161
+ const dds::topic::qos::TopicQos& qos,
162
+ dds::topic::TopicListener<T>* listener,
163
+ const dds::core::status::StatusMask& mask)
164
+ : org::eclipse::cyclonedds::topic::TopicDescriptionDelegate(dp, name, type_name),
165
+ org::eclipse::cyclonedds::topic::AnyTopicDelegate(qos, dp, name, type_name)
166
+ {
167
+ // Set the correct (IDL) type_name in the TopicDescription.
168
+ org::eclipse::cyclonedds::topic::TopicDescriptionDelegate::myTypeName = org::eclipse::cyclonedds::topic::TopicTraits<T>::getTypeName();
169
+
170
+ // get and validate the ddsc qos
171
+ org::eclipse::cyclonedds::topic::qos::TopicQosDelegate tQos = qos.delegate();
172
+ tQos.check();
173
+ dds_qos_t* ddsc_qos = tQos.ddsc_qos();
174
+ dds_entity_t ddsc_par = dp.delegate()->get_ddsc_entity();
175
+
176
+ ser_type_ = org::eclipse::cyclonedds::topic::TopicTraits<T>::getSerType();
177
+
178
+ dds_entity_t ddsc_topic = dds_create_topic_sertype(
179
+ ddsc_par, name.c_str(), &ser_type_, ddsc_qos, NULL, NULL);
180
+
181
+ dds_delete_qos(ddsc_qos);
182
+
183
+ if (ddsc_topic < 0) {
184
+ ddsi_sertype_unref(ser_type_);
185
+ ISOCPP_DDSC_RESULT_CHECK_AND_THROW(ddsc_topic, "Could not create topic.");
186
+ }
187
+
188
+ this->set_ddsc_entity(ddsc_topic);
189
+
190
+ this->listener(listener, mask);
191
+
192
+ this->AnyTopicDelegate::set_sample(&this->sample_);
193
+ }
194
+
195
+ template <typename T>
196
+ dds::topic::detail::Topic<T>::Topic(const dds::domain::DomainParticipant& dp,
197
+ const std::string& name,
198
+ const std::string& type_name,
199
+ const dds::topic::qos::TopicQos& qos,
200
+ dds_entity_t ddsc_topic)
201
+ : org::eclipse::cyclonedds::topic::TopicDescriptionDelegate(dp, name, type_name),
202
+ org::eclipse::cyclonedds::topic::AnyTopicDelegate(qos, dp, name, type_name)
203
+ {
204
+ this->set_ddsc_entity(ddsc_topic);
205
+ this->listener(NULL, dds::core::status::StatusMask::none());
206
+
207
+ this->AnyTopicDelegate::set_sample(&this->sample_);
208
+ }
209
+
210
+
211
+ template <typename T>
212
+ dds::topic::detail::Topic<T>::~Topic/*<T>*/()
213
+ {
214
+ if (!closed) {
215
+ try {
216
+ close();
217
+ } catch (...) {
218
+
219
+ }
220
+ }
221
+ }
222
+
223
+ template <typename T>
224
+ void
225
+ dds::topic::detail::Topic<T>::close()
226
+ {
227
+ org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
228
+
229
+ if (this->hasDependents()) {
230
+ ISOCPP_THROW_EXCEPTION(ISOCPP_PRECONDITION_NOT_MET_ERROR, "Topic still has unclosed dependencies (e.g. Readers/Writers/ContentFilteredTopics)");
231
+ }
232
+
233
+ this->listener_set(NULL, dds::core::status::StatusMask::none());
234
+
235
+ this->myParticipant.delegate()->remove_topic(*this);
236
+
237
+ org::eclipse::cyclonedds::core::EntityDelegate::close();
238
+ }
239
+
240
+ template <typename T>
241
+ void
242
+ dds::topic::detail::Topic<T>::init(ObjectDelegate::weak_ref_type weak_ref)
243
+ {
244
+ /* Set weak_ref before passing ourselves to other isocpp objects. */
245
+ this->set_weak_ref(weak_ref);
246
+ /* Add weak_ref to the map of entities */
247
+ this->add_to_entity_map(weak_ref);
248
+ /* Register topic at participant. */
249
+ this->myParticipant.delegate()->add_topic(*this);
250
+
251
+ /* Enable when needed. */
252
+ if (this->myParticipant.delegate()->is_auto_enable()) {
253
+ this->enable();
254
+ }
255
+ }
256
+
257
+
258
+ template <typename T>
259
+ void
260
+ dds::topic::detail::Topic<T>::listener(TopicListener<T>* listener,
261
+ const ::dds::core::status::StatusMask& mask)
262
+ {
263
+ org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
264
+ this->listener_set(listener, mask);
265
+ scopedLock.unlock();
266
+ }
267
+
268
+
269
+ template <typename T>
270
+ dds::topic::TopicListener<T>*
271
+ dds::topic::detail::Topic<T>::listener()
272
+ {
273
+ this->check();
274
+ return reinterpret_cast<dds::topic::TopicListener<T>*>(this->listener_get());
275
+ }
276
+
277
+ template <typename T>
278
+ dds::topic::Topic<T, dds::topic::detail::Topic>
279
+ dds::topic::detail::Topic<T>::wrapper()
280
+ {
281
+
282
+ typename Topic::ref_type ref =
283
+ ::std::dynamic_pointer_cast<Topic<T> >(this->get_strong_ref());
284
+ dds::topic::Topic<T, dds::topic::detail::Topic> topic(ref);
285
+
286
+ return topic;
287
+ }
288
+
289
+ template <typename T>
290
+ void
291
+ dds::topic::detail::Topic<T>::listener_notify(
292
+ ObjectDelegate::ref_type source,
293
+ uint32_t triggerMask,
294
+ void *eventData,
295
+ void *l)
296
+ {
297
+ (void)source;
298
+ (void)triggerMask;
299
+ (void)eventData;
300
+ (void)l;
301
+ }
302
+
303
+ template <typename T>
304
+ dds::topic::Topic<T, dds::topic::detail::Topic>
305
+ dds::topic::detail::Topic<T>::discover_topic(
306
+ const dds::domain::DomainParticipant& dp,
307
+ const std::string& name,
308
+ const dds::core::Duration& timeout)
309
+ {
310
+ dds::topic::Topic<T> found = dds::core::null;
311
+ std::unique_ptr<dds_typeinfo_t, std::function<void(dds_typeinfo_t *)> >
312
+ type_info(org::eclipse::cyclonedds::topic::TopicTraits<T>::getTypeInfo(nullptr),
313
+ [](dds_typeinfo_t *ti) { static_cast<void>(dds_free_typeinfo(ti)); });
314
+ dds_entity_t ddsc_topic = dp.delegate()->lookup_topic(name, type_info.get(), timeout);
315
+
316
+ if (ddsc_topic <= 0) {
317
+ return dds::core::null;
318
+ }
319
+
320
+ #if 0
321
+ /* Add type_name here when non-default ones are supported. */
322
+ size_t slen = MAX_TOPIC_NAME_LEN;
323
+ char *ddsc_type_name;
324
+ ddsc_type_name = (char *)dds_alloc(slen);
325
+ dds_get_type_name(ddsc_topic, ddsc_type_name, slen);
326
+ std::string type_name = ddsc_type_name;
327
+ dds_free(ddsc_type_name);
328
+ #endif
329
+
330
+ dds_return_t ret;
331
+ dds_qos_t* ddsc_qos = dds_create_qos();
332
+ ret = dds_get_qos(ddsc_topic, ddsc_qos);
333
+ dds::topic::qos::TopicQos qos;
334
+ if (ret == DDS_RETCODE_OK) {
335
+ qos.delegate().ddsc_qos(ddsc_qos);
336
+ }
337
+ dds_delete_qos(ddsc_qos);
338
+ ISOCPP_DDSC_RESULT_CHECK_AND_THROW(ret, "Failed to get the qos from discovered topic");
339
+
340
+ /*
341
+ * The found topic could be of the wrong type. This will be indicated
342
+ * with a PreconditionNotMetError when we try to create it.
343
+ */
344
+ try {
345
+ found = dds::topic::Topic<T>(dp, name, qos);
346
+ } catch (dds::core::PreconditionNotMetError&) {
347
+ /* Ignore; just return dds::core::null */
348
+ }
349
+
350
+ return found;
351
+ }
352
+
353
+
354
+ template <typename T>
355
+ void
356
+ dds::topic::detail::Topic<T>::discover_topics(
357
+ const dds::domain::DomainParticipant& dp,
358
+ std::vector<dds::topic::Topic<T, dds::topic::detail::Topic> >& topics,
359
+ uint32_t max_size)
360
+ {
361
+ (void)dp;
362
+ (void)topics;
363
+ std::vector<dds_entity_t> ddsc_topics;
364
+ topics.clear();
365
+ /*
366
+ * Unfortunately, DomainParticipantDelegate::lookup_topics() is not
367
+ * supported yet and will throw an exception.
368
+ */
369
+ dp.delegate()->lookup_topics(topic_type_name<T>::value(), ddsc_topics, max_size);
370
+ }
371
+
372
+
373
+ template <typename T>
374
+ void dds::topic::detail::Topic<T>::on_inconsistent_topic(
375
+ dds_entity_t topic,
376
+ org::eclipse::cyclonedds::core::InconsistentTopicStatusDelegate &sd )
377
+ {
378
+ dds::core::status::InconsistentTopicStatus s ;
379
+ s.delegate() = sd ;
380
+ (void)topic;
381
+ dds::topic::Topic<T, dds::topic::detail::Topic> t = wrapper() ;
382
+
383
+ dds::topic::TopicListener<T> *l =
384
+ reinterpret_cast<dds::topic::TopicListener<T> *>(this->listener_get());
385
+ if( (l != NULL) &&
386
+ (this->get_listener_mask().to_ulong() &
387
+ dds::core::status::StatusMask::inconsistent_topic().to_ulong()) )
388
+ {
389
+ l->on_inconsistent_topic( t, s ) ;
390
+ }
391
+ }
392
+
393
+ // End of implementation
394
+
395
+ #endif /* CYCLONEDDS_DDS_TOPIC_TTOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/Topic.hpp ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2021 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ // Implementation
20
+
21
+ #include <dds/core/ref_traits.hpp>
22
+ #include <dds/topic/TopicTraits.hpp>
23
+ #include <dds/core/status/Status.hpp>
24
+ #include <dds/core/status/State.hpp>
25
+ #include <dds/domain/DomainParticipant.hpp>
26
+ #include <dds/topic/qos/TopicQos.hpp>
27
+ #include <dds/topic/AnyTopic.hpp>
28
+
29
+ #include <org/eclipse/cyclonedds/core/config.hpp>
30
+ #include <org/eclipse/cyclonedds/topic/TopicTraits.hpp>
31
+ #include <org/eclipse/cyclonedds/topic/AnyTopicDelegate.hpp>
32
+ #include <org/eclipse/cyclonedds/topic/TopicDescriptionDelegate.hpp>
33
+
34
+ #include <dds/dds.h>
35
+
36
+ namespace dds
37
+ {
38
+ namespace topic
39
+ {
40
+ template <typename T>
41
+ class TopicListener;
42
+
43
+ }
44
+ }
45
+
46
+ namespace dds
47
+ {
48
+ namespace topic
49
+ {
50
+ namespace detail
51
+ {
52
+ template <typename T>
53
+ class Topic;
54
+ }
55
+ }
56
+ }
57
+
58
+
59
+
60
+ /***************************************************************************
61
+ *
62
+ * dds/topic/detail/Topic<> DELEGATE declaration.
63
+ * Implementation can be found in dds/topic/detail/TTopicImpl.hpp
64
+ *
65
+ ***************************************************************************/
66
+ template <typename T>
67
+ class dds::topic::detail::Topic : public org::eclipse::cyclonedds::topic::AnyTopicDelegate
68
+ {
69
+ public:
70
+ typedef typename ::dds::core::smart_ptr_traits< Topic<T> >::ref_type ref_type;
71
+ typedef typename ::dds::core::smart_ptr_traits< Topic<T> >::weak_ref_type weak_ref_type;
72
+
73
+ Topic(const dds::domain::DomainParticipant& dp,
74
+ const std::string& name,
75
+ const std::string& type_name,
76
+ const dds::topic::qos::TopicQos& qos,
77
+ dds::topic::TopicListener<T>* listener,
78
+ const dds::core::status::StatusMask& mask);
79
+
80
+ Topic(const dds::domain::DomainParticipant& dp,
81
+ const std::string& name,
82
+ const std::string& type_name,
83
+ const dds::topic::qos::TopicQos& qos,
84
+ dds_entity_t ddsc_topic);
85
+
86
+ virtual ~Topic();
87
+
88
+ virtual void close();
89
+
90
+ void init(ObjectDelegate::weak_ref_type weak_ref);
91
+
92
+ dds::topic::Topic<T, dds::topic::detail::Topic> wrapper();
93
+
94
+
95
+ public:
96
+
97
+ void listener(dds::topic::TopicListener<T>* listener,
98
+ const ::dds::core::status::StatusMask& mask);
99
+
100
+ dds::topic::TopicListener<T>* listener();
101
+
102
+ virtual void listener_notify(ObjectDelegate::ref_type source,
103
+ uint32_t triggerMask,
104
+ void *eventData,
105
+ void *listener);
106
+
107
+ dds::topic::TTopicDescription<TopicDescriptionDelegate> clone();
108
+
109
+ static dds::topic::Topic<T, dds::topic::detail::Topic>
110
+ discover_topic(const dds::domain::DomainParticipant& dp,
111
+ const std::string& name,
112
+ const dds::core::Duration& timeout);
113
+
114
+ static void
115
+ discover_topics(const dds::domain::DomainParticipant& dp,
116
+ std::vector<dds::topic::Topic<T, dds::topic::detail::Topic> >& topics,
117
+ uint32_t max_size);
118
+
119
+ //using ::org::eclipse::cyclonedds::topic::AnyTopicDelegate<T>::on_inconsistent_topic;
120
+
121
+ void on_inconsistent_topic(
122
+ dds_entity_t topic,
123
+ org::eclipse::cyclonedds::core::InconsistentTopicStatusDelegate &s ) ; // !!!
124
+
125
+ private:
126
+ T sample_;
127
+ };
128
+
129
+ // End of implementation
130
+
131
+ #endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TopicDescription.hpp ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_TOPICDESCRIPTION_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_DETAIL_TOPICDESCRIPTION_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ // Implementation
20
+
21
+ #include <dds/topic/detail/TTopicDescriptionImpl.hpp>
22
+ #include <org/eclipse/cyclonedds/topic/TopicDescriptionDelegate.hpp>
23
+
24
+ namespace dds { namespace topic { namespace detail {
25
+ typedef dds::topic::TTopicDescription<org::eclipse::cyclonedds::topic::TopicDescriptionDelegate> TopicDescription;
26
+ } } }
27
+
28
+ // End of implementation
29
+
30
+ #endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_TOPICDESCRIPTION_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/TopicInstanceImpl.hpp ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_DDS_TOPIC_TOPICINSTANCE_HPP_
13
+ #define CYCLONEDDS_DDS_TOPIC_TOPICINSTANCE_HPP_
14
+
15
+ /**
16
+ * @file
17
+ */
18
+
19
+ /*
20
+ * OMG PSM class declaration
21
+ */
22
+ #include <dds/topic/TopicInstance.hpp>
23
+
24
+ // Implementation
25
+
26
+ namespace dds
27
+ {
28
+ namespace topic
29
+ {
30
+
31
+ template <typename T>
32
+ TopicInstance<T>::TopicInstance() : h_(dds::core::null) {}
33
+
34
+ template <typename T>
35
+ TopicInstance<T>::TopicInstance(const ::dds::core::InstanceHandle& h)
36
+ : h_(h), sample_() {}
37
+
38
+ template <typename T>
39
+ TopicInstance<T>::TopicInstance(const ::dds::core::InstanceHandle& h, const T& sample)
40
+ : h_(h), sample_(sample) { }
41
+
42
+ template <typename T>
43
+ TopicInstance<T>::operator const ::dds::core::InstanceHandle() const
44
+ {
45
+ return h_;
46
+ }
47
+
48
+ template <typename T>
49
+ const ::dds::core::InstanceHandle TopicInstance<T>::handle() const
50
+ {
51
+ return h_;
52
+ }
53
+
54
+ template <typename T>
55
+ void TopicInstance<T>::handle(const ::dds::core::InstanceHandle& h)
56
+ {
57
+ h_ = h;
58
+ }
59
+
60
+ template <typename T>
61
+ const T& TopicInstance<T>::sample() const
62
+ {
63
+ return sample_;
64
+ }
65
+
66
+ template <typename T>
67
+ T& TopicInstance<T>::sample()
68
+ {
69
+ return sample_;
70
+ }
71
+
72
+ template <typename T>
73
+ void TopicInstance<T>::sample(const T& sample)
74
+ {
75
+ sample_ = sample;
76
+ }
77
+
78
+ }
79
+ }
80
+
81
+ // End of implementation
82
+
83
+ #endif /* CYCLONEDDS_DDS_TOPIC_TOPICINSTANCE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/ddstopic.hpp ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef OMG_DDS_TOPIC_PACKAGE_DETAIL_INCLUDE_HPP_
13
+ #define OMG_DDS_TOPIC_PACKAGE_DETAIL_INCLUDE_HPP_
14
+
15
+ #include "dds/topic/detail/TTopicDescriptionImpl.hpp"
16
+ #include "dds/topic/detail/TTopicImpl.hpp"
17
+ #include "dds/topic/detail/TopicInstanceImpl.hpp"
18
+ #include "dds/topic/detail/TContentFilteredTopicImpl.hpp"
19
+
20
+ #endif /* OMG_DDS_TOPIC_PACKAGE_DETAIL_INCLUDE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/discovery.hpp ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_DISCOVER_HPP_
19
+ #define CYCLONEDDS_DDS_TOPIC_DETAIL_DISCOVER_HPP_
20
+
21
+ #include <dds/topic/AnyTopic.hpp>
22
+ #include <dds/topic/Topic.hpp>
23
+ #include <org/eclipse/cyclonedds/topic/discovery.hpp>
24
+
25
+ #include <string>
26
+
27
+
28
+ namespace dds
29
+ {
30
+ namespace topic
31
+ {
32
+
33
+ template <typename TOPIC>
34
+ TOPIC
35
+ discover(
36
+ const dds::domain::DomainParticipant& dp,
37
+ const std::string& topic_name,
38
+ const dds::core::Duration& timeout)
39
+ {
40
+ TOPIC t = org::eclipse::cyclonedds::topic::lookup_topic<TOPIC, typename TOPIC::DELEGATE_T>::discover(dp, topic_name, timeout);
41
+
42
+ return t;
43
+ }
44
+
45
+
46
+ template <typename ANYTOPIC, typename FwdIterator>
47
+ uint32_t
48
+ discover(
49
+ const dds::domain::DomainParticipant& dp,
50
+ FwdIterator begin,
51
+ uint32_t max_size)
52
+ {
53
+ std::vector<ANYTOPIC> list;
54
+
55
+ org::eclipse::cyclonedds::topic::lookup_topic<ANYTOPIC, typename ANYTOPIC::DELEGATE_T>::discover(dp, list, max_size);
56
+
57
+ FwdIterator fit = begin;
58
+ for (typename std::vector<ANYTOPIC>::const_iterator it = list.begin(); it != list.end(); ++it) {
59
+ *fit++ = *it;
60
+ }
61
+
62
+ return static_cast<uint32_t>(list.size());
63
+ }
64
+
65
+ template <typename ANYTOPIC, typename BinIterator>
66
+ uint32_t
67
+ discover_all(
68
+ const dds::domain::DomainParticipant& dp,
69
+ BinIterator begin)
70
+ {
71
+ std::vector<ANYTOPIC> list;
72
+
73
+ org::eclipse::cyclonedds::topic::lookup_topic<ANYTOPIC, typename ANYTOPIC::DELEGATE_T>::discover(dp, list, static_cast<uint32_t>(dds::core::LENGTH_UNLIMITED));
74
+
75
+ BinIterator bit = begin;
76
+ for (typename std::vector<ANYTOPIC>::const_iterator it = list.begin(); it != list.end(); ++it) {
77
+ *bit++ = *it;
78
+ }
79
+
80
+ return list.size();
81
+ }
82
+
83
+
84
+ template <typename FwdIterator>
85
+ void
86
+ ignore(
87
+ const dds::domain::DomainParticipant& dp,
88
+ FwdIterator begin, FwdIterator end)
89
+ {
90
+ (void)dp;
91
+ (void)begin;
92
+ (void)end;
93
+ ISOCPP_THROW_EXCEPTION(ISOCPP_UNSUPPORTED_ERROR, "Function not currently supported");
94
+ }
95
+
96
+ }
97
+ }
98
+
99
+
100
+ #endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_DISCOVER_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/detail/find.hpp ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_FIND_HPP_
19
+ #define CYCLONEDDS_DDS_TOPIC_DETAIL_FIND_HPP_
20
+
21
+
22
+ #include <org/eclipse/cyclonedds/topic/find.hpp>
23
+
24
+
25
+ #include <string>
26
+
27
+
28
+ namespace dds
29
+ {
30
+ namespace topic
31
+ {
32
+
33
+ template <typename TOPIC>
34
+ TOPIC
35
+ find(const dds::domain::DomainParticipant& dp, const std::string& topic_name)
36
+ {
37
+ TOPIC t = org::eclipse::cyclonedds::topic::finder<TOPIC, typename TOPIC::DELEGATE_T>::find(dp, topic_name);
38
+
39
+ return t;
40
+ }
41
+
42
+
43
+ }
44
+ }
45
+
46
+ #endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_FIND_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/discovery.hpp ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_DISCOVER_HPP_
2
+ #define OMG_DDS_TOPIC_DISCOVER_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Inc.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/domain/DomainParticipant.hpp>
23
+
24
+ namespace dds
25
+ {
26
+ namespace topic
27
+ {
28
+
29
+ /**
30
+ * This operation gives access to an specific existing (or ready to exist) enabled
31
+ * Topic, ContentFilteredTopic, MultiTopic, AnyTopic or TopicDescription based
32
+ * on its topic_name.
33
+ *
34
+ * Topics that the application has indicated should be 'ignored' (by means of the
35
+ * dds::topic::ignore operation) will not appear in this list (note: the ignore
36
+ * feature is not yet supported).
37
+ *
38
+ * If a Topic of the same topic_name already exists, it gives access to this Topic.
39
+ * Otherwise it waits (blocks the caller) until another mechanism creates it. This other
40
+ * mechanism can be another thread, a configuration tool, or some other Data
41
+ * Distribution Service utility. If after the specified timeout the Topic can still not be
42
+ * found, the caller gets unblocked and the returned Topic will be dds::core::null.
43
+ *
44
+ * A Topic that is obtained by means of find_topic in a specific
45
+ * DomainParticipant can only be used to create DataReaders and
46
+ * DataWriters in that DomainParticipant.
47
+ *
48
+ * This operation usually results in network look-ups.
49
+ *
50
+ * For finding only locally created Topics, look
51
+ * @link find(const dds::domain::DomainParticipant& dp, const std::string& topic_name)
52
+ * here.@endlink
53
+ *
54
+ * @param dp the DomainParticipant
55
+ * @param name the topic name to discover
56
+ * @param timeout the time out
57
+ * @throws dds::core::Error
58
+ * An internal error has occurred.
59
+ * @throws dds::core::NullReferenceError
60
+ * The DomainParticipant was not properly created and references to dds::core::null.
61
+ * @throws dds::core::AlreadyClosedError
62
+ * The DomainParticipant has already been closed.
63
+ * @throws dds::core::NotEnabledError
64
+ * The DomainParticipant has not yet been enabled.
65
+ * @throws dds::core::OutOfResourcesError
66
+ * The Data Distribution Service ran out of resources to
67
+ * complete this operation.
68
+ * @throws dds::core::TimeoutError
69
+ * No Topics of the given name found within the timeout.
70
+ */
71
+ template <typename TOPIC>
72
+ TOPIC discover(const dds::domain::DomainParticipant& dp,
73
+ const std::string& name,
74
+ const dds::core::Duration& timeout = dds::core::Duration::infinite());
75
+
76
+ /**
77
+ * This operation retrieves a list of Topics that have been discovered in the domain.
78
+ *
79
+ * If the max_size of the given list is large enough, all discovered Topics will be
80
+ * present in that list. Otherwise, a random sub-set of max_size elements is returned.
81
+ *
82
+ * Topics that the application has indicated should be 'ignored' (by means of the
83
+ * dds::topic::ignore operation) will not appear in this list (note: the ignore
84
+ * feature is not yet supported).
85
+ *
86
+ * Because Topics of various different kinds can be retrieved, the list contains
87
+ * AnyTopics.
88
+ *
89
+ * This operation usually results in network look-ups.
90
+ *
91
+ * @param dp the DomainParticipant
92
+ * @param begin a forward iterator pointing to the beginning of a container
93
+ * in which to insert the topics
94
+ * @param max_size the maximum number of topics to return
95
+ */
96
+ template <typename ANYTOPIC, typename FwdIterator>
97
+ uint32_t discover(const dds::domain::DomainParticipant& dp, FwdIterator begin, uint32_t max_size);
98
+
99
+ /**
100
+ * This operation retrieves a list of all Topics that have been discovered in the domain.
101
+ *
102
+ * Topics that the application has indicated should be 'ignored' (by means of the
103
+ * dds::topic::ignore operation) will not appear in this list (note: the ignore
104
+ * feature is not yet supported).
105
+ *
106
+ * Because Topics of various different kinds can be retrieved, the list contains
107
+ * AnyTopics.
108
+ *
109
+ * This operation usually results in network look-ups.
110
+ *
111
+ * @param dp the DomainParticipant
112
+ * @param begin a back inserting iterator pointing to the beginning of a container
113
+ * in which to insert the topics
114
+ */
115
+ template <typename ANYTOPIC, typename BinIterator>
116
+ uint32_t discover_all(const dds::domain::DomainParticipant& dp, BinIterator begin);
117
+
118
+ /**
119
+ * This operation allows an application to instruct the Service to locally ignore
120
+ * a remote domain participant. From that point onwards the Service will locally
121
+ * behave as if the remote participant did not exist. This means it will ignore any
122
+ * Topic, publication, or subscription that originates on that domain participant.
123
+ *
124
+ * <b><i>This operation is not yet implemented. It is scheduled for a future release.</i></b>
125
+ *
126
+ * @param dp the DomainParticipant
127
+ * @param handle the handle of the DomainParticipant to ignore
128
+ */
129
+ void OMG_DDS_API ignore(const dds::domain::DomainParticipant& dp, const dds::core::InstanceHandle& handle);
130
+
131
+ /**
132
+ * This operation allows an application to instruct the Service to locally ignore
133
+ * a remote domain participant. From that point onwards the Service will locally
134
+ * behave as if the remote participant did not exist. This means it will ignore any
135
+ * Topic, publication, or subscription that originates on that domain participant.
136
+ *
137
+ * <b><i>This operation is not yet implemented. It is scheduled for a future release.</i></b>
138
+ *
139
+ * @param dp the DomainParticipant
140
+ * @param begin a forward iterator pointing to the beginning of a sequence of
141
+ * InstanceHandles to ignore
142
+ * @param end a forward iterator pointing to the end of a sequence of
143
+ * InstanceHandles to ignore
144
+ */
145
+ template <typename FwdIterator>
146
+ void ignore(const dds::domain::DomainParticipant& dp, FwdIterator begin, FwdIterator end);
147
+
148
+ }
149
+ }
150
+
151
+ #include <dds/topic/detail/discovery.hpp>
152
+
153
+ #endif /* OMG_DDS_TOPIC_DISCOVER_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/find.hpp ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_FIND_HPP_
2
+ #define OMG_DDS_TOPIC_FIND_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Inc.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <string>
23
+
24
+ #include <dds/topic/detail/find.hpp>
25
+
26
+ namespace dds
27
+ {
28
+ namespace topic
29
+ {
30
+
31
+ /**
32
+ * This operation gives access to a locally-created Topic, ContentFilteredTopic,
33
+ * MultiTopic, AnyTopic and TopicDescription with a matching name.
34
+ *
35
+ * dds::topic::find will never create a Topic but returns a reference to an
36
+ * Topic proxy that already exists locally. When no local proxy exists, the
37
+ * returned Topic will be a dds::core::null object. The operation never blocks.
38
+ *
39
+ * For discovering globally available Topics, look
40
+ * @link dds::topic::discover(const dds::domain::DomainParticipant&, const std::string&, const dds::core::Duration&)
41
+ * here.@endlink
42
+ *
43
+ * @param dp the DomainParticipant to find the topic on
44
+ * @param topic_name the topic name to find
45
+ */
46
+ template <typename TOPIC>
47
+ TOPIC
48
+ find(const dds::domain::DomainParticipant& dp, const std::string& topic_name);
49
+
50
+ }
51
+ }
52
+
53
+ #endif /* OMG_DDS_TOPIC_FIND_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/qos/TopicQos.hpp ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_
2
+ #define OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/topic/qos/detail/TopicQos.hpp>
23
+
24
+ namespace dds
25
+ {
26
+ namespace topic
27
+ {
28
+ namespace qos
29
+ {
30
+ typedef dds::topic::qos::detail::TopicQos TopicQos;
31
+ }
32
+ }
33
+ }
34
+
35
+
36
+ #endif /* OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/dds/topic/qos/detail/TopicQos.hpp ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef OMG_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_
2
+ #define OMG_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_
3
+
4
+ /* Copyright 2010, Object Management Group, Inc.
5
+ * Copyright 2010, PrismTech, Corp.
6
+ * Copyright 2010, Real-Time Innovations, Inc.
7
+ * All rights reserved.
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
22
+ #include <dds/core/detail/TEntityQosImpl.hpp>
23
+ #include <org/eclipse/cyclonedds/topic/qos/TopicQosDelegate.hpp>
24
+
25
+ #ifdef DOXYGEN_FOR_ISOCPP
26
+ /* The above macro is never (and must never) be defined in normal compilation.
27
+ *
28
+ * The class below is just used to create informative API documentation.
29
+ * The predoxygen.py script will copy this over the QoS API header file.
30
+ */
31
+ /**
32
+ * @brief
33
+ * This struct provides the basic mechanism for an application to specify Quality of
34
+ * Service attributes for a Topic.
35
+ *
36
+ * @par Attributes
37
+ * @anchor anchor_dds_topic_qos_defaults
38
+ * QosPolicy | Desciption | Default Value
39
+ * ------------------------------------ | -------------------------------------------------------------------------- | --------------------
40
+ * dds::core::policy::TopicData | Additional information (@ref DCPS_QoS_TopicData "info") | TopicData::TopicData(empty)
41
+ * dds::core::policy::Durability | Data storage settings for late joiners (@ref DCPS_QoS_Durability "info") | Durability::Volatile()
42
+ * dds::core::policy::DurabilityService | Transient/persistent behaviour (@ref DCPS_QoS_DurabilityService "info") | DurabilityService::DurabilityService()
43
+ * dds::core::policy::Deadline | Period in which new sample is written (@ref DCPS_QoS_Deadline "info") | Deadline::Deadline(infinite)
44
+ * dds::core::policy::LatencyBudget | Used for optimization (@ref DCPS_QoS_LatencyBudget "info") | LatencyBudget::LatencyBudget(zero)
45
+ * dds::core::policy::Liveliness | Liveliness assertion mechanism (@ref DCPS_QoS_Liveliness "info") | Liveliness::Automatic()
46
+ * dds::core::policy::Reliability | Reliability settings (@ref DCPS_QoS_Reliability "info") | Reliability::Reliable()
47
+ * dds::core::policy::DestinationOrder | DataReader data order settings (@ref DCPS_QoS_DestinationOrder "info") | DestinationOrder::ReceptionTimestamp()
48
+ * dds::core::policy::History | Data storage settings (@ref DCPS_QoS_History "info") | History::KeepLast(depth 1)
49
+ * dds::core::policy::ResourceLimits | Maximum resource settings (@ref DCPS_QoS_ResourceLimits "info") | ResourceLimits::ResourceLimits(all unlimited)
50
+ * dds::core::policy::TransportPriority | Priority hint for transport layer (@ref DCPS_QoS_TransportPriority "info") | TransportPriority::TTransportPriority(0)
51
+ * dds::core::policy::Lifespan | Maximum duration of validity of data (@ref DCPS_QoS_Lifespan "info") | Lifespan::Lifespan(infinite)
52
+ * dds::core::policy::Ownership | Exclusive ownership or not (@ref DCPS_QoS_Ownership "info") | Ownership::Shared()
53
+ * dds::core::policy::DataRepresentation | Supported data representation kinds (@ref DCPS_QoS_DataRepresentation "info") | DataRepresentation::DataRepresentation(dds::core::policy::DataRepresentationId::XCDR1)
54
+ * dds::core::policy::TypeConsistencyEnforcement | Type consistency enforcement policies (@ref DCPS_QoS_TypeConsistencyEnforcement "info") | dds::core::policy::TypeConsistencyKind::DISALLOW_TYPE_COERCION
55
+ *
56
+ * A QosPolicy can be set when the Topic is created or modified with the set
57
+ * qos operation.
58
+ * Both operations take the TopicQos object as a parameter. There may be cases
59
+ * where several policies are in conflict. Consistency checking is performed each time
60
+ * the policies are modified when they are being created and, in case they are already
61
+ * enabled, via the set qos operation.
62
+ *
63
+ * Some QosPolicy have "immutable" semantics meaning that they can only be
64
+ * specified either at Topic creation time or prior to calling the enable
65
+ * operation on the Topic.
66
+ *
67
+ * @see for more information: @ref DCPS_QoS
68
+ */
69
+ class dds::topic::qos::TopicQos : public ::dds::core::EntityQos<org::eclipse::cyclonedds::topic::qos::TopicQosDelegate>
70
+ {
71
+ public:
72
+ /**
73
+ * Create @ref anchor_dds_topic_qos_defaults "default" QoS.
74
+ */
75
+ TopicQos() {}
76
+
77
+ /**
78
+ * Create copied QoS type.
79
+ *
80
+ * @param qos the QoS to copy policies from.
81
+ */
82
+ TopicQos(const TopicQos& qos);
83
+ };
84
+
85
+ #else /* DOXYGEN_FOR_ISOCPP */
86
+
87
+ namespace dds { namespace topic { namespace qos { namespace detail {
88
+ typedef ::dds::core::TEntityQos< ::org::eclipse::cyclonedds::topic::qos::TopicQosDelegate > TopicQos;
89
+ } } } }
90
+
91
+ #endif /* DOXYGEN_FOR_ISOCPP */
92
+
93
+ #endif /* OMG_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/ForwardDeclarations.hpp ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef LITE_FORWARD_DECLARATIONS_HPP_
19
+ #define LITE_FORWARD_DECLARATIONS_HPP_
20
+
21
+ namespace dds
22
+ {
23
+ namespace domain
24
+ {
25
+ class DomainParticipantListener;
26
+
27
+ template <typename DELEGATE>
28
+ class TDomainParticipant;
29
+ }
30
+
31
+ namespace sub
32
+ {
33
+ template <typename T, template <typename Q> class DELEGATE>
34
+ class DataReader;
35
+
36
+ template <typename T>
37
+ class DataReaderListener;
38
+
39
+ class SubscriberListener;
40
+
41
+ template <typename DELEGATE>
42
+ class TSubscriber;
43
+
44
+ namespace detail
45
+ {
46
+ template <typename T>
47
+ class DataReader;
48
+
49
+ template <typename T>
50
+ class LoanedSamplesHolder;
51
+
52
+ template <typename T, typename SamplesFWIterator>
53
+ class SamplesFWInteratorHolder;
54
+
55
+ template <typename T, typename SamplesBIIterator>
56
+ class SamplesBIIteratorHolder;
57
+ }
58
+ }
59
+
60
+ namespace pub
61
+ {
62
+ class PublisherListener;
63
+
64
+ template <typename DELEGATE>
65
+ class TPublisher;
66
+ }
67
+
68
+ namespace topic
69
+ {
70
+ template <typename DELEGATE>
71
+ class TTopicDescription;
72
+
73
+ template <typename T>
74
+ class TopicListener;
75
+
76
+ template <typename T, template <typename Q> class DELEGATE>
77
+ class Topic;
78
+
79
+ template <typename T, template <typename Q> class DELEGATE>
80
+ class ContentFilteredTopic;
81
+
82
+ namespace detail
83
+ {
84
+ template <typename T>
85
+ class ContentFilteredTopic;
86
+ }
87
+ }
88
+ }
89
+
90
+
91
+ namespace org
92
+ {
93
+ namespace eclipse
94
+ {
95
+ namespace cyclonedds
96
+ {
97
+
98
+ namespace domain {
99
+ class DomainParticipantDelegate;
100
+ }
101
+
102
+ namespace sub {
103
+ class SubscriberDelegate;
104
+ }
105
+
106
+ namespace pub {
107
+ class PublisherDelegate;
108
+ }
109
+
110
+ namespace topic {
111
+ template <class TOPIC>
112
+ class TopicTraits;
113
+
114
+ class TopicDescriptionDelegate;
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ #endif /* LITE_FORWARD_DECLARATIONS_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/DDScObjectDelegate.hpp ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_USEROBJECT_DELEGATE_HPP_
19
+ #define CYCLONEDDS_CORE_USEROBJECT_DELEGATE_HPP_
20
+
21
+ #include "dds/core/macros.hpp"
22
+ #include "dds/core/refmacros.hpp"
23
+ #include "org/eclipse/cyclonedds/core/Mutex.hpp"
24
+ #include "org/eclipse/cyclonedds/core/ObjectDelegate.hpp"
25
+
26
+ #include <unordered_map>
27
+
28
+ #include "dds/dds.h"
29
+
30
+ namespace org
31
+ {
32
+ namespace eclipse
33
+ {
34
+ namespace cyclonedds
35
+ {
36
+ namespace core
37
+ {
38
+
39
+ DDSCXX_WARNING_MSVC_OFF(4251)
40
+
41
+ class OMG_DDS_API DDScObjectDelegate : public virtual org::eclipse::cyclonedds::core::ObjectDelegate
42
+ {
43
+ public:
44
+
45
+ typedef std::unordered_map<dds_entity_t,org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type> entity_map_type;
46
+
47
+ DDScObjectDelegate ();
48
+ virtual ~DDScObjectDelegate ();
49
+
50
+ void close ();
51
+ dds_entity_t get_ddsc_entity ();
52
+ void set_ddsc_entity (dds_entity_t e);
53
+ void add_to_entity_map (org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type weak_ref);
54
+
55
+ public:
56
+ static ObjectDelegate::ref_type extract_strong_ref(dds_entity_t e);
57
+
58
+ protected:
59
+ dds_entity_t ddsc_entity;
60
+
61
+ private:
62
+ void delete_from_entity_map();
63
+ static org::eclipse::cyclonedds::core::DDScObjectDelegate::entity_map_type entity_map;
64
+ static Mutex entity_map_mutex;
65
+ };
66
+
67
+ DDSCXX_WARNING_MSVC_ON(4251)
68
+
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ #endif /* CYCLONEDDS_CORE_USEROBJECT_DELEGATE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/EntityDelegate.hpp ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_ENTITY_DELEGATE_HPP_
19
+ #define CYCLONEDDS_CORE_ENTITY_DELEGATE_HPP_
20
+
21
+ #include <dds/core/status/State.hpp>
22
+ #include <dds/core/InstanceHandle.hpp>
23
+ #include <dds/core/policy/CorePolicy.hpp>
24
+ #include <org/eclipse/cyclonedds/core/DDScObjectDelegate.hpp>
25
+ #include <org/eclipse/cyclonedds/ForwardDeclarations.hpp>
26
+ #include <org/eclipse/cyclonedds/core/status/StatusDelegate.hpp>
27
+
28
+ namespace org
29
+ {
30
+ namespace eclipse
31
+ {
32
+ namespace cyclonedds
33
+ {
34
+ namespace core
35
+ {
36
+
37
+ class OMG_DDS_API EntityDelegate :
38
+ public virtual ::org::eclipse::cyclonedds::core::DDScObjectDelegate
39
+ {
40
+ public:
41
+ typedef ::dds::core::smart_ptr_traits< EntityDelegate >::ref_type ref_type;
42
+ typedef ::dds::core::smart_ptr_traits< EntityDelegate >::weak_ref_type weak_ref_type;
43
+
44
+ EntityDelegate();
45
+ virtual ~EntityDelegate();
46
+
47
+ /**
48
+ * @internal Enables this entity.
49
+ */
50
+ void enable();
51
+
52
+ ::dds::core::status::StatusMask status_changes() const;
53
+
54
+ ::dds::core::InstanceHandle instance_handle() const;
55
+
56
+ bool contains_entity(const ::dds::core::InstanceHandle& handle);
57
+
58
+ ObjectDelegate::ref_type get_statusCondition();
59
+
60
+ virtual void close();
61
+
62
+ virtual void retain();
63
+
64
+ void *listener_get() const;
65
+
66
+ protected:
67
+ void listener_set(void *listener,
68
+ const dds::core::status::StatusMask& mask);
69
+
70
+ public:
71
+ const dds::core::status::StatusMask get_listener_mask() const ;
72
+
73
+ bool obtain_callback_lock() ;
74
+ void release_callback_lock() ;
75
+
76
+ // Topic callback
77
+ virtual void on_inconsistent_topic(dds_entity_t topic,
78
+ org::eclipse::cyclonedds::core::InconsistentTopicStatusDelegate &) ;
79
+
80
+
81
+ // Writer callbacks
82
+ virtual void on_offered_deadline_missed(dds_entity_t writer,
83
+ org::eclipse::cyclonedds::core::OfferedDeadlineMissedStatusDelegate &) ;
84
+
85
+ virtual void on_offered_incompatible_qos(dds_entity_t writer,
86
+ org::eclipse::cyclonedds::core::OfferedIncompatibleQosStatusDelegate &) ;
87
+
88
+ virtual void on_liveliness_lost(dds_entity_t writer,
89
+ org::eclipse::cyclonedds::core::LivelinessLostStatusDelegate &) ;
90
+
91
+ virtual void on_publication_matched(dds_entity_t writer,
92
+ org::eclipse::cyclonedds::core::PublicationMatchedStatusDelegate &) ;
93
+
94
+
95
+ // Reader callbacks
96
+ virtual void on_requested_deadline_missed(dds_entity_t reader,
97
+ org::eclipse::cyclonedds::core::RequestedDeadlineMissedStatusDelegate &);
98
+
99
+ virtual void on_requested_incompatible_qos(dds_entity_t reader,
100
+ org::eclipse::cyclonedds::core::RequestedIncompatibleQosStatusDelegate &);
101
+
102
+ virtual void on_sample_rejected(dds_entity_t reader,
103
+ org::eclipse::cyclonedds::core::SampleRejectedStatusDelegate &);
104
+
105
+ virtual void on_liveliness_changed(dds_entity_t reader,
106
+ org::eclipse::cyclonedds::core::LivelinessChangedStatusDelegate &);
107
+
108
+ virtual void on_data_available(dds_entity_t reader);
109
+
110
+ virtual void on_subscription_matched(dds_entity_t reader,
111
+ org::eclipse::cyclonedds::core::SubscriptionMatchedStatusDelegate &);
112
+
113
+ virtual void on_sample_lost(dds_entity_t reader,
114
+ org::eclipse::cyclonedds::core::SampleLostStatusDelegate &);
115
+
116
+
117
+ // Subscriber callback
118
+ virtual void on_data_readers(dds_entity_t subscriber);
119
+
120
+ protected:
121
+ static volatile unsigned int entityID_;
122
+ bool enabled_;
123
+ dds::core::status::StatusMask listener_mask;
124
+ void prevent_callbacks();
125
+ long callback_count;
126
+ dds_listener_t *listener_callbacks;
127
+
128
+ private:
129
+ void *listener;
130
+ ObjectDelegate::weak_ref_type myStatusCondition;
131
+ void *callback_mutex;
132
+ void *callback_cond;
133
+ };
134
+
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ #endif /* CYCLONEDDS_CORE_ENTITY_DELEGATE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/EntityRegistry.hpp ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_ENTITY_REGISTRY_HPP_
19
+ #define CYCLONEDDS_CORE_ENTITY_REGISTRY_HPP_
20
+
21
+ #include <dds/core/detail/WeakReferenceImpl.hpp>
22
+ #include <org/eclipse/cyclonedds/core/Mutex.hpp>
23
+
24
+ #include <map>
25
+
26
+ namespace org
27
+ {
28
+ namespace eclipse
29
+ {
30
+ namespace cyclonedds
31
+ {
32
+ namespace core
33
+ {
34
+
35
+ template <typename T, typename U>
36
+ class EntityRegistry
37
+ {
38
+ public:
39
+ /**
40
+ * @internal Inserts a EntityDelegate key, dds::core::Entity value pair into the registry.
41
+ * @param key The org::eclipse::cyclonedds::core::Entity to use as a key
42
+ * @param val The dds::core::Entity that encapsulates the key
43
+ */
44
+ void insert(T key, U& val)
45
+ {
46
+ mutex.lock();
47
+ registry[key] = dds::core::WeakReference<U>(val);
48
+ mutex.unlock();
49
+ }
50
+
51
+ /**
52
+ * @internal Removes a DDS::Entity from the registry
53
+ * @param key Entity to remove
54
+ */
55
+ void remove(T key)
56
+ {
57
+ mutex.lock();
58
+ registry.erase(key);
59
+ mutex.unlock();
60
+ }
61
+
62
+ /**
63
+ * @internal Checks the registry for a dds::core::Entity that wraps the supplied DDS::Entity
64
+ * and returns it. If no match is found dds::core::null is returned.
65
+ * @param key DDS::Entity to find an encapsulating dds::core:Entity for.
66
+ * @return dds::core::Entity if a match is found, dds::core::null if not.
67
+ */
68
+ U get(T key)
69
+ {
70
+ typename std::map<T, dds::core::WeakReference<U> >::iterator it;
71
+
72
+ mutex.lock();
73
+ it = registry.find(key);
74
+
75
+ U entity(dds::core::null);
76
+ if(it != registry.end())
77
+ {
78
+ entity = it->second.lock();
79
+ }
80
+ mutex.unlock();
81
+
82
+ return entity;
83
+ }
84
+
85
+ private:
86
+ std::map<T, dds::core::WeakReference<U> > registry;
87
+ org::eclipse::cyclonedds::core::Mutex mutex;
88
+ };
89
+
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ #endif /* CYCLONEDDS_CORE_ENTITY_REGISTRY_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/EntitySet.hpp ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_ENTITY_SET_HPP_
19
+ #define CYCLONEDDS_CORE_ENTITY_SET_HPP_
20
+
21
+ #include <dds/core/InstanceHandle.hpp>
22
+
23
+ #include <org/eclipse/cyclonedds/core/EntityDelegate.hpp>
24
+ #include <org/eclipse/cyclonedds/core/Mutex.hpp>
25
+ #include <org/eclipse/cyclonedds/core/WeakReferenceSet.hpp>
26
+
27
+ #include <vector>
28
+ #include <memory>
29
+ #include <set>
30
+
31
+ namespace org
32
+ {
33
+ namespace eclipse
34
+ {
35
+ namespace cyclonedds
36
+ {
37
+ namespace core
38
+ {
39
+
40
+ class EntitySet
41
+ {
42
+ public:
43
+ typedef std::vector<org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type>::iterator vectorIterator;
44
+ typedef std::vector<org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type> vector;
45
+
46
+ /**
47
+ * @internal Inserts a EntityDelegate into the set.
48
+ * @param entity The org::eclipse::cyclonedds::core::EntityDelegate to store
49
+ */
50
+ void insert(org::eclipse::cyclonedds::core::EntityDelegate& entity);
51
+
52
+ /**
53
+ * @internal Erases a EntityDelegate from the set.
54
+ * @param entity The org::eclipse::cyclonedds::core::EntityDelegate to delete
55
+ */
56
+ void erase(org::eclipse::cyclonedds::core::EntityDelegate& entity);
57
+
58
+ /**
59
+ * @internal Check if Entity with specific handle is part of the set.
60
+ * @param handle The dds::core::InstanceHandle to search for
61
+ */
62
+ bool contains(const dds::core::InstanceHandle& handle);
63
+
64
+ /**
65
+ * @internal Call close() of all the Entities within the set (outside lock).
66
+ */
67
+ void all_close();
68
+
69
+ /**
70
+ * @internal Call retain() of all the Entities within the set (outside lock).
71
+ */
72
+ void all_retain();
73
+
74
+ /**
75
+ * @internal Call enable() of all the Entities within the set (outside lock).
76
+ */
77
+ void all_enable();
78
+
79
+ /**
80
+ * @internal Copy internal set into a vector.
81
+ */
82
+ vector copy();
83
+
84
+ private:
85
+ WeakReferenceSet<ObjectDelegate::weak_ref_type>::wset entities;
86
+ Mutex mutex;
87
+ };
88
+
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ #endif /* CYCLONEDDS_CORE_ENTITY_SET_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/InstanceHandleDelegate.hpp ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2021 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_INSTANCE_HANDLE_HPP_
19
+ #define CYCLONEDDS_CORE_INSTANCE_HANDLE_HPP_
20
+
21
+ #include <dds/core/types.hpp>
22
+ #include <org/eclipse/cyclonedds/core/config.hpp>
23
+ #include <dds/dds.h>
24
+
25
+ namespace org
26
+ {
27
+ namespace eclipse
28
+ {
29
+ namespace cyclonedds
30
+ {
31
+ namespace core
32
+ {
33
+ class InstanceHandleDelegate;
34
+ }
35
+ }
36
+ }
37
+ }
38
+
39
+ class OMG_DDS_API org::eclipse::cyclonedds::core::InstanceHandleDelegate
40
+ {
41
+ public:
42
+ InstanceHandleDelegate();
43
+ InstanceHandleDelegate(dds_instance_handle_t h);
44
+ public:
45
+ InstanceHandleDelegate(const dds::core::null_type& src);
46
+
47
+ public:
48
+ bool operator==(const InstanceHandleDelegate& that) const;
49
+
50
+ bool operator<(const InstanceHandleDelegate& that) const;
51
+
52
+ bool operator>(const InstanceHandleDelegate& that) const;
53
+
54
+ InstanceHandleDelegate& operator=(const dds::core::null_type& src);
55
+ bool is_nil() const;
56
+
57
+ public:
58
+ dds_instance_handle_t handle() const;
59
+
60
+ private:
61
+ dds_instance_handle_t handle_;
62
+ };
63
+
64
+ inline std::ostream&
65
+ operator << (std::ostream& os,
66
+ const org::eclipse::cyclonedds::core::InstanceHandleDelegate& h)
67
+ {
68
+ os << h.handle();
69
+ return os;
70
+ }
71
+ #endif /* CYCLONEDDS_CORE_INSTANCE_HANDLE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ListenerDispatcher.hpp ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+ #ifndef CYCLONEDDS_CORE_LISTENERDISPATCHER_H_
13
+ #define CYCLONEDDS_CORE_LISTENERDISPATCHER_H_
14
+
15
+ #include "dds/dds.h"
16
+
17
+ extern "C"
18
+ {
19
+ extern OMG_DDS_API void callback_on_inconsistent_topic
20
+ (dds_entity_t topic, dds_inconsistent_topic_status_t status, void* arg);
21
+
22
+ extern OMG_DDS_API void callback_on_offered_deadline_missed
23
+ (dds_entity_t writer, dds_offered_deadline_missed_status_t status, void* arg);
24
+
25
+ extern OMG_DDS_API void callback_on_offered_incompatible_qos
26
+ (dds_entity_t writer, dds_offered_incompatible_qos_status_t status, void* arg);
27
+
28
+ extern OMG_DDS_API void callback_on_liveliness_lost
29
+ (dds_entity_t writer, dds_liveliness_lost_status_t status, void* arg);
30
+
31
+ extern OMG_DDS_API void callback_on_publication_matched
32
+ (dds_entity_t writer, dds_publication_matched_status_t status, void* arg);
33
+
34
+ extern OMG_DDS_API void callback_on_requested_deadline_missed
35
+ (dds_entity_t reader, dds_requested_deadline_missed_status_t status, void* arg);
36
+
37
+ extern OMG_DDS_API void callback_on_requested_incompatible_qos
38
+ (dds_entity_t reader, dds_requested_incompatible_qos_status_t status, void* arg);
39
+
40
+ extern OMG_DDS_API void callback_on_sample_rejected
41
+ (dds_entity_t reader, dds_sample_rejected_status_t status, void* arg);
42
+
43
+ extern OMG_DDS_API void callback_on_liveliness_changed
44
+ (dds_entity_t reader, dds_liveliness_changed_status_t status, void* arg);
45
+
46
+ extern OMG_DDS_API void callback_on_data_available (dds_entity_t reader, void* arg);
47
+
48
+ extern OMG_DDS_API void callback_on_subscription_matched
49
+ (dds_entity_t reader, dds_subscription_matched_status_t status, void* arg);
50
+
51
+ extern OMG_DDS_API void callback_on_sample_lost
52
+ (dds_entity_t reader, dds_sample_lost_status_t status, void* arg);
53
+
54
+ extern OMG_DDS_API void callback_on_data_readers (dds_entity_t subscriber, void* arg);
55
+ }
56
+
57
+ #endif /* CYCLONEDDS_CORE_LISTENERDISPATCHER_H_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/MiscUtils.hpp ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_MISC_UTILS_HPP_
19
+ #define CYCLONEDDS_CORE_MISC_UTILS_HPP_
20
+
21
+ #include <dds/core/ddscore.hpp>
22
+ #include <org/eclipse/cyclonedds/core/Mutex.hpp>
23
+ #include "dds/dds.h"
24
+
25
+ #define STATUS_MASK_CONTAINS(mask,check) ((mask & check) == check)
26
+
27
+ namespace org
28
+ {
29
+ namespace eclipse
30
+ {
31
+ namespace cyclonedds
32
+ {
33
+ namespace core
34
+ {
35
+
36
+ void
37
+ convertByteSeq(
38
+ const dds::core::ByteSeq &from,
39
+ void*& to,
40
+ int32_t size);
41
+
42
+ void
43
+ convertByteSeq(
44
+ const void* from,
45
+ const int32_t size,
46
+ dds::core::ByteSeq &to);
47
+
48
+ void
49
+ convertStringSeq(
50
+ const dds::core::StringSeq &from,
51
+ char **&to);
52
+
53
+ void
54
+ convertStringSeq(
55
+ char **from,
56
+ uint32_t size,
57
+ dds::core::StringSeq &to);
58
+
59
+ dds::core::Duration
60
+ convertDuration(
61
+ const dds_duration_t &from);
62
+
63
+ dds_duration_t
64
+ convertDuration(
65
+ const dds::core::Duration &from);
66
+
67
+ dds::core::Time
68
+ convertTime(
69
+ const dds_time_t &from);
70
+
71
+ dds_time_t
72
+ convertTime(
73
+ const dds::core::Time &from);
74
+
75
+ dds::core::status::StatusMask
76
+ convertStatusMask(
77
+ const uint32_t from);
78
+
79
+ uint32_t
80
+ convertStatusMask(
81
+ const dds::core::status::StatusMask &from);
82
+
83
+ static Mutex gpb_mutex;
84
+
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ #endif //CYCLONEDDS_CORE_MISC_UTILS_HPP_
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/Missing.hpp ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2022 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_MISSING_HPP_
19
+ #define CYCLONEDDS_CORE_MISSING_HPP_
20
+
21
+ //since these helpers are only introduced from c++14 onwards
22
+
23
+ #if __cplusplus < 201402L
24
+ namespace std {
25
+ template< bool B, class T, class F >
26
+ using conditional_t = typename std::conditional<B, T, F>::type;
27
+
28
+ template<bool cond, class T = void>
29
+ using enable_if_t = typename std::enable_if<cond, T>::type;
30
+
31
+ template<class T = void>
32
+ using decay_t = typename std::decay<T>::type;
33
+ }
34
+ #endif /* _cplusplus */
35
+
36
+ #endif /* CYCLONEDDS_CORE_MISSING_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/Mutex.hpp ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_MUTEX_HPP_
19
+ #define CYCLONEDDS_CORE_MUTEX_HPP_
20
+
21
+ #include <dds/core/macros.hpp>
22
+
23
+ namespace org
24
+ {
25
+ namespace eclipse
26
+ {
27
+ namespace cyclonedds
28
+ {
29
+ namespace core
30
+ {
31
+
32
+ class OMG_DDS_API Mutex
33
+ {
34
+ public:
35
+ Mutex();
36
+ virtual ~Mutex();
37
+
38
+ void lock() const;
39
+ bool try_lock() const;
40
+ void unlock() const;
41
+ private:
42
+ void* mtx;
43
+ };
44
+
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+
51
+ #endif /* CYCLONEDDS_CORE_MUTEX_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ObjectDelegate.hpp ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_OBJECT_DELEGATE_HPP_
19
+ #define CYCLONEDDS_CORE_OBJECT_DELEGATE_HPP_
20
+
21
+ #include "dds/core/macros.hpp"
22
+ #include "dds/core/refmacros.hpp"
23
+ #include "org/eclipse/cyclonedds/core/Mutex.hpp"
24
+
25
+ namespace org
26
+ {
27
+ namespace eclipse
28
+ {
29
+ namespace cyclonedds
30
+ {
31
+ namespace core
32
+ {
33
+
34
+ DDSCXX_WARNING_MSVC_OFF(4251)
35
+
36
+ class OMG_DDS_API ObjectDelegate
37
+ {
38
+ public:
39
+
40
+ typedef ::dds::core::smart_ptr_traits< ObjectDelegate >::ref_type ref_type;
41
+ typedef ::dds::core::smart_ptr_traits< ObjectDelegate >::weak_ref_type weak_ref_type;
42
+
43
+ ObjectDelegate ();
44
+ virtual ~ObjectDelegate ();
45
+
46
+ virtual void close ();
47
+ void lock() const;
48
+ void unlock() const;
49
+
50
+ virtual void init (ObjectDelegate::weak_ref_type weak_ref) = 0;
51
+ ObjectDelegate::weak_ref_type get_weak_ref () const;
52
+ ObjectDelegate::ref_type get_strong_ref () const;
53
+
54
+ protected:
55
+
56
+ void check () const;
57
+ void set_weak_ref (ObjectDelegate::weak_ref_type weak_ref);
58
+
59
+ Mutex mutex;
60
+ bool closed;
61
+ ObjectDelegate::weak_ref_type myself;
62
+ };
63
+
64
+ DDSCXX_WARNING_MSVC_ON(4251)
65
+
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ #endif /* CYCLONEDDS_CORE_OBJECT_DELEGATE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ObjectSet.hpp ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_OBJECT_SET_HPP_
19
+ #define CYCLONEDDS_CORE_OBJECT_SET_HPP_
20
+
21
+ #include <dds/core/InstanceHandle.hpp>
22
+
23
+ #include <org/eclipse/cyclonedds/core/ObjectDelegate.hpp>
24
+ #include <org/eclipse/cyclonedds/core/Mutex.hpp>
25
+ #include <org/eclipse/cyclonedds/core/WeakReferenceSet.hpp>
26
+
27
+ #include <vector>
28
+ #include <memory>
29
+ #include <set>
30
+
31
+
32
+ namespace org
33
+ {
34
+ namespace eclipse
35
+ {
36
+ namespace cyclonedds
37
+ {
38
+ namespace core
39
+ {
40
+
41
+ class ObjectSet
42
+ {
43
+ public:
44
+ typedef std::set<org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type>::iterator setIterator;
45
+ typedef std::vector<org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type>::iterator vectorIterator;
46
+ typedef std::vector<org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type> vector;
47
+
48
+ /**
49
+ * @internal Inserts a EntityDelegate into the set.
50
+ * @param obj The org::eclipse::cyclonedds::core::ObjectDelegate to store
51
+ */
52
+ void insert(org::eclipse::cyclonedds::core::ObjectDelegate& obj);
53
+
54
+ /**
55
+ * @internal Erases a EntityDelegate from the set.
56
+ * @param obj The org::eclipse::cyclonedds::core::ObjectDelegate to delete
57
+ */
58
+ void erase(org::eclipse::cyclonedds::core::ObjectDelegate& obj);
59
+
60
+ /**
61
+ * @internal Call close() of all the Objects within the set (outside lock).
62
+ */
63
+ void all_close();
64
+
65
+ /**
66
+ * @internal Copy internal set into a vector.
67
+ */
68
+ vector copy();
69
+
70
+ private:
71
+ WeakReferenceSet<ObjectDelegate::weak_ref_type>::wset objects;
72
+ Mutex mutex;
73
+ };
74
+
75
+ }
76
+ }
77
+ }
78
+ }
79
+
80
+ #endif /* CYCLONEDDS_CORE_OBJECT_SET_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/QosProviderDelegate.hpp ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_QOSPROVIDERDELEGATE_HPP_
19
+ #define CYCLONEDDS_CORE_QOSPROVIDERDELEGATE_HPP_
20
+
21
+ #include <dds/domain/qos/DomainParticipantQos.hpp>
22
+ #include <dds/topic/qos/TopicQos.hpp>
23
+ #include <dds/sub/qos/SubscriberQos.hpp>
24
+ #include <dds/sub/qos/DataReaderQos.hpp>
25
+ #include <dds/pub/qos/PublisherQos.hpp>
26
+ #include <dds/pub/qos/DataWriterQos.hpp>
27
+
28
+ #if 0
29
+ C_CLASS(cmn_qosProvider);
30
+ C_CLASS(cmn_qosProviderInputAttr);
31
+ #endif
32
+
33
+ namespace org
34
+ {
35
+ namespace eclipse
36
+ {
37
+ namespace cyclonedds
38
+ {
39
+ namespace core
40
+ {
41
+ class QosProviderDelegate;
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ class OMG_DDS_API org::eclipse::cyclonedds::core::QosProviderDelegate
48
+ {
49
+ public:
50
+ QosProviderDelegate(const std::string& uri, const std::string& id = "");
51
+
52
+ ~QosProviderDelegate();
53
+
54
+ dds::domain::qos::DomainParticipantQos
55
+ participant_qos(const char* id);
56
+
57
+ dds::topic::qos::TopicQos
58
+ topic_qos(const char* id);
59
+
60
+ dds::sub::qos::SubscriberQos
61
+ subscriber_qos(const char* id);
62
+
63
+ dds::sub::qos::DataReaderQos
64
+ datareader_qos(const char* id);
65
+
66
+ dds::pub::qos::PublisherQos
67
+ publisher_qos(const char* id);
68
+
69
+ dds::pub::qos::DataWriterQos
70
+ datawriter_qos(const char* id);
71
+
72
+ private:
73
+ template <typename FROM, typename TO>
74
+ static void named_qos__copyOut(void *from, void *to);
75
+ #if 0
76
+ cmn_qosProvider qosProvider;
77
+ static const C_STRUCT(cmn_qosProviderInputAttr) qosProviderAttr;
78
+ #endif
79
+ };
80
+
81
+ #endif /* CYCLONEDDS_CORE_QOSPROVIDERDELEGATE_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ReportUtils.hpp ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_REPORT_UTILS_HPP_
19
+ #define CYCLONEDDS_CORE_REPORT_UTILS_HPP_
20
+
21
+ #include <string>
22
+ #include <sstream>
23
+ #include <org/eclipse/cyclonedds/core/config.hpp>
24
+ #include <dds/core/Exception.hpp>
25
+ #include <dds/dds.h>
26
+ #include <ios>
27
+ #include <stdarg.h>
28
+
29
+ //#define _OS_WARNING 2
30
+ //#define _OS_ERROR 4
31
+
32
+ #define ISOCPP_ERROR org::eclipse::cyclonedds::core::utils::error_code
33
+ #define ISOCPP_UNSUPPORTED_ERROR org::eclipse::cyclonedds::core::utils::unsupported_error_code
34
+ #define ISOCPP_INVALID_ARGUMENT_ERROR org::eclipse::cyclonedds::core::utils::invalid_argument_code
35
+ #define ISOCPP_PRECONDITION_NOT_MET_ERROR org::eclipse::cyclonedds::core::utils::precondition_not_met_error_code
36
+ #define ISOCPP_OUT_OF_RESOURCES_ERROR org::eclipse::cyclonedds::core::utils::out_of_resources_error_code
37
+ #define ISOCPP_NOT_ENABLED_ERROR org::eclipse::cyclonedds::core::utils::not_enabled_error_code
38
+ #define ISOCPP_IMMUTABLE_POLICY_ERROR org::eclipse::cyclonedds::core::utils::immutable_policy_error_code
39
+ #define ISOCPP_INCONSISTENT_POLICY_ERROR org::eclipse::cyclonedds::core::utils::inconsistent_policy_error_code
40
+ #define ISOCPP_ALREADY_CLOSED_ERROR org::eclipse::cyclonedds::core::utils::already_closed_error_code
41
+ #define ISOCPP_TIMEOUT_ERROR org::eclipse::cyclonedds::core::utils::timeout_error_code
42
+ #define ISOCPP_NO_DATA_ERROR org::eclipse::cyclonedds::core::utils::no_data_error_code
43
+ #define ISOCPP_ILLEGAL_OPERATION_ERROR org::eclipse::cyclonedds::core::utils::illegal_operation_error_code
44
+ #define ISOCPP_NULL_REFERENCE_ERROR org::eclipse::cyclonedds::core::utils::null_reference_error_code
45
+
46
+ /* \brief OS_FUNCTION provides undecorated function name of current function
47
+ *
48
+ * Behavior of OS_FUNCTION outside a function is undefined. Note that
49
+ * implementations differ across compilers and compiler versions. It might be
50
+ * implemented as either a string literal or a constant variable.
51
+ */
52
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
53
+ # define OS_FUNCTION __func__
54
+ #elif defined(__cplusplus) && (__cplusplus >= 201103)
55
+ # define OS_FUNCTION __func__
56
+ #elif defined(__GNUC__)
57
+ # define OS_FUNCTION __FUNCTION__
58
+ #elif defined(__clang__)
59
+ # define OS_FUNCTION __FUNCTION__
60
+ #elif defined(__ghs__)
61
+ # define OS_FUNCTION __FUNCTION__
62
+ #elif (defined(__SUNPRO_C) || defined(__SUNPRO_CC))
63
+ /* Solaris Studio had support for __func__ before it supported __FUNCTION__.
64
+ Compiler flag -features=extensions is required on older versions. */
65
+ # define OS_FUNCTION __func__
66
+ #elif defined(__FUNCTION__)
67
+ /* Visual Studio */
68
+ # define OS_FUNCTION __FUNCTION__
69
+ #elif defined(__vxworks)
70
+ /* At least versions 2.9.6 and 3.3.4 of the GNU C Preprocessor only define
71
+ __GNUC__ if the entire GNU C compiler is in use. VxWorks 5.5 targets invoke
72
+ the preprocessor separately resulting in __GNUC__ not being defined. */
73
+ # define OS_FUNCTION __FUNCTION__
74
+ #else
75
+ # warning "OS_FUNCTION is not supported"
76
+ #endif
77
+
78
+ /* \brief OS_PRETTY_FUNCTION provides function signature of current function
79
+ *
80
+ * See comments on OS_FUNCTION for details.
81
+ */
82
+ #if defined(__GNUC__)
83
+ # define OS_PRETTY_FUNCTION __PRETTY_FUNCTION__
84
+ #elif defined(__clang__)
85
+ # define OS_PRETTY_FUNCTION __PRETTY_FUNCTION__
86
+ #elif defined(__ghs__)
87
+ # define OS_PRETTY_FUNCTION __PRETTY_FUNCTION__
88
+ #elif (defined(__SUNPRO_C) && __SUNPRO_C >= 0x5100)
89
+ /* Solaris Studio supports __PRETTY_FUNCTION__ in C since version 12.1 */
90
+ # define OS_PRETTY_FUNCTION __PRETTY_FUNCTION__
91
+ #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5120)
92
+ /* Solaris Studio supports __PRETTY_FUNCTION__ in C++ since version 12.3 */
93
+ # define OS_PRETTY_FUNCTION __PRETTY_FUNCTION__
94
+ #elif defined(__FUNCSIG__)
95
+ /* Visual Studio */
96
+ # define OS_PRETTY_FUNCTION __FUNCSIG__
97
+ #elif defined(__vxworks)
98
+ /* See comments on __vxworks macro above. */
99
+ # define OS_PRETTY_FUNCTION __PRETTY_FUNCTION__
100
+ #else
101
+ /* Do not warn user about OS_PRETTY_FUNCTION falling back to OS_FUNCTION.
102
+ # warning "OS_PRETTY_FUNCTION is not supported, using OS_FUNCTION"
103
+ */
104
+ # define OS_PRETTY_FUNCTION OS_FUNCTION
105
+ #endif
106
+
107
+ #define ISOCPP_DDSC_RESULT_CHECK_AND_THROW(code, ...) \
108
+ org::eclipse::cyclonedds::core::utils::check_ddsc_result_and_throw_exception( \
109
+ static_cast<dds_return_t>(code), \
110
+ __FILE__, \
111
+ __LINE__, \
112
+ OS_PRETTY_FUNCTION, \
113
+ __VA_ARGS__) \
114
+
115
+ #define ISOCPP_THROW_EXCEPTION(code, ...) \
116
+ org::eclipse::cyclonedds::core::utils::throw_exception( \
117
+ (code), \
118
+ __FILE__, \
119
+ __LINE__, \
120
+ OS_PRETTY_FUNCTION, \
121
+ __VA_ARGS__) \
122
+
123
+ #define ISOCPP_BOOL_CHECK_AND_THROW(test, code, ...) \
124
+ if (!(test)) { \
125
+ ISOCPP_THROW_EXCEPTION(code, __VA_ARGS__); \
126
+ }
127
+
128
+
129
+
130
+ namespace org
131
+ {
132
+ namespace eclipse
133
+ {
134
+ namespace cyclonedds
135
+ {
136
+ namespace core
137
+ {
138
+ namespace utils
139
+ {
140
+
141
+ const int32_t error_code = 1;
142
+ const int32_t unsupported_error_code = 2;
143
+ const int32_t invalid_argument_code = 3;
144
+ const int32_t precondition_not_met_error_code = 4;
145
+ const int32_t out_of_resources_error_code = 5;
146
+ const int32_t not_enabled_error_code = 6;
147
+ const int32_t immutable_policy_error_code = 7;
148
+ const int32_t inconsistent_policy_error_code = 8;
149
+ const int32_t already_closed_error_code = 9;
150
+ const int32_t timeout_error_code = 10;
151
+ const int32_t no_data_error_code = 11;
152
+ const int32_t illegal_operation_error_code = 12;
153
+ const int32_t null_reference_error_code = 13;
154
+
155
+
156
+
157
+ OMG_DDS_API void
158
+ report(
159
+ int32_t code,
160
+ int32_t reportType,
161
+ const char *file,
162
+ int32_t line,
163
+ const char *signature,
164
+ const char *format,
165
+ ...);
166
+
167
+ OMG_DDS_API void
168
+ throw_exception(
169
+ int32_t code,
170
+ const char *file,
171
+ int32_t line,
172
+ const char *signature,
173
+ const char *format,
174
+ ...);
175
+
176
+ OMG_DDS_API void
177
+ check_ddsc_result_and_throw_exception(
178
+ dds_return_t code,
179
+ const char *file,
180
+ int32_t line,
181
+ const char *signature,
182
+ const char *format,
183
+ ...);
184
+
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+
191
+ #endif /* CYCLONEDDS_CORE_REPORT_UTILS_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/ScopedLock.hpp ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ */
17
+
18
+ #ifndef CYCLONEDDS_CORE_SCOPEDLOCK_HPP_
19
+ #define CYCLONEDDS_CORE_SCOPEDLOCK_HPP_
20
+
21
+ #include <org/eclipse/cyclonedds/core/Mutex.hpp>
22
+ #include <org/eclipse/cyclonedds/core/ObjectDelegate.hpp>
23
+
24
+ #include <cassert>
25
+
26
+ namespace org
27
+ {
28
+ namespace eclipse
29
+ {
30
+ namespace cyclonedds
31
+ {
32
+ namespace core
33
+ {
34
+
35
+ template <typename LOCKABLE>
36
+ class OMG_DDS_API ScopedLock
37
+ {
38
+ public:
39
+ ScopedLock(const LOCKABLE& obj, bool lock = true)
40
+ : lockable(obj),
41
+ owner(lock)
42
+ {
43
+ if (lock) {
44
+ lockable.lock();
45
+ }
46
+ }
47
+
48
+ virtual ~ScopedLock()
49
+ {
50
+ if (owner) {
51
+ try {
52
+ lockable.unlock();
53
+ } catch (...) {
54
+ /* Don't know what to do anymore (it should have never failed)... */
55
+ assert(false);
56
+ }
57
+ }
58
+ }
59
+
60
+ void lock()
61
+ {
62
+ assert(!owner);
63
+ lockable.lock();
64
+ owner = true;
65
+ }
66
+
67
+ bool try_lock()
68
+ {
69
+ bool locked;
70
+ locked = lockable.try_lock();
71
+ if (locked) {
72
+ owner = true;
73
+ }
74
+ return locked;
75
+ }
76
+
77
+ void unlock()
78
+ {
79
+ assert(owner);
80
+ owner = false;
81
+ lockable.unlock();
82
+ }
83
+
84
+ bool own() const
85
+ {
86
+ return owner;
87
+ }
88
+
89
+ private:
90
+ const LOCKABLE& lockable;
91
+ bool owner;
92
+ };
93
+
94
+ typedef ScopedLock<Mutex> ScopedMutexLock;
95
+ typedef ScopedLock<ObjectDelegate> ScopedObjectLock;
96
+
97
+ }
98
+ }
99
+ }
100
+ }
101
+
102
+
103
+ #endif /* CYCLONEDDS_CORE_SCOPEDLOCK_HPP_ */
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/ddscxx/org/eclipse/cyclonedds/core/TimeHelper.hpp ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7
+ * v. 1.0 which is available at
8
+ * http://www.eclipse.org/org/documents/edl-v10.php.
9
+ *
10
+ * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11
+ */
12
+
13
+
14
+ /**
15
+ * @file
16
+ *
17
+ * Unfortunately, we need this because we can not change the Duration.hpp and Time.hpp
18
+ * and we don't want this piece of code repeated in every function within their
19
+ * implementation files.
20
+ */
21
+
22
+ #ifndef CYCLONEDDS_CORE_TIME_HELPER_HPP_
23
+ #define CYCLONEDDS_CORE_TIME_HELPER_HPP_
24
+
25
+ #include <sstream>
26
+ #include <dds/dds.h>
27
+ #include <org/eclipse/cyclonedds/core/ReportUtils.hpp>
28
+
29
+ #define MS 1000
30
+ #define MiS 1000000
31
+ #define NS 1000000000
32
+
33
+ namespace org
34
+ {
35
+ namespace eclipse
36
+ {
37
+ namespace cyclonedds
38
+ {
39
+ namespace core
40
+ {
41
+ namespace timehelper
42
+ {
43
+
44
+
45
+ /**
46
+ * Check if the TIMEISH value supplied is at all suitable for arithmetic jiggery
47
+ * pokery. Invalidity encompasses (but is not restricted to) a -1 seconds part
48
+ * an 'infinity' Duration, an 'invalid' Time (or Duration).
49
+ * @param t the TIMEISH thing to check
50
+ * @return true if the argument is not suitable for doing sums with.
51
+ */
52
+ template <typename TIMEISH>
53
+ bool is_valid_for_arithmetic(const TIMEISH& t)
54
+ {
55
+ return (t.sec() != -1 // Invalid
56
+ && t.sec() != 0x7FFFFFFF // Infinity
57
+ && t.nanosec() < 1000000000); // Invalid & infinity are > 10^9
58
+ }
59
+
60
+ /**
61
+ * Check a TIMEISH is valid for doing sums with.
62
+ * @param t the TIMEISH thing to check
63
+ * @param context Some sort of clue to the receiver about what was
64
+ * called or what you were trying to do. Must be a literal or c_str.
65
+ * Defaults to "".
66
+ * @param function String to be concateneated onto context.
67
+ * Must be a literal or c_str. Defaults to "".
68
+ * @throws a dds::core::InvalidDataError if not valid.
69
+ * @see OSPL_CONTEXT_LITERAL
70
+ * @see is_valid_for_arithmetic
71
+ */
72
+ template <typename TIMEISH>
73
+ void validate(const TIMEISH& t, const char* context = "timehelper", const char* function = "validate")
74
+ {
75
+ if(! is_valid_for_arithmetic<TIMEISH>(t))
76
+ {
77
+ std::stringstream message("dds::core::InvalidDataError");
78
+ message << "Value invalid for arithmetic operations" << context << function
79
+ << " seconds=" << t.sec() << " (" << std::hex << t.sec()
80
+ << ") nanoseconds=" << t.nanosec() << " (" << std::hex << t.nanosec() << ")";
81
+ ISOCPP_THROW_EXCEPTION(ISOCPP_ILLEGAL_OPERATION_ERROR, message.str().c_str());
82
+ }
83
+ }
84
+
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ #endif /* CYCLONEDDS_CORE_TIME_HELPER_HPP_ */