init
This commit is contained in:
33
unitree_SDK/include/ddscxx/dds/topic/AnyTopic.hpp
Normal file
33
unitree_SDK/include/ddscxx/dds/topic/AnyTopic.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef OMG_DDS_TOPIC_ANY_TOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_ANY_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/topic/detail/AnyTopic.hpp>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
typedef ::dds::topic::detail::AnyTopic AnyTopic;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_ANY_TOPIC_HPP_ */
|
||||
92
unitree_SDK/include/ddscxx/dds/topic/AnyTopicListener.hpp
Normal file
92
unitree_SDK/include/ddscxx/dds/topic/AnyTopicListener.hpp
Normal file
@@ -0,0 +1,92 @@
|
||||
#ifndef OMG_DDS_TOPIC_ANY_TOPIC_LISTENER_HPP_
|
||||
#define OMG_DDS_TOPIC_ANY_TOPIC_LISTENER_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/topic/AnyTopic.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* AnyTopic events Listener
|
||||
*
|
||||
* Because the DomainParticipant does not have knowledge of data types,
|
||||
* it has to use non-data-type-listeners. In other words Any* listeners.
|
||||
*
|
||||
* <b><i>
|
||||
* All operations for this interface must be implemented in the user-defined class, it is
|
||||
* up to the application whether an operation is empty or contains some functionality.
|
||||
* </i></b>
|
||||
*
|
||||
* This class is used as a base for other listeners and is not used on its own.
|
||||
*
|
||||
* @see dds::domain::DomainParticipantListener
|
||||
*/
|
||||
class OMG_DDS_API AnyTopicListener
|
||||
{
|
||||
public:
|
||||
/** @cond */
|
||||
virtual ~AnyTopicListener() { }
|
||||
/** @endcond */
|
||||
|
||||
public:
|
||||
/** @copydoc dds::topic::TopicListener::on_inconsistent_topic() */
|
||||
virtual void on_inconsistent_topic(
|
||||
AnyTopic& topic,
|
||||
const dds::core::status::InconsistentTopicStatus& status) = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* AnyTopic events Listener
|
||||
*
|
||||
* This listener is just like AnyTopicListener, except
|
||||
* that the application doesn't have to implement all operations.
|
||||
*
|
||||
* This class is used as a base for other listeners and is not used on its own.
|
||||
*
|
||||
* @see dds::topic::AnyTopicListener
|
||||
* @see dds::domain::NoOpDomainParticipantListener
|
||||
*/
|
||||
class OMG_DDS_API NoOpAnyTopicListener : public virtual AnyTopicListener
|
||||
{
|
||||
/** @cond
|
||||
* All these functions have already been documented in the non-NoOp listener.
|
||||
* Ignore these functions for the doxygen API documentation for clarity.
|
||||
*/
|
||||
public:
|
||||
virtual ~NoOpAnyTopicListener() { }
|
||||
|
||||
public:
|
||||
virtual void on_inconsistent_topic(
|
||||
AnyTopic&,
|
||||
const dds::core::status::InconsistentTopicStatus&) { }
|
||||
/** @endcond */
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_ANY_TOPIC_LISTENER_HPP_ */
|
||||
41
unitree_SDK/include/ddscxx/dds/topic/BuiltinTopic.hpp
Normal file
41
unitree_SDK/include/ddscxx/dds/topic/BuiltinTopic.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef OMG_DDS_TOPIC_BUILTIN_TOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_BUILTIN_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/topic/detail/BuiltinTopic.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
typedef dds::topic::detail::ParticipantBuiltinTopicData ParticipantBuiltinTopicData;
|
||||
|
||||
typedef dds::topic::detail::TopicBuiltinTopicData TopicBuiltinTopicData;
|
||||
|
||||
typedef dds::topic::detail::PublicationBuiltinTopicData PublicationBuiltinTopicData;
|
||||
|
||||
typedef dds::topic::detail::SubscriptionBuiltinTopicData SubscriptionBuiltinTopicData;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_BUILTIN_TOPIC_HPP_ */
|
||||
33
unitree_SDK/include/ddscxx/dds/topic/BuiltinTopicKey.hpp
Normal file
33
unitree_SDK/include/ddscxx/dds/topic/BuiltinTopicKey.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef OMG_DDS_TOPIC_BUILTIN_TOPIC_KEY_HPP_
|
||||
#define OMG_DDS_TOPIC_BUILTIN_TOPIC_KEY_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/topic/detail/BuiltinTopicKey.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
typedef dds::topic::detail::BuiltinTopicKey BuiltinTopicKey;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_BUILTIN_TOPIC_KEY_HPP_ */
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef OMG_DDS_TOPIC_CONTENT_FILTERED_TOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_CONTENT_FILTERED_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/topic/detail/ContentFilteredTopic.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename T, template <typename Q> class DELEGATE = dds::topic::detail::ContentFilteredTopic>
|
||||
class ContentFilteredTopic;
|
||||
}
|
||||
}
|
||||
|
||||
#include <dds/topic/TContentFilteredTopic.hpp>
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_CONTENT_FILTERED_TOPIC_HPP_ */
|
||||
39
unitree_SDK/include/ddscxx/dds/topic/Filter.hpp
Normal file
39
unitree_SDK/include/ddscxx/dds/topic/Filter.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/*
|
||||
* Filter.hpp
|
||||
*
|
||||
* Created on: Oct 10, 2012
|
||||
* Author: angelo
|
||||
*/
|
||||
|
||||
#ifndef DDS_TOPIC_FILTER_HPP_
|
||||
#define DDS_TOPIC_FILTER_HPP_
|
||||
|
||||
#include <dds/topic/detail/Filter.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
typedef dds::topic::detail::Filter Filter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* DDS_TOPIC_FILTER_HPP_ */
|
||||
41
unitree_SDK/include/ddscxx/dds/topic/MultiTopic.hpp
Normal file
41
unitree_SDK/include/ddscxx/dds/topic/MultiTopic.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef OMG_DDS_TOPIC_MULTI_TOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_MULTI_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/core/detail/conformance.hpp>
|
||||
#include <dds/topic/detail/MultiTopic.hpp>
|
||||
#include <dds/topic/TMultiTopic.hpp>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
#ifdef OMG_DDS_MULTI_TOPIC_SUPPORT
|
||||
template <typename T, template <typename Q> class DELEGATE = dds::topic::detail::MultiTopic>
|
||||
class MultiTopic;
|
||||
#endif // OMG_DDS_MULTI_TOPIC_SUPPORT
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_MULTI_TOPIC_HPP_ */
|
||||
146
unitree_SDK/include/ddscxx/dds/topic/TAnyTopic.hpp
Normal file
146
unitree_SDK/include/ddscxx/dds/topic/TAnyTopic.hpp
Normal file
@@ -0,0 +1,146 @@
|
||||
#ifndef OMG_DDS_TOPIC_TANYTOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_TANYTOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/core/conformance.hpp>
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/core/ref_traits.hpp>
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
#include <dds/topic/qos/TopicQos.hpp>
|
||||
#include <dds/topic/TopicDescription.hpp>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename DELEGATE>
|
||||
class TAnyTopic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Typeless base class for the typed Topic.
|
||||
*
|
||||
* Topics are created type specific (fi Topic<Foo::Bar> topic). However, there
|
||||
* are a few places in the API (and possibly application) where the type can not be known
|
||||
* while still some Topic has to be passed around, stored or even typeless functionality
|
||||
* called.<br>
|
||||
* The main examples in the API that needs typeless Topic is: DomainParticipantListener.
|
||||
*
|
||||
* @see dds::topic::Topic
|
||||
*/
|
||||
template <typename DELEGATE>
|
||||
class dds::topic::TAnyTopic :
|
||||
public ::dds::core::TEntity< DELEGATE >,
|
||||
public ::dds::topic::TTopicDescription< DELEGATE >
|
||||
{
|
||||
OMG_DDS_REF_TYPE_PROTECTED_DC(TAnyTopic, ::dds::topic::TTopicDescription, DELEGATE)
|
||||
OMG_DDS_IMPLICIT_REF_BASE(TAnyTopic)
|
||||
|
||||
OMG_DDS_COMPLETE_RULE_OF_FIVE_VIRTUAL_DEFAULT(TAnyTopic)
|
||||
|
||||
public:
|
||||
|
||||
//==========================================================================
|
||||
//== QoS Management
|
||||
|
||||
/**
|
||||
* Gets the TopicQos setting for this instance.
|
||||
*
|
||||
* @return the qos
|
||||
* @throws dds::core::Error
|
||||
* An internal error has occurred.
|
||||
* @throws dds::core::NullReferenceError
|
||||
* The entity was not properly created and references to dds::core::null.
|
||||
* @throws dds::core::AlreadyClosedError
|
||||
* The entity has already been closed.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
dds::topic::qos::TopicQos qos() const;
|
||||
|
||||
/**
|
||||
* This operation replaces the existing set of QosPolicy settings for a Topic.
|
||||
*
|
||||
* The parameter qos contains the object with the QosPolicy settings which is
|
||||
* checked for self-consistency and mutability.
|
||||
*
|
||||
* When the application tries to change a
|
||||
* QosPolicy setting for an enabled Topic, which can only be set before the
|
||||
* Topic is enabled, the operation will fail and a
|
||||
* ImmutablePolicyError is thrown. In other words, the application must
|
||||
* provide the presently set QosPolicy settings in case of the immutable QosPolicy
|
||||
* settings. Only the mutable QosPolicy settings can be changed.
|
||||
*
|
||||
* When the qos contains conflicting QosPolicy settings (not self-consistent),
|
||||
* the operation will fail and an InconsistentPolicyError is thrown.
|
||||
*
|
||||
* @param qos the qos
|
||||
* @throws dds::core::Error
|
||||
* An internal error has occurred.
|
||||
* @throws dds::core::NullReferenceError
|
||||
* The entity was not properly created and references to dds::core::null.
|
||||
* @throws dds::core::AlreadyClosedError
|
||||
* The entity has already been closed.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
* @throws dds::core::ImmutablePolicyError
|
||||
* The parameter qos contains an immutable QosPolicy setting with a
|
||||
* different value than set during enabling of the DataReader.
|
||||
* @throws dds::core::InconsistentPolicyError
|
||||
* The parameter qos contains conflicting QosPolicy settings,
|
||||
*/
|
||||
void qos(const dds::topic::qos::TopicQos& qos);
|
||||
|
||||
/** @copydoc dds::topic::TAnyTopic::qos(const dds::topic::qos::TopicQos& qos) */
|
||||
TAnyTopic& operator << (const dds::topic::qos::TopicQos& qos);
|
||||
|
||||
/** @copydoc dds::topic::TAnyTopic::qos() */
|
||||
const TAnyTopic& operator >> (dds::topic::qos::TopicQos& qos) const;
|
||||
|
||||
/**
|
||||
* This operation obtains the InconsistentTopicStatus object of the Topic.
|
||||
*
|
||||
* The InconsistentTopicStatus can also be monitored using a
|
||||
* TopicListener or by using the associated StatusCondition.
|
||||
*
|
||||
* @return the SampleRejectedStatus
|
||||
* @throws dds::core::Error
|
||||
* An internal error has occurred.
|
||||
* @throws dds::core::NullReferenceError
|
||||
* The entity was not properly created and references to dds::core::null.
|
||||
* @throws dds::core::AlreadyClosedError
|
||||
* The entity has already been closed.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
::dds::core::status::InconsistentTopicStatus
|
||||
inconsistent_topic_status() const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_TANYTOPIC_HPP_ */
|
||||
487
unitree_SDK/include/ddscxx/dds/topic/TBuiltinTopic.hpp
Normal file
487
unitree_SDK/include/ddscxx/dds/topic/TBuiltinTopic.hpp
Normal file
@@ -0,0 +1,487 @@
|
||||
#ifndef OMG_TDDS_TOPIC_BUILT_IN_TOPIC_HPP_
|
||||
#define OMG_TDDS_TOPIC_BUILT_IN_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/core/detail/conformance.hpp>
|
||||
#include <dds/core/Value.hpp>
|
||||
#include <dds/core/policy/CorePolicy.hpp>
|
||||
#include <dds/topic/BuiltinTopicKey.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename D>
|
||||
class TParticipantBuiltinTopicData;
|
||||
|
||||
template <typename D>
|
||||
class TTopicBuiltinTopicData;
|
||||
|
||||
template <typename D>
|
||||
class TPublicationBuiltinTopicData;
|
||||
|
||||
template <typename D>
|
||||
class TSubscriptionBuiltinTopicData;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Class that contains information about available DomainParticipants within
|
||||
* the system.
|
||||
*
|
||||
* The DCPSParticipant topic communicates the existence of DomainParticipants
|
||||
* by means of the ParticipantBuiltinTopicData datatype. Each
|
||||
* ParticipantBuiltinTopicData sample in a Domain represents a DomainParticipant
|
||||
* that participates in that Domain: a new ParticipantBuiltinTopicData instance
|
||||
* is created when a newly-added DomainParticipant is enabled, and it is disposed
|
||||
* when that DomainParticipant is deleted. An updated ParticipantBuiltinTopicData
|
||||
* sample is written each time the DomainParticipant modifies its UserDataQosPolicy.
|
||||
*
|
||||
* @code{.cpp}
|
||||
* // Get builtin subscriber
|
||||
* dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
|
||||
* dds::sub::Subscriber builtinSubscriber = dds::sub::builtin_subscriber(participant);
|
||||
*
|
||||
* // Get DCPSParticipant builtin reader (happy flow)
|
||||
* string name = "DCPSParticipant";
|
||||
* vector<dds::sub::DataReader<dds::topic::ParticipantBuiltinTopicData> > readersVector;
|
||||
* dds::sub::find<dds::sub::DataReader<dds::topic::ParticipantBuiltinTopicData>,
|
||||
* back_insert_iterator<vector<dds::sub::DataReader<dds::topic::ParticipantBuiltinTopicData> > > >(
|
||||
* builtinSubscriber,
|
||||
* name,
|
||||
* back_inserter<vector<dds::sub::DataReader<dds::topic::ParticipantBuiltinTopicData> > >(readersVector));
|
||||
* dds::sub::DataReader<dds::topic::ParticipantBuiltinTopicData> builtinReader = readersVector[0];
|
||||
*
|
||||
* // The builtinReader can now be used just as a normal dds::sub::DataReader to get
|
||||
* // dds::topic::ParticipantBuiltinTopicData samples.
|
||||
* @endcode
|
||||
*
|
||||
* @see for more information: @ref DCPS_Builtin_Topics
|
||||
* @see for more information: @ref DCPS_Builtin_Topics_ParticipantData
|
||||
*/
|
||||
template <typename D>
|
||||
class dds::topic::TParticipantBuiltinTopicData : public ::dds::core::Value<D>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Globally unique identifier of the participant
|
||||
*/
|
||||
const dds::topic::BuiltinTopicKey& key() const;
|
||||
|
||||
/**
|
||||
* User-defined data attached to the participant via a QosPolicy
|
||||
*/
|
||||
const ::dds::core::policy::UserData& user_data() const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Class that contains information about available Topics within
|
||||
* the system.
|
||||
*
|
||||
* The DCPSTopic topic communicates the existence of topics by means of the
|
||||
* TopicBuiltinTopicData datatype. Each TopicBuiltinTopicData sample in
|
||||
* a Domain represents a Topic in that Domain: a new TopicBuiltinTopicData
|
||||
* instance is created when a newly-added Topic is enabled. However, the instance is
|
||||
* not disposed when a Topic is deleted by its participant because a topic lifecycle
|
||||
* is tied to the lifecycle of a Domain, not to the lifecycle of an individual
|
||||
* participant. An updated TopicBuiltinTopicData sample is written each time a
|
||||
* Topic modifies one or more of its QosPolicy values.
|
||||
*
|
||||
* @code{.cpp}
|
||||
* // Get builtin subscriber
|
||||
* dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
|
||||
* dds::sub::Subscriber builtinSubscriber = dds::sub::builtin_subscriber(participant);
|
||||
*
|
||||
* // Get DCPSTopic builtin reader (happy flow)
|
||||
* string name = "DCPSTopic";
|
||||
* vector<dds::sub::DataReader<dds::topic::TopicBuiltinTopicData> > readersVector;
|
||||
* dds::sub::find<dds::sub::DataReader<dds::topic::TopicBuiltinTopicData>,
|
||||
* back_insert_iterator<vector<dds::sub::DataReader<dds::topic::TopicBuiltinTopicData> > > >(
|
||||
* builtinSubscriber,
|
||||
* name,
|
||||
* back_inserter<vector<dds::sub::DataReader<dds::topic::TopicBuiltinTopicData> > >(readersVector));
|
||||
* dds::sub::DataReader<dds::topic::TopicBuiltinTopicData> builtinReader = readersVector[0];
|
||||
*
|
||||
* // The builtinReader can now be used just as a normal dds::sub::DataReader to get
|
||||
* // dds::topic::TopicBuiltinTopicData samples.
|
||||
* @endcode
|
||||
*
|
||||
* @see for more information: @ref DCPS_Builtin_Topics
|
||||
* @see for more information: @ref DCPS_Builtin_Topics_TopicData
|
||||
*/
|
||||
template <typename D>
|
||||
class dds::topic::TTopicBuiltinTopicData : public ::dds::core::Value<D>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Global unique identifier of the Topic
|
||||
*/
|
||||
const dds::topic::BuiltinTopicKey& key() const;
|
||||
|
||||
/**
|
||||
* Name of the Topic
|
||||
*/
|
||||
const std::string& name() const;
|
||||
|
||||
/**
|
||||
* Type name of the Topic (i.e. the fully scoped IDL name)
|
||||
*/
|
||||
const std::string& type_name() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::Durability& durability() const;
|
||||
|
||||
#ifdef OMG_DDS_PERSISTENCE_SUPPORT
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::DurabilityService& durability_service() const;
|
||||
#endif // OMG_DDS_PERSISTENCE_SUPPORT
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::Deadline& deadline() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::LatencyBudget& latency_budget() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::Liveliness& liveliness() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::Reliability& reliability() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::TransportPriority& transport_priority() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::Lifespan& lifespan() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::DestinationOrder& destination_order() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::History& history() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::ResourceLimits& resource_limits() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::Ownership& ownership() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Topic
|
||||
*/
|
||||
const ::dds::core::policy::TopicData& topic_data() const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Class that contains information about available DataWriters within
|
||||
* the system.
|
||||
*
|
||||
* The DCPSPublication topic communicates the existence of datawriters by means
|
||||
* of the PublicationBuiltinTopicData datatype. Each PublicationBuiltinTopicData
|
||||
* sample in a Domain represents a datawriter in that Domain: a new
|
||||
* PublicationBuiltinTopicData instance is created when a newly-added DataWriter
|
||||
* is enabled, and it is disposed when that DataWriter is deleted. An updated
|
||||
* PublicationBuiltinTopicData sample is written each time the DataWriter (or
|
||||
* the Publisher to which it belongs) modifies a QosPolicy that applies to the
|
||||
* entities connected to it. Also will it be updated when the writer looses or
|
||||
* regains its liveliness.
|
||||
*
|
||||
* @code{.cpp}
|
||||
* // Get builtin subscriber
|
||||
* dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
|
||||
* dds::sub::Subscriber builtinSubscriber = dds::sub::builtin_subscriber(participant);
|
||||
*
|
||||
* // Get DCPSPublication builtin reader (happy flow)
|
||||
* string name = "DCPSPublication";
|
||||
* vector<dds::sub::DataReader<dds::topic::PublicationBuiltinTopicData> > readersVector;
|
||||
* dds::sub::find<dds::sub::DataReader<dds::topic::PublicationBuiltinTopicData>,
|
||||
* back_insert_iterator<vector<dds::sub::DataReader<dds::topic::PublicationBuiltinTopicData> > > >(
|
||||
* builtinSubscriber,
|
||||
* name,
|
||||
* back_inserter<vector<dds::sub::DataReader<dds::topic::PublicationBuiltinTopicData> > >(readersVector));
|
||||
* dds::sub::DataReader<dds::topic::PublicationBuiltinTopicData> builtinReader = readersVector[0];
|
||||
*
|
||||
* // The builtinReader can now be used just as a normal dds::sub::DataReader to get
|
||||
* // dds::topic::PublicationBuiltinTopicData samples.
|
||||
* @endcode
|
||||
*
|
||||
* @see for more information: @ref DCPS_Builtin_Topics
|
||||
* @see for more information: @ref DCPS_Builtin_Topics_PublicationData
|
||||
*/
|
||||
template <typename D>
|
||||
class dds::topic::TPublicationBuiltinTopicData : public ::dds::core::Value<D>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Global unique identifier of the DataWriter
|
||||
*/
|
||||
const dds::topic::BuiltinTopicKey& key() const;
|
||||
|
||||
/**
|
||||
* Global unique identifier of the Participant to which the DataWriter belongs
|
||||
*/
|
||||
const dds::topic::BuiltinTopicKey& participant_key() const;
|
||||
|
||||
/**
|
||||
* Name of the Topic used by the DataWriter
|
||||
*/
|
||||
const std::string& topic_name() const;
|
||||
|
||||
/**
|
||||
* Type name of the Topic used by the DataWriter
|
||||
*/
|
||||
const std::string& type_name() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::Durability& durability() const;
|
||||
|
||||
#ifdef OMG_DDS_PERSISTENCE_SUPPORT
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::DurabilityService& durability_service() const;
|
||||
#endif // OMG_DDS_PERSISTENCE_SUPPORT
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::Deadline& deadline() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::LatencyBudget& latency_budget() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::Liveliness& liveliness() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::Reliability& reliability() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::Lifespan& lifespan() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::UserData& user_data() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::Ownership& ownership() const;
|
||||
|
||||
#ifdef OMG_DDS_OWNERSHIP_SUPPORT
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::OwnershipStrength& ownership_strength() const;
|
||||
#endif // OMG_DDS_OWNERSHIP_SUPPORT
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataWriter
|
||||
*/
|
||||
const ::dds::core::policy::DestinationOrder& destination_order() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Publisher to which the DataWriter belongs
|
||||
*/
|
||||
const ::dds::core::policy::Presentation& presentation() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Publisher to which the DataWriter belongs
|
||||
*/
|
||||
const ::dds::core::policy::Partition& partition() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Publisher to which the DataWriter belongs
|
||||
*/
|
||||
const ::dds::core::policy::TopicData& topic_data() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Publisher to which the DataWriter belongs
|
||||
*/
|
||||
const ::dds::core::policy::GroupData& group_data() const;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Class that contains information about available DataReaders within
|
||||
* the system.
|
||||
*
|
||||
* The DCPSSubscription topic communicates the existence of datareaders by
|
||||
* means of the SubscriptionBuiltinTopicData datatype. Each
|
||||
* SubscriptionBuiltinTopicData sample in a Domain represents a datareader
|
||||
* in that Domain: a new SubscriptionBuiltinTopicData instance is created
|
||||
* when a newly-added DataReader is enabled, and it is disposed when that
|
||||
* DataReader is deleted. An updated SubscriptionBuiltinTopicData sample is
|
||||
* written each time the DataReader (or the Subscriber to which it belongs)
|
||||
* modifies a QosPolicy that applies to the entities connected to it.
|
||||
*
|
||||
* @code{.cpp}
|
||||
* // Get builtin subscriber
|
||||
* dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
|
||||
* dds::sub::Subscriber builtinSubscriber = dds::sub::builtin_subscriber(participant);
|
||||
*
|
||||
* // Get DCPSSubscription builtin reader (happy flow)
|
||||
* string name = "DCPSSubscription";
|
||||
* vector<dds::sub::DataReader<dds::topic::SubscriptionBuiltinTopicData> > readersVector;
|
||||
* dds::sub::find<dds::sub::DataReader<dds::topic::SubscriptionBuiltinTopicData>,
|
||||
* back_insert_iterator<vector<dds::sub::DataReader<dds::topic::SubscriptionBuiltinTopicData> > > >(
|
||||
* builtinSubscriber,
|
||||
* name,
|
||||
* back_inserter<vector<dds::sub::DataReader<dds::topic::SubscriptionBuiltinTopicData> > >(readersVector));
|
||||
* dds::sub::DataReader<dds::topic::SubscriptionBuiltinTopicData> builtinReader = readersVector[0];
|
||||
*
|
||||
* // The builtinReader can now be used just as a normal dds::sub::DataReader to get
|
||||
* // dds::topic::SubscriptionBuiltinTopicData samples.
|
||||
* @endcode
|
||||
*
|
||||
* @see for more information: @ref DCPS_Builtin_Topics
|
||||
* @see for more information: @ref DCPS_Builtin_Topics_SubscriptionData
|
||||
*/
|
||||
template <typename D>
|
||||
class dds::topic::TSubscriptionBuiltinTopicData : public ::dds::core::Value<D>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Global unique identifier of the DataReader
|
||||
*/
|
||||
const dds::topic::BuiltinTopicKey& key() const;
|
||||
|
||||
/**
|
||||
* Global unique identifier of the Participant to which the DataReader belongs
|
||||
*/
|
||||
const dds::topic::BuiltinTopicKey& participant_key() const;
|
||||
|
||||
/**
|
||||
* Name of the Topic used by the DataReader
|
||||
*/
|
||||
const std::string& topic_name() const;
|
||||
|
||||
/**
|
||||
* Type name of the Topic used by the DataReader
|
||||
*/
|
||||
const std::string& type_name() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::Durability& durability() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::Deadline& deadline() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::LatencyBudget& latency_budget() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::Liveliness& liveliness() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::Reliability& reliability() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::Ownership& ownership() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::DestinationOrder& destination_order() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::UserData& user_data() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the DataReader
|
||||
*/
|
||||
const ::dds::core::policy::TimeBasedFilter& time_based_filter() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Subscriber to which the DataReader belongs
|
||||
*/
|
||||
const ::dds::core::policy::Presentation& presentation() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Subscriber to which the DataReader belongs
|
||||
*/
|
||||
const ::dds::core::policy::Partition& partition() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Subscriber to which the DataReader belongs
|
||||
*/
|
||||
const ::dds::core::policy::TopicData& topic_data() const;
|
||||
|
||||
/**
|
||||
* QosPolicy attached to the Subscriber to which the DataReader belongs
|
||||
*/
|
||||
const ::dds::core::policy::GroupData& group_data() const;
|
||||
|
||||
};
|
||||
|
||||
#endif /* OMG_TDDS_TOPIC_BUILT_IN_TOPIC_HPP_ */
|
||||
57
unitree_SDK/include/ddscxx/dds/topic/TBuiltinTopicKey.hpp
Normal file
57
unitree_SDK/include/ddscxx/dds/topic/TBuiltinTopicKey.hpp
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef OMG_DDS_TOPIC_TBUILTIN_TOPIC_KEY_HPP_
|
||||
#define OMG_DDS_TOPIC_TBUILTIN_TOPIC_KEY_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#include <dds/core/Value.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename D>
|
||||
class TBuiltinTopicKey;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Global unique identifier of the Topic.
|
||||
*/
|
||||
template <typename D>
|
||||
class dds::topic::TBuiltinTopicKey : public ::dds::core::Value<D>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Gets the BuiltinTopicKey.
|
||||
*
|
||||
* @return the BuiltinTopicKey
|
||||
*/
|
||||
const int32_t* value() const;
|
||||
|
||||
/**
|
||||
* Sets the BuiltinTopicKey.
|
||||
*
|
||||
* @param v the value to set
|
||||
*/
|
||||
void value(int32_t v[]);
|
||||
};
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_TBUILTIN_TOPIC_KEY_HPP_ */
|
||||
160
unitree_SDK/include/ddscxx/dds/topic/TContentFilteredTopic.hpp
Normal file
160
unitree_SDK/include/ddscxx/dds/topic/TContentFilteredTopic.hpp
Normal file
@@ -0,0 +1,160 @@
|
||||
#ifndef OMG_DDS_T_TOPIC_CONTENT_FILTERED_TOPIC_HPP_
|
||||
#define OMG_DDS_T_TOPIC_CONTENT_FILTERED_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <dds/core/detail/conformance.hpp>
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/topic/Topic.hpp>
|
||||
#include <dds/topic/Filter.hpp>
|
||||
|
||||
#ifdef OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
class ContentFilteredTopic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* ContentFilteredTopic is a specialization of TopicDescription that allows
|
||||
* for content-based subscriptions.
|
||||
*
|
||||
* ContentFilteredTopic describes a more sophisticated subscription which
|
||||
* indicates that the Subscriber does not necessarily want to see all values of each
|
||||
* instance published under the Topic. Rather, it only wants to see the values whose
|
||||
* contents satisfy certain criteria. Therefore this class must be used to request
|
||||
* content-based subscriptions.
|
||||
*
|
||||
* The selection of the content is done using the SQL based filter with parameters to
|
||||
* adapt the filter clause.
|
||||
*
|
||||
* <b><i>Example</i></b>
|
||||
* @code{.cpp}
|
||||
* // Default creation of a Topic
|
||||
* dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
|
||||
* dds::topic::Topic<Foo::Bar> topic(participant, "TopicName");
|
||||
*
|
||||
* // Creation of a ContentFilteredTopic (assume Foo::Bar contains long_1 element).
|
||||
* std::vector<std::string> params;
|
||||
* params.push_back("1");
|
||||
* dds::topic::Filter filter("long_1=%0", params);
|
||||
* dds::topic::ContentFilteredTopic<Foo::Bar> cfTopic(topic,
|
||||
* "ContentFilteredTopicName",
|
||||
* filter);
|
||||
*
|
||||
* // The ContentFilteredTopic can be used to create readers
|
||||
* dds::sub::Subscriber subscriber(participant);
|
||||
* dds::sub::DataReader<Foo::Bar> reader(subscriber, cfTopic);
|
||||
* @endcode
|
||||
*
|
||||
* @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
|
||||
*/
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
class dds::topic::ContentFilteredTopic : public dds::topic::TTopicDescription< DELEGATE<T> >
|
||||
{
|
||||
public:
|
||||
OMG_DDS_REF_TYPE_PROTECTED_DC_T(ContentFilteredTopic, dds::topic::TTopicDescription, T, DELEGATE)
|
||||
OMG_DDS_IMPLICIT_REF_BASE(ContentFilteredTopic)
|
||||
|
||||
/**
|
||||
* Convenience typedef for the type of the data sample.
|
||||
*/
|
||||
typedef T DataType;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a ContentFilteredTopic be used as to perform content-based
|
||||
* subscriptions.
|
||||
*
|
||||
* The ContentFilteredTopic only relates to samples published under that
|
||||
* Topic, filtered according to their content. The filtering is done by
|
||||
* means of evaluating a logical expression that involves the values of
|
||||
* some of the data-fields in the sample.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @param topic the related Topic
|
||||
* @param name the name of the ContentFilteredTopic
|
||||
* @param filter the filter expression
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
ContentFilteredTopic(const Topic<T>& topic, const std::string& name, const dds::topic::Filter& filter);
|
||||
|
||||
/** @cond */
|
||||
virtual ~ContentFilteredTopic();
|
||||
/** @endcond */
|
||||
|
||||
public:
|
||||
/**
|
||||
* Get the filter expression.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @return the filter expression
|
||||
*/
|
||||
const std::string& filter_expression() const;
|
||||
|
||||
/**
|
||||
* Get the filter expression parameters.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @return the filter parameters as a sequence
|
||||
*/
|
||||
const dds::core::StringSeq filter_parameters() const;
|
||||
|
||||
/**
|
||||
* Sets the query parameters.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @param begin Iterator pointing to the beginning of the parameters to set
|
||||
* @param end Iterator pointing to the end of the parameters to set
|
||||
* @throws dds::core::Error
|
||||
* An internal error has occurred.
|
||||
* @throws dds::core::NullReferenceError
|
||||
* The entity was not properly created and references to dds::core::null.
|
||||
*/
|
||||
template <typename FWDIterator>
|
||||
void filter_parameters(const FWDIterator& begin, const FWDIterator& end);
|
||||
|
||||
/**
|
||||
* Return the associated Topic.
|
||||
*
|
||||
* @return the Topic
|
||||
* @throws dds::core::Error
|
||||
* An internal error has occurred.
|
||||
* @throws dds::core::NullReferenceError
|
||||
* The entity was not properly created and references to dds::core::null.
|
||||
*/
|
||||
const dds::topic::Topic<T>& topic() const;
|
||||
};
|
||||
|
||||
#endif // OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT
|
||||
|
||||
|
||||
#endif /* OMG_DDS_T_TOPIC_CONTENT_FILTERED_TOPIC_HPP_ */
|
||||
186
unitree_SDK/include/ddscxx/dds/topic/TFilter.hpp
Normal file
186
unitree_SDK/include/ddscxx/dds/topic/TFilter.hpp
Normal file
@@ -0,0 +1,186 @@
|
||||
#ifndef DDS_TOPIC_TFILTER__HPP_
|
||||
#define DDS_TOPIC_TFILTER__HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/core/Value.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename D>
|
||||
class TFilter;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Filter objects contain SQL expressions that allow the application to specify
|
||||
* a filter on the locally available data.
|
||||
*
|
||||
* A Filter is used to create a ContentFilteredTopic.
|
||||
*
|
||||
* @anchor anchor_dds_topic_filter_expression
|
||||
* \par SQL Expression
|
||||
* The SQL query string is set by expression which must be a subset of the
|
||||
* SQL query language. In this query expression, parameters may be used, which must
|
||||
* be set in the sequence of strings defined by the parameter query_parameters. A
|
||||
* parameter is a string which can define an integer, float, string or enumeration. The
|
||||
* number of values in query_parameters must be equal or greater than the highest
|
||||
* referenced %n token in the query_expression (e.g. if %1 and %8 are used as
|
||||
* parameters in the query_expression, the query_parameters should at least
|
||||
* contain n+1 = 9 values).<br>
|
||||
* Look @ref DCPS_Queries_and_Filters "here" for the specific query expression syntax.
|
||||
*
|
||||
* @see dds::topic::ContentFilteredTopic
|
||||
* @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
|
||||
*/
|
||||
template <typename D>
|
||||
class dds::topic::TFilter: public dds::core::Value<D>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Iterator for the query expression parameters.
|
||||
*/
|
||||
typedef typename D::iterator iterator;
|
||||
|
||||
/**
|
||||
* Iterator for the query expression parameters.
|
||||
*/
|
||||
typedef typename D::const_iterator const_iterator;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Create a Filter based on a query expression.
|
||||
*
|
||||
* @param query_expression an @ref anchor_dds_topic_filter_expression "SQL expression"
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
TFilter(const std::string& query_expression);
|
||||
|
||||
/**
|
||||
* Create a Filter based on a query expression and an iterable parameter container.
|
||||
*
|
||||
* @param query_expression an @ref anchor_dds_topic_filter_expression "SQL expression"
|
||||
* @param params_begin Iterator pointing to the beginning of the parameters to set
|
||||
* @param params_end Iterator pointing to the end of the parameters to set
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
template <typename FWIterator>
|
||||
TFilter(const std::string& query_expression, const FWIterator& params_begin,
|
||||
const FWIterator& params_end);
|
||||
|
||||
/**
|
||||
* Create a Filter based on a query expression and parameter vector.
|
||||
*
|
||||
* @param query_expression an @ref anchor_dds_topic_filter_expression "SQL expression"
|
||||
* @param params Vector containing SQL expression parameters
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
TFilter(const std::string& query_expression,
|
||||
const std::vector<std::string>& params);
|
||||
|
||||
/**
|
||||
* Get the query expression.
|
||||
*
|
||||
* @return std::string The @ref anchor_dds_topic_filter_expression "SQL expression".
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
const std::string& expression() const;
|
||||
|
||||
/**
|
||||
* Provides the begin iterator to the SQL expression parameter list.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @return dds::topic::Filter::const_iterator
|
||||
* The begin iterator
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
const_iterator begin() const;
|
||||
|
||||
/**
|
||||
* The end iterator to the SQL expression parameter list.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @return dds::topic::Filter::const_iterator
|
||||
* The end iterator
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
const_iterator end() const;
|
||||
|
||||
/**
|
||||
* Provides the begin iterator to the SQL expression parameter list.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @return dds::topic::Filter::iterator
|
||||
* The begin iterator
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
iterator begin();
|
||||
|
||||
/**
|
||||
* The end iterator to the SQL expression parameter list.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @return dds::topic::Filter::iterator
|
||||
* The end iterator
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
iterator end();
|
||||
|
||||
/**
|
||||
* Sets the query parameters.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @param begin Iterator pointing to the beginning of the parameters to set
|
||||
* @param end Iterator pointing to the end of the parameters to set
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
template <typename FWIterator>
|
||||
void parameters(const FWIterator& begin, const FWIterator end);
|
||||
|
||||
/**
|
||||
* Adds a parameter to the query.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @param param The parameter to add
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
void add_parameter(const std::string& param);
|
||||
|
||||
/**
|
||||
* Gets the number of parameters in the query of the filter.
|
||||
*
|
||||
* See @ref anchor_dds_topic_filter_expression "SQL expression info"
|
||||
*
|
||||
* @return uint32_t The number of parameters in the query
|
||||
* @throw dds::core::Exception
|
||||
*/
|
||||
uint32_t parameters_length() const;
|
||||
};
|
||||
|
||||
#endif /* DDS_TOPIC_TFILTER__HPP_ */
|
||||
74
unitree_SDK/include/ddscxx/dds/topic/TMultiTopic.hpp
Normal file
74
unitree_SDK/include/ddscxx/dds/topic/TMultiTopic.hpp
Normal file
@@ -0,0 +1,74 @@
|
||||
#ifndef OMG_DDS_T_TOPIC_MULTI_TOPIC_HPP_
|
||||
#define OMG_DDS_T_TOPIC_MULTI_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <dds/core/detail/conformance.hpp>
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/topic/TopicDescription.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
#ifdef OMG_DDS_MULTI_TOPIC_SUPPORT
|
||||
|
||||
/**
|
||||
* <b><i>This operation is not yet implemented. It is scheduled for a future release.</i></b>
|
||||
*
|
||||
* @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
|
||||
*/
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
class MultiTopic : public TTopicDescription< DELEGATE<T> >
|
||||
{
|
||||
public:
|
||||
OMG_DDS_REF_TYPE_PROTECTED_DC_T(MultiTopic, dds::topic::TTopicDescription, T, DELEGATE)
|
||||
OMG_DDS_IMPLICIT_REF_BASE(MultiTopic)
|
||||
|
||||
public:
|
||||
template <typename FWDIterator>
|
||||
MultiTopic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const std::string expression,
|
||||
const FWDIterator& params_begin,
|
||||
const FWDIterator& params_end);
|
||||
|
||||
virtual ~MultiTopic();
|
||||
|
||||
public:
|
||||
const std::string expression() const;
|
||||
|
||||
template <typename FWDIterator>
|
||||
void expression_parameters(const FWDIterator& params_begin,
|
||||
const FWDIterator& params_end);
|
||||
|
||||
dds::core::StringSeq void expression_parameters() const;
|
||||
|
||||
};
|
||||
|
||||
#endif // OMG_DDS_MULTI_TOPIC_SUPPORT
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* OMG_DDS_T_TOPIC_CONTENT_FILTERED_TOPIC_HPP_ */
|
||||
429
unitree_SDK/include/ddscxx/dds/topic/TTopic.hpp
Normal file
429
unitree_SDK/include/ddscxx/dds/topic/TTopic.hpp
Normal file
@@ -0,0 +1,429 @@
|
||||
#ifndef OMG_DDS_TTOPIC_TOPIC_HPP_
|
||||
#define OMG_DDS_TTOPIC_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/core/conformance.hpp>
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/core/ref_traits.hpp>
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
#include <dds/topic/qos/TopicQos.hpp>
|
||||
#include <dds/topic/TopicDescription.hpp>
|
||||
#include <dds/topic/AnyTopic.hpp>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
class Topic;
|
||||
|
||||
template <typename T>
|
||||
class TopicListener;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Topic is the most basic description of the data to be published and
|
||||
* subscribed.
|
||||
*
|
||||
* A Topic is identified by its name, which must be unique in the whole Domain.
|
||||
* In addition (by virtue of extending TopicDescription) it fully specifies the
|
||||
* type of the data that can be communicated when publishing or subscribing to
|
||||
* the Topic.
|
||||
*
|
||||
* Topic is the only TopicDescription that can be used for publications and
|
||||
* therefore associated with a DataWriter.
|
||||
*
|
||||
* <b><i>Example</i></b>
|
||||
* @code{.cpp}
|
||||
* // Default creation of a Topic
|
||||
* dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
|
||||
* dds::topic::Topic<Foo::Bar> topic(participant, "TopicName");
|
||||
*
|
||||
* // The Topic can be used to create readers and writers
|
||||
* // DataReader
|
||||
* dds::sub::Subscriber subscriber(participant);
|
||||
* dds::sub::DataReader<Foo::Bar> reader(subscriber, topic);
|
||||
* // DataWriter
|
||||
* dds::pub::Publisher publisher(participant);
|
||||
* dds::pub::DataWriter<Foo::Bar> writer(publisher, topic);
|
||||
* @endcode
|
||||
*
|
||||
* @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
|
||||
*/
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
class dds::topic::Topic : public dds::topic::TAnyTopic< DELEGATE<T> >
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Convenience typedef for the type of the data sample.
|
||||
*/
|
||||
typedef T DataType;
|
||||
|
||||
/**
|
||||
* Local convenience typedef for dds::topic::TopicListener.
|
||||
*/
|
||||
typedef TopicListener<T> Listener;
|
||||
|
||||
public:
|
||||
OMG_DDS_REF_TYPE_PROTECTED_DC_T(Topic, ::dds::topic::TAnyTopic, T, DELEGATE)
|
||||
OMG_DDS_IMPLICIT_REF_BASE(Topic)
|
||||
OMG_DDS_COMPLETE_RULE_OF_FIVE_VIRTUAL_DEFAULT(Topic)
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Create a new Topic.
|
||||
*
|
||||
* This operation creates a reference to a new or existing Topic under the given name,
|
||||
* for a specific data type.
|
||||
*
|
||||
* <i>QoS</i><br>
|
||||
* The Topic will be created with the QoS values specified on the last
|
||||
* successful call to @link dds::domain::DomainParticipant::default_topic_qos(const ::dds::topic::qos::TopicQos& qos)
|
||||
* dp.default_topic_qos(qos) @endlink or, if the call was never made, the
|
||||
* @ref anchor_dds_topic_qos_defaults "default" values.
|
||||
*
|
||||
* <i>Existing Topic Name</i><br>
|
||||
* Before creating a new Topic, this operation performs a
|
||||
* lookup_topicdescription for the specified topic_name. When a Topic is
|
||||
* found with the same name in the current domain, the QoS and type_name of the
|
||||
* found Topic are matched against the parameters qos and type_name. When they
|
||||
* are the same, no Topic is created but a new proxy of the existing Topic is returned.
|
||||
* When they are not exactly the same, no Topic is created and dds::core::Error is thrown.
|
||||
*
|
||||
* <i>Local Proxy</i><br>
|
||||
* Since a Topic is a global concept in the system, access is provided through a local
|
||||
* proxy. In other words, the reference returned is actually not a reference to a Topic
|
||||
* but to a locally created proxy. The Data Distribution Service propagates Topics
|
||||
* and makes remotely created Topics locally available through this proxy. The deletion
|
||||
* of a Topic object will not delete the Topic from the domain, just the local proxy is
|
||||
* deleted.
|
||||
*
|
||||
* @param dp the domain participant on which the topic will be defined
|
||||
* @param topic_name the name of the Topic to be created
|
||||
* @throws dds::core::Error
|
||||
* A other Topic with the same name but different type or QoS was
|
||||
* detected in the current domain or another internal error has occurred.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name);
|
||||
|
||||
/**
|
||||
* Create a new Topic.
|
||||
*
|
||||
* This operation creates a reference to a new or existing Topic under the given name,
|
||||
* for a specific data type and type_name.
|
||||
*
|
||||
* <i>QoS</i><br>
|
||||
* The Topic will be created with the QoS values specified on the last
|
||||
* successful call to @link dds::domain::DomainParticipant::default_topic_qos(const ::dds::topic::qos::TopicQos& qos)
|
||||
* dp.default_topic_qos(qos) @endlink or, if the call was never made, the
|
||||
* @ref anchor_dds_topic_qos_defaults "default" values.
|
||||
*
|
||||
* <i>Existing Topic Name</i><br>
|
||||
* Before creating a new Topic, this operation performs a
|
||||
* lookup_topicdescription for the specified topic_name. When a Topic is
|
||||
* found with the same name in the current domain, the QoS and type_name of the
|
||||
* found Topic are matched against the parameters qos and type_name. When they
|
||||
* are the same, no Topic is created but a new proxy of the existing Topic is returned.
|
||||
* When they are not exactly the same, no Topic is created and dds::core::Error is thrown.
|
||||
*
|
||||
* <i>Local Proxy</i><br>
|
||||
* Since a Topic is a global concept in the system, access is provided through a local
|
||||
* proxy. In other words, the reference returned is actually not a reference to a Topic
|
||||
* but to a locally created proxy. The Data Distribution Service propagates Topics
|
||||
* and makes remotely created Topics locally available through this proxy. The deletion
|
||||
* of a Topic object will not delete the Topic from the domain, just the local proxy is
|
||||
* deleted.
|
||||
*
|
||||
* @param dp the domain participant on which the topic will be defined
|
||||
* @param topic_name the topic's name
|
||||
* @param type_name a local alias of the data type
|
||||
* @throws dds::core::Error
|
||||
* A other Topic with the same name but different type or QoS was
|
||||
* detected in the current domain or another internal error has occurred.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const std::string& type_name);
|
||||
|
||||
/**
|
||||
* Create a new Topic.
|
||||
*
|
||||
* This operation creates a reference to a new or existing Topic under the given name,
|
||||
* for a specific data type.
|
||||
*
|
||||
* <i>QoS</i><br>
|
||||
* A possible application pattern to construct the TopicQos for the
|
||||
* Topic is to:
|
||||
* @code{.cpp}
|
||||
* // 1) Retrieve the QosPolicy settings on the associated DomainParticipant
|
||||
* dds::topic::qos::TopicQos topicQos = participant.default_datareader_qos();
|
||||
* // 2) Selectively modify QosPolicy settings as desired.
|
||||
* topicQos << dds::core::policy::Durability::Transient();
|
||||
* // 3) Use the resulting QoS to construct the DataReader.
|
||||
* dds::topic::Topic<Foo::Bar> topic(participant, "TopicName", topicQos);
|
||||
* @endcode
|
||||
*
|
||||
* <i>Existing Topic Name</i><br>
|
||||
* Before creating a new Topic, this operation performs a
|
||||
* lookup_topicdescription for the specified topic_name. When a Topic is
|
||||
* found with the same name in the current domain, the QoS and type_name of the
|
||||
* found Topic are matched against the parameters qos and type_name. When they
|
||||
* are the same, no Topic is created but a new proxy of the existing Topic is returned.
|
||||
* When they are not exactly the same, no Topic is created and dds::core::Error is thrown.
|
||||
*
|
||||
* <i>Local Proxy</i><br>
|
||||
* Since a Topic is a global concept in the system, access is provided through a local
|
||||
* proxy. In other words, the reference returned is actually not a reference to a Topic
|
||||
* but to a locally created proxy. The Data Distribution Service propagates Topics
|
||||
* and makes remotely created Topics locally available through this proxy. The deletion
|
||||
* of a Topic object will not delete the Topic from the domain, just the local proxy is
|
||||
* deleted.
|
||||
*
|
||||
* <i>Listener</i><br>
|
||||
* The following statuses are applicable to the TopicListener:
|
||||
* - dds::core::status::StatusMask::inconsistent_topic()
|
||||
*
|
||||
* See @ref DCPS_Modules_Infrastructure_Listener "listener concept",
|
||||
* @ref anchor_dds_topic_listener_commstatus "communication status" and
|
||||
* @ref anchor_dds_topic_listener_commpropagation "communication propagation"
|
||||
* for more information.
|
||||
*
|
||||
* @param dp the domain participant on which the topic will be defined
|
||||
* @param topic_name the topic's name
|
||||
* @param qos the topic listener
|
||||
* @param listener the topic listener
|
||||
* @param mask the listener event mask
|
||||
* @throws dds::core::Error
|
||||
* A other Topic with the same name but different type or QoS was
|
||||
* detected in the current domain or another internal error has occurred.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds::topic::TopicListener<T>* listener = NULL,
|
||||
const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none());
|
||||
|
||||
/**
|
||||
* Create a new Topic.
|
||||
*
|
||||
* This operation creates a reference to a new or existing Topic under the given name,
|
||||
* for a specific data type and type_name.
|
||||
*
|
||||
* <i>QoS</i><br>
|
||||
* A possible application pattern to construct the TopicQos for the
|
||||
* Topic is to:
|
||||
* @code{.cpp}
|
||||
* // 1) Retrieve the QosPolicy settings on the associated DomainParticipant
|
||||
* dds::topic::qos::TopicQos topicQos = participant.default_datareader_qos();
|
||||
* // 2) Selectively modify QosPolicy settings as desired.
|
||||
* topicQos << dds::core::policy::Durability::Transient();
|
||||
* // 3) Use the resulting QoS to construct the DataReader.
|
||||
* dds::topic::Topic<Foo::Bar> topic(participant, "TopicName", "TypeName", topicQos);
|
||||
* @endcode
|
||||
*
|
||||
* <i>Existing Topic Name</i><br>
|
||||
* Before creating a new Topic, this operation performs a
|
||||
* lookup_topicdescription for the specified topic_name. When a Topic is
|
||||
* found with the same name in the current domain, the QoS and type_name of the
|
||||
* found Topic are matched against the parameters qos and type_name. When they
|
||||
* are the same, no Topic is created but a new proxy of the existing Topic is returned.
|
||||
* When they are not exactly the same, no Topic is created and dds::core::Error is thrown.
|
||||
*
|
||||
* <i>Local Proxy</i><br>
|
||||
* Since a Topic is a global concept in the system, access is provided through a local
|
||||
* proxy. In other words, the reference returned is actually not a reference to a Topic
|
||||
* but to a locally created proxy. The Data Distribution Service propagates Topics
|
||||
* and makes remotely created Topics locally available through this proxy. The deletion
|
||||
* of a Topic object will not delete the Topic from the domain, just the local proxy is
|
||||
* deleted.
|
||||
*
|
||||
* <i>Listener</i><br>
|
||||
* The following statuses are applicable to the TopicListener:
|
||||
* - dds::core::status::StatusMask::inconsistent_topic()
|
||||
*
|
||||
* See @ref DCPS_Modules_Infrastructure_Listener "listener concept",
|
||||
* @ref anchor_dds_topic_listener_commstatus "communication status" and
|
||||
* @ref anchor_dds_topic_listener_commpropagation "communication propagation"
|
||||
* for more information.
|
||||
*
|
||||
* @param dp the domain participant on which the topic will be defined
|
||||
* @param topic_name the topic's name
|
||||
* @param type_name a local alias of the data type
|
||||
* @param qos the topic listener
|
||||
* @param listener the topic listener
|
||||
* @param mask the listener event mask
|
||||
* @throws dds::core::Error
|
||||
* A other Topic with the same name but different type or QoS was
|
||||
* detected in the current domain or another internal error has occurred.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const std::string& type_name,
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds::topic::TopicListener<T>* listener = NULL,
|
||||
const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none());
|
||||
|
||||
#if defined (OMG_DDS_X_TYPE_DYNAMIC_TYPES_SUPPORT)
|
||||
/**
|
||||
* Create a new topic with a dynamic type description. Notice that in this
|
||||
* case the data type has to be DynamicData, so the Topic type will be
|
||||
* Topic<DynamicData>.
|
||||
*
|
||||
* @param dp the domain participant on which the topic will be defined
|
||||
* @param topic_name the topic's name. The QoS will be set to
|
||||
* dp.default_topic_qos().
|
||||
* @param type the topic type
|
||||
* @throws dds::core::Error
|
||||
* A other Topic with the same name but different type or QoS was
|
||||
* detected in the current domain or another internal error has occurred.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const dds::core::xtypes::DynamicType type);
|
||||
|
||||
/**
|
||||
* Create a new topic with a dynamic type description. Notice that in this
|
||||
* case the data type has to be DynamicData, so the Topic type will be
|
||||
* Topic<DynamicData>.
|
||||
*
|
||||
* @param dp the domain participant on which the topic will be defined
|
||||
* @param topic_name the topic's name
|
||||
* @param type the topic type
|
||||
* @param qos the topic listener
|
||||
* @param listener the topic listener
|
||||
* @param mask the listener event mask
|
||||
* @throws dds::core::Error
|
||||
* A other Topic with the same name but different type or QoS was
|
||||
* detected in the current domain or another internal error has occurred.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const dds::core::xtypes::DynamicType type
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds::topic::TopicListener<T>* listener = NULL,
|
||||
const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none());
|
||||
|
||||
#endif /* OMG_DDS_X_TYPE_DYNAMIC_TYPES_SUPPORT */
|
||||
|
||||
public:
|
||||
/**
|
||||
* Register a listener with the Topic.
|
||||
*
|
||||
* This operation attaches a TopicListener to the Topic. Only one
|
||||
* TopicListener can be attached to each Topic. If a
|
||||
* TopicListener was already attached, the operation will replace it with the
|
||||
* new one. When the listener is the NULL pointer, it represents a listener that is
|
||||
* treated as a NOOP for all statuses activated in the bit mask.
|
||||
*
|
||||
* Listener un-registration is performed by setting the listener to NULL and mask none().
|
||||
*
|
||||
* @anchor anchor_dds_topic_listener_commstatus
|
||||
* <i>Communication Status</i><br>
|
||||
* For each communication status, the StatusChangedFlag flag is initially set to
|
||||
* FALSE. It becomes TRUE whenever that communication status changes. For each
|
||||
* communication status activated in the mask, the associated TopicListener
|
||||
* operation is invoked and the communication status is reset to FALSE, as the listener
|
||||
* implicitly accesses the status which is passed as a parameter to that operation. The
|
||||
* status is reset prior to calling the listener, so if the application calls the
|
||||
* get_<status_name>_status from inside the listener it will see the status
|
||||
* already reset. An exception to this rule is the NULL listener, which does not reset the
|
||||
* communication statuses for which it is invoked.
|
||||
*
|
||||
* The following statuses are applicable to the TopicListener:
|
||||
* - dds::core::status::StatusMask::inconsistent_topic()
|
||||
*
|
||||
* Status bits are declared as a constant and can be used by the application in an OR
|
||||
* operation to create a tailored mask. The special constant dds::core::status::StatusMask::none()
|
||||
* can be used to indicate that the created entity should not respond to any of its available
|
||||
* statuses. The DDS will therefore attempt to propagate these statuses to its factory.
|
||||
* The special constant dds::core::status::StatusMask::all() can be used to select all applicable
|
||||
* statuses specified in the “Data Distribution Service for Real-time Systems Version
|
||||
* 1.2” specification which are applicable to the PublisherListener.
|
||||
*
|
||||
* @anchor anchor_dds_topic_listener_commpropagation
|
||||
* <i>Status Propagation</i><br>
|
||||
* In case a communication status is not activated in the mask of the
|
||||
* TopicListener, the DomainParticipantListener of the containing DomainParticipant
|
||||
* is invoked (if attached and activated for the status that occurred). This allows the
|
||||
* application to set a default behaviour in the DomainParticipantListener of the containing
|
||||
* DomainParticipant and a Topic specific behaviour when needed. In case the
|
||||
* communication status is not activated in the mask of the DomainParticipantListener as
|
||||
* well, the application is not notified of the change.
|
||||
*
|
||||
* See also @ref DCPS_Modules_Infrastructure_Listener "listener information".
|
||||
*
|
||||
* @param listener the listener
|
||||
* @param event_mask the mask defining the events for which the listener
|
||||
* will be notified.
|
||||
* @throws dds::core::Error
|
||||
* An internal error has occurred.
|
||||
* @throws dds::core::NullReferenceError
|
||||
* The entity was not properly created and references to dds::core::null.
|
||||
* @throws dds::core::AlreadyClosedError
|
||||
* The entity has already been closed.
|
||||
* @throws dds::core::UnsupportedError
|
||||
* A status was selected that cannot be supported because
|
||||
* the infrastructure does not maintain the required connectivity information.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
*/
|
||||
void listener(Listener* listener,
|
||||
const ::dds::core::status::StatusMask& event_mask);
|
||||
|
||||
/**
|
||||
* Get the listener of this Topic.
|
||||
*
|
||||
* See also @ref DCPS_Modules_Infrastructure_Listener "listener information".
|
||||
*
|
||||
* @return the listener
|
||||
* @throws dds::core::NullReferenceError
|
||||
* The entity was not properly created and references to dds::core::null.
|
||||
*/
|
||||
Listener* listener() const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* OMG_DDS_TTOPIC_TOPIC_HPP_ */
|
||||
85
unitree_SDK/include/ddscxx/dds/topic/TTopicDescription.hpp
Normal file
85
unitree_SDK/include/ddscxx/dds/topic/TTopicDescription.hpp
Normal file
@@ -0,0 +1,85 @@
|
||||
#ifndef OMG_DDS_T_TOPIC_TOPIC_DESCRIPTION_HPP_
|
||||
#define OMG_DDS_T_TOPIC_TOPIC_DESCRIPTION_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/core/TEntity.hpp>
|
||||
#include <dds/topic/TopicTraits.hpp>
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename DELEGATE>
|
||||
class TTopicDescription;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* This class is the base for Topic, ContentFilteredTopic and MultiTopic.
|
||||
*
|
||||
* The TopicDescription attribute type_name defines an unique data type that is
|
||||
* made available to the Data Distribution Service when a Topic is created with
|
||||
* that type.<br>
|
||||
* TopicDescription has also a name that allows it to be retrieved locally.
|
||||
*
|
||||
* @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
|
||||
*/
|
||||
template <typename DELEGATE>
|
||||
class dds::topic::TTopicDescription : public virtual dds::core::Reference<DELEGATE>
|
||||
{
|
||||
public:
|
||||
OMG_DDS_REF_TYPE_PROTECTED_DC(TTopicDescription, dds::core::Reference, DELEGATE)
|
||||
OMG_DDS_IMPLICIT_REF_BASE(TTopicDescription)
|
||||
OMG_DDS_COMPLETE_RULE_OF_FIVE_VIRTUAL_EXPLICIT(TTopicDescription)
|
||||
|
||||
public:
|
||||
/**
|
||||
* This operation returns the name used to create the TopicDescription.
|
||||
*
|
||||
* @return the TopicDescription name
|
||||
*/
|
||||
const std::string& name() const;
|
||||
|
||||
/**
|
||||
* This operation returns the registered name of the data type associated
|
||||
* with the TopicDescription.
|
||||
*
|
||||
* @return the type_name
|
||||
*/
|
||||
const std::string& type_name() const;
|
||||
|
||||
/**
|
||||
* This operation returns the DomainParticipant associated with the
|
||||
* TopicDescription.
|
||||
*
|
||||
* Note that there is exactly one DomainParticipant associated with
|
||||
* each TopicDescription.
|
||||
*
|
||||
* @return the DomainParticipant
|
||||
*/
|
||||
const dds::domain::DomainParticipant& domain_participant() const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* OMG_DDS_T_TOPIC_TOPIC_DESCRIPTION_HPP_ */
|
||||
41
unitree_SDK/include/ddscxx/dds/topic/Topic.hpp
Normal file
41
unitree_SDK/include/ddscxx/dds/topic/Topic.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef OMG_DDS_TOPIC_TOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_TOPIC_HPP_
|
||||
|
||||
#include <dds/topic/detail/Topic.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename T, template <typename Q> class DELEGATE = dds::topic::detail::Topic>
|
||||
class Topic;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo RTF Issue - moved include
|
||||
* @note This include was moved here as MSVC appears to ignore any
|
||||
* attempt to 're-declare' a template class with a default argument like:
|
||||
* dds/pub/detail/DataWriter.hpp(54): error C2976: 'dds::topic::Topic' : too few template arguments
|
||||
* dds/topic/TTopic.hpp(50) : see declaration of 'dds::topic::Topic'
|
||||
*/
|
||||
#include <dds/topic/TTopic.hpp>
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_TOPIC_HPP_ */
|
||||
33
unitree_SDK/include/ddscxx/dds/topic/TopicDescription.hpp
Normal file
33
unitree_SDK/include/ddscxx/dds/topic/TopicDescription.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef OMG_DDS_TOPIC_TOPIC_DESCRIPTION_HPP_
|
||||
#define OMG_DDS_TOPIC_TOPIC_DESCRIPTION_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/topic/detail/TopicDescription.hpp>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
typedef ::dds::topic::detail::TopicDescription TopicDescription;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_TOPIC_DESCRIPTION_HPP_ */
|
||||
116
unitree_SDK/include/ddscxx/dds/topic/TopicInstance.hpp
Normal file
116
unitree_SDK/include/ddscxx/dds/topic/TopicInstance.hpp
Normal file
@@ -0,0 +1,116 @@
|
||||
#ifndef OMG_DDS_TOPIC_TOPIC_INSTANCE_HPP_
|
||||
#define OMG_DDS_TOPIC_TOPIC_INSTANCE_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/core/Time.hpp>
|
||||
#include <dds/core/InstanceHandle.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename T>
|
||||
class TopicInstance;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* A TopicInstance encapsulates a dds::sub::Sample and its associated
|
||||
* dds::core::InstanceHandle.
|
||||
*
|
||||
* @see for more information: @ref DCPS_Modules_TopicDefinition "Topic Definition"
|
||||
* @see for more information: @ref dds::sub::Sample
|
||||
* @see for more information: @ref dds::core::InstanceHandle
|
||||
*/
|
||||
template <typename T>
|
||||
class dds::topic::TopicInstance
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Construct a TopicInstance.
|
||||
*/
|
||||
TopicInstance();
|
||||
|
||||
/**
|
||||
* Construct a TopicInstance with an InstanceHandle.
|
||||
*
|
||||
* @param h the InstanceHandle
|
||||
*/
|
||||
explicit TopicInstance(const ::dds::core::InstanceHandle& h);
|
||||
|
||||
/**
|
||||
* Construct a TopicInstance with an InstanceHandle and a sample type.
|
||||
*
|
||||
* @param h the InstanceHandle
|
||||
* @param sample the <Type>
|
||||
*/
|
||||
TopicInstance(const ::dds::core::InstanceHandle& h, const T& sample);
|
||||
|
||||
public:
|
||||
/**
|
||||
* Conversion operator to get the InstanceHandle.
|
||||
*
|
||||
* @return the InstanceHandle for the TopicInstance
|
||||
*/
|
||||
operator const ::dds::core::InstanceHandle() const;
|
||||
|
||||
/**
|
||||
* Get the InstanceHandle.
|
||||
*
|
||||
* @return the InstanceHandle for the TopicInstance
|
||||
*/
|
||||
const ::dds::core::InstanceHandle handle() const;
|
||||
|
||||
/**
|
||||
* Set the InstanceHandle.
|
||||
*
|
||||
* @param h the InstanceHandle to set to the TopicInstance
|
||||
*/
|
||||
void handle(const ::dds::core::InstanceHandle& h);
|
||||
|
||||
/**
|
||||
* Get the data sample
|
||||
*
|
||||
* @return the sample for the TopicInstance
|
||||
*/
|
||||
const T& sample() const;
|
||||
|
||||
/**
|
||||
* Get the data sample
|
||||
*
|
||||
* @return the sample for the TopicInstance
|
||||
*/
|
||||
T& sample();
|
||||
|
||||
/**
|
||||
* Set the data sample
|
||||
*
|
||||
* @param sample send a sample for this TopicInstance
|
||||
*/
|
||||
void sample(const T& sample);
|
||||
|
||||
private:
|
||||
::dds::core::InstanceHandle h_;
|
||||
T sample_;
|
||||
};
|
||||
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_TOPIC_INSTANCE_HPP_ */
|
||||
144
unitree_SDK/include/ddscxx/dds/topic/TopicListener.hpp
Normal file
144
unitree_SDK/include/ddscxx/dds/topic/TopicListener.hpp
Normal file
@@ -0,0 +1,144 @@
|
||||
#ifndef OMG_DDS_TOPIC_TOPIC_LISTENER_HPP_
|
||||
#define OMG_DDS_TOPIC_TOPIC_LISTENER_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "dds/topic/Topic.hpp"
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Topic events Listener
|
||||
*
|
||||
* Since a Topic is an Entity, it has the ability to have a Listener
|
||||
* associated with it. In this case, the associated Listener should be of type
|
||||
* TopicListener. This interface must be implemented by the
|
||||
* application. A user-defined class must be provided by the application which must
|
||||
* extend from the TopicListener class.
|
||||
*
|
||||
* <b><i>
|
||||
* All operations for this interface must be implemented in the user-defined class, it is
|
||||
* up to the application whether an operation is empty or contains some functionality.
|
||||
* </i></b>
|
||||
*
|
||||
* The TopicListener provides a generic mechanism (actually a
|
||||
* callback function) for the Data Distribution Service to notify the application of
|
||||
* relevant asynchronous status change events, such as a missed deadline, violation of
|
||||
* a QosPolicy setting, etc. The TopicListener is related to
|
||||
* changes in communication status StatusConditions.
|
||||
*
|
||||
* @code{.cpp}
|
||||
* // Application example listener
|
||||
* class ExampleListener :
|
||||
* public virtual dds::topic::TopicListener<Foo::Bar>
|
||||
* {
|
||||
* public:
|
||||
* virtual void on_inconsistent_topic (
|
||||
* dds::topic::Topic<Foo::Bar>& topic,
|
||||
* const dds::core::status::InconsistentTopicStatus& status)
|
||||
* {
|
||||
* std::cout << "on_inconsistent_topic" << std::endl;
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* // Create Topic with the listener
|
||||
* dds::domain::DomainParticipant participant(org::eclipse::cyclonedds::domain::default_id());
|
||||
* dds::topic::Topic<Foo::Bar> topic(participant,
|
||||
* "TopicName",
|
||||
* participant.default_topic_qos(),
|
||||
* new ExampleListener(),
|
||||
* dds::core::status::StatusMask::all());
|
||||
*
|
||||
* @endcode
|
||||
*
|
||||
* @see for more information: @ref DCPS_Modules_Topic "Topic"
|
||||
* @see for more information: @ref DCPS_Modules_Infrastructure_Listener "Listener information"
|
||||
*/
|
||||
template <typename T>
|
||||
class TopicListener
|
||||
{
|
||||
public:
|
||||
/** @cond */
|
||||
virtual ~TopicListener() { }
|
||||
/** @endcond */
|
||||
|
||||
public:
|
||||
/**
|
||||
* This operation is called by the Data Distribution Service when the
|
||||
* InconsistentTopicStatus changes.
|
||||
*
|
||||
* The implementation may be left empty
|
||||
* when this functionality is not needed. This operation will only be called when the
|
||||
* relevant TopicListener is installed and enabled with the
|
||||
* StatusMask::inconsistent_topic(). The InconsistentTopicStatus will change
|
||||
* when another Topic exists with the same topic_name but different
|
||||
* characteristics.
|
||||
*
|
||||
* @param topic contain a pointer to the Topic on which the conflict
|
||||
* occurred (this is an input to the application).
|
||||
* @param status contain the InconsistentTopicStatus object (this is
|
||||
* an input to the application).
|
||||
*/
|
||||
virtual void on_inconsistent_topic(
|
||||
Topic<T>& topic,
|
||||
const dds::core::status::InconsistentTopicStatus& status) = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Topic events Listener
|
||||
*
|
||||
* This listener is just like TopicListener, except
|
||||
* that the application doesn't have to implement all operations.
|
||||
*
|
||||
* @code{.cpp}
|
||||
* class ExampleListener : public virtual dds::topic::NoOpTopicListener<Foo::Bar>
|
||||
* {
|
||||
* // Not necessary to implement any Listener operations.
|
||||
* };
|
||||
* @endcode
|
||||
*
|
||||
* @see dds::topic::TopicListener
|
||||
*/
|
||||
template <typename T>
|
||||
class NoOpTopicListener : public virtual TopicListener<T>
|
||||
{
|
||||
/** @cond
|
||||
* All these functions have already been documented in the non-NoOp listener.
|
||||
* Ignore these functions for the doxygen API documentation for clarity.
|
||||
*/
|
||||
public:
|
||||
virtual ~NoOpTopicListener() { }
|
||||
|
||||
public:
|
||||
virtual void on_inconsistent_topic(
|
||||
Topic<T>&,
|
||||
const dds::core::status::InconsistentTopicStatus&) { }
|
||||
/** @endcond */
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_TOPIC_LISTENER_HPP_ */
|
||||
92
unitree_SDK/include/ddscxx/dds/topic/TopicTraits.hpp
Normal file
92
unitree_SDK/include/ddscxx/dds/topic/TopicTraits.hpp
Normal file
@@ -0,0 +1,92 @@
|
||||
#ifndef OMG_DDS_TOPIC_TOPIC_TRAITS_HPP_
|
||||
#define OMG_DDS_TOPIC_TOPIC_TRAITS_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
//==============================================================================
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename T>
|
||||
struct is_topic_type;
|
||||
|
||||
/** @cond */
|
||||
template <typename T>
|
||||
struct topic_type_support;
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Support functionality to get the default type_name of a Topic type.
|
||||
*
|
||||
* @code{.cpp}
|
||||
* std::string typeName = dds::topic::topic_type_name<Foo::Bar>::value();
|
||||
* @endcode
|
||||
*/
|
||||
template <typename T>
|
||||
struct topic_type_name
|
||||
{
|
||||
static std::string value()
|
||||
{
|
||||
return "Undefined";
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
* @brief
|
||||
* Support functionality to check if a given object type is a Topic.
|
||||
*
|
||||
* @code{.cpp}
|
||||
* if (dds::topic::is_topic_type<Foo::Bar>::value) {
|
||||
* // Foo::Bar type is considered a Topic
|
||||
* } else {
|
||||
* // Foo::Bar type is NOT considered a Topic
|
||||
* }
|
||||
* @endcode
|
||||
*/
|
||||
template <typename T>
|
||||
struct dds::topic::is_topic_type
|
||||
{
|
||||
enum {value = 0 };
|
||||
};
|
||||
|
||||
|
||||
/** @cond
|
||||
* IsoCpp doesn't know the TypeSupport concept. The type is automatically
|
||||
* registered when an Topic is created. So, what does this function do?
|
||||
*/
|
||||
template <typename T>
|
||||
struct dds::topic::topic_type_support { };
|
||||
/** @endcond */
|
||||
|
||||
|
||||
#define REGISTER_TOPIC_TYPE(TOPIC_TYPE) \
|
||||
namespace dds { namespace topic { \
|
||||
template<> struct is_topic_type<TOPIC_TYPE> { \
|
||||
enum { value = 1 }; \
|
||||
}; } }
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_TOPIC_TRAITS_HPP_ */
|
||||
31
unitree_SDK/include/ddscxx/dds/topic/ddstopic.hpp
Normal file
31
unitree_SDK/include/ddscxx/dds/topic/ddstopic.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef OMG_DDS_TOPIC_PACKAGE_INCLUDE_HPP_
|
||||
#define OMG_DDS_TOPIC_PACKAGE_INCLUDE_HPP_
|
||||
|
||||
#include <dds/topic/qos/TopicQos.hpp>
|
||||
#include <dds/topic/TopicDescription.hpp>
|
||||
#include <dds/topic/Topic.hpp>
|
||||
#include <dds/topic/AnyTopic.hpp>
|
||||
#include <dds/topic/ContentFilteredTopic.hpp>
|
||||
#include <dds/topic/discovery.hpp>
|
||||
#include <dds/topic/find.hpp>
|
||||
|
||||
#include <dds/topic/detail/ddstopic.hpp>
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_PACKAGE_INCLUDE_HPP_ */
|
||||
30
unitree_SDK/include/ddscxx/dds/topic/detail/AnyTopic.hpp
Normal file
30
unitree_SDK/include/ddscxx/dds/topic/detail/AnyTopic.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef OMG_DDS_TOPIC_DETAIL_ANY_TOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_DETAIL_ANY_TOPIC_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
// Implementation
|
||||
|
||||
#include <dds/topic/detail/TAnyTopicImpl.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/AnyTopicDelegate.hpp>
|
||||
|
||||
namespace dds { namespace topic { namespace detail {
|
||||
typedef dds::topic::TAnyTopic<org::eclipse::cyclonedds::topic::AnyTopicDelegate> AnyTopic;
|
||||
} } }
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_DETAIL_ANY_TOPIC_HPP_ */
|
||||
46
unitree_SDK/include/ddscxx/dds/topic/detail/BuiltinTopic.hpp
Normal file
46
unitree_SDK/include/ddscxx/dds/topic/detail/BuiltinTopic.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/topic/Topic.hpp>
|
||||
#include <dds/topic/detail/TTopicImpl.hpp>
|
||||
#include <dds/topic/detail/TBuiltinTopicImpl.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/BuiltinTopicDelegate.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/BuiltinTopic.hpp>
|
||||
|
||||
namespace dds { namespace topic { namespace detail {
|
||||
|
||||
typedef dds::topic::TParticipantBuiltinTopicData<org::eclipse::cyclonedds::topic::ParticipantBuiltinTopicDataDelegate>
|
||||
ParticipantBuiltinTopicData;
|
||||
|
||||
typedef dds::topic::TTopicBuiltinTopicData<org::eclipse::cyclonedds::topic::TopicBuiltinTopicDataDelegate>
|
||||
TopicBuiltinTopicData;
|
||||
|
||||
typedef dds::topic::TPublicationBuiltinTopicData<org::eclipse::cyclonedds::topic::PublicationBuiltinTopicDataDelegate>
|
||||
PublicationBuiltinTopicData;
|
||||
|
||||
typedef dds::topic::TSubscriptionBuiltinTopicData<org::eclipse::cyclonedds::topic::SubscriptionBuiltinTopicDataDelegate>
|
||||
SubscriptionBuiltinTopicData;
|
||||
|
||||
} } }
|
||||
|
||||
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_HPP_ */
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_KEY_HPP_
|
||||
#define OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_KEY_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <org/eclipse/cyclonedds/topic/BuiltinTopicKeyDelegate.hpp>
|
||||
#include <dds/topic/detail/TBuiltinTopicKeyImpl.hpp>
|
||||
|
||||
namespace dds { namespace topic { namespace detail {
|
||||
typedef dds::topic::TBuiltinTopicKey<org::eclipse::cyclonedds::topic::BuiltinTopicKeyDelegate> BuiltinTopicKey;
|
||||
} } }
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_DETAIL_BUILTIN_TOPIC_KEY_HPP_ */
|
||||
@@ -0,0 +1,470 @@
|
||||
#ifndef OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <dds/core/detail/conformance.hpp>
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/topic/Topic.hpp>
|
||||
#include <dds/topic/Filter.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/TopicDescriptionDelegate.hpp>
|
||||
#include <org/eclipse/cyclonedds/core/ScopedLock.hpp>
|
||||
#include <org/eclipse/cyclonedds/sub/AnyDataReaderDelegate.hpp>
|
||||
|
||||
#ifdef OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT
|
||||
|
||||
// Required for C++11
|
||||
#if __cplusplus == 201103L
|
||||
#include <org/eclipse/cyclonedds/core/Missing.hpp>
|
||||
#endif
|
||||
|
||||
// meta-programming helpers
|
||||
namespace detail
|
||||
{
|
||||
template<typename T>
|
||||
struct remove_first_from_tuple;
|
||||
|
||||
template<typename T, typename ... Ts>
|
||||
struct remove_first_from_tuple<std::tuple<T, Ts...>>
|
||||
{
|
||||
using type = std::tuple<Ts...>;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
using remove_first_from_tuple_t = typename remove_first_from_tuple<T>::type;
|
||||
|
||||
template<class F>
|
||||
struct callable_traits;
|
||||
|
||||
template<class R, class ... Args>
|
||||
struct callable_traits<R(Args...)>
|
||||
{
|
||||
using return_type = R;
|
||||
|
||||
static constexpr std::size_t Arity = sizeof...(Args);
|
||||
|
||||
template < std::size_t N, std::enable_if_t<N<Arity> * = nullptr>
|
||||
struct argument
|
||||
{
|
||||
using type = typename std::tuple_element<N, std::tuple<Args...>>::type;
|
||||
};
|
||||
|
||||
using argument_tuple = std::tuple<Args...>;
|
||||
};
|
||||
|
||||
// function pointer
|
||||
template<class R, class ... Args>
|
||||
struct callable_traits<R (*)(Args...)>
|
||||
: public callable_traits<R(Args...)> {};
|
||||
|
||||
// member function pointer
|
||||
template<class C, class R, class ... Args>
|
||||
struct callable_traits<R (C::*)(Args...)>
|
||||
: public callable_traits<R(C &, Args...)> {};
|
||||
|
||||
// const member function pointer
|
||||
template<class C, class R, class ... Args>
|
||||
struct callable_traits<R (C::*)(Args...) const>
|
||||
: public callable_traits<R(C &, Args...)> {};
|
||||
|
||||
// member object pointer
|
||||
template<class C, class R>
|
||||
struct callable_traits<R(C::*)>
|
||||
: public callable_traits<R(C &)> {};
|
||||
|
||||
// functor
|
||||
template<class F>
|
||||
struct callable_traits
|
||||
{
|
||||
private:
|
||||
using call_type = callable_traits<decltype(&F::operator())>;
|
||||
|
||||
public:
|
||||
using return_type = typename call_type::return_type;
|
||||
|
||||
static constexpr std::size_t Arity = call_type::Arity - 1;
|
||||
|
||||
template < std::size_t N, std::enable_if_t<N<Arity> * = nullptr>
|
||||
struct argument
|
||||
{
|
||||
using type = typename call_type::template argument<N + 1>::type;
|
||||
};
|
||||
|
||||
using argument_tuple = remove_first_from_tuple_t<typename call_type::argument_tuple>;
|
||||
};
|
||||
|
||||
template<class F>
|
||||
struct callable_traits<F &>
|
||||
: public callable_traits<F> {};
|
||||
|
||||
template<class F>
|
||||
struct callable_traits<F &&>
|
||||
: public callable_traits<F> {};
|
||||
|
||||
// Concepts of possible callbacks
|
||||
template<class F, class T>
|
||||
using sample_only_t = std::enable_if_t<callable_traits<std::decay_t<F>>::Arity == 1 &&
|
||||
std::is_same<typename callable_traits<std::decay_t<F>>::template argument<0>::type,
|
||||
const T &>::value &&
|
||||
std::is_same<typename callable_traits<std::decay_t<F>>::return_type, bool>::value
|
||||
>;
|
||||
|
||||
template<class F>
|
||||
using sample_info_only_t = std::enable_if_t<callable_traits<std::decay_t<F>>::Arity == 1 &&
|
||||
std::is_same<typename callable_traits<std::decay_t<F>>::template argument<0>::type,
|
||||
const dds::sub::SampleInfo &>::value &&
|
||||
std::is_same<typename callable_traits<std::decay_t<F>>::return_type, bool>::value
|
||||
>;
|
||||
|
||||
template<class F, class T>
|
||||
using sample_and_sample_info_t = std::enable_if_t<callable_traits<std::decay_t<F>>::Arity == 2 &&
|
||||
std::is_same<typename callable_traits<std::decay_t<F>>::template argument<0>::type,
|
||||
const T &>::value &&
|
||||
std::is_same<typename callable_traits<std::decay_t<F>>::template argument<1>::type,
|
||||
const dds::sub::SampleInfo &>::value &&
|
||||
std::is_same<typename callable_traits<std::decay_t<F>>::return_type, bool>::value
|
||||
>;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
namespace dds {
|
||||
namespace topic {
|
||||
namespace detail {
|
||||
|
||||
class FunctorHolderBase
|
||||
{
|
||||
public:
|
||||
FunctorHolderBase() = default;
|
||||
virtual ~FunctorHolderBase() = default;
|
||||
FunctorHolderBase(const FunctorHolderBase &) = default;
|
||||
FunctorHolderBase & operator=(const FunctorHolderBase &) = default;
|
||||
FunctorHolderBase(FunctorHolderBase &&) = default;
|
||||
FunctorHolderBase & operator=(FunctorHolderBase &&) = default;
|
||||
|
||||
virtual bool check_sample(const void * sample, const dds_sample_info_t * sample_info) = 0;
|
||||
|
||||
static bool c99_check_sample(const void *sample, void *arg)
|
||||
{
|
||||
auto funcHolder = static_cast<FunctorHolderBase *>(arg);
|
||||
return funcHolder->check_sample(sample, nullptr);
|
||||
}
|
||||
|
||||
static bool c99_check_sample_info(const dds_sample_info_t * sampleinfo, void * arg)
|
||||
{
|
||||
auto funcHolder = static_cast<FunctorHolderBase *>(arg);
|
||||
return funcHolder->check_sample(nullptr, sampleinfo);
|
||||
}
|
||||
|
||||
static bool c99_check_sample_and_sample_info(
|
||||
const void * sample,
|
||||
const dds_sample_info_t * sampleinfo, void * arg)
|
||||
{
|
||||
auto funcHolder = static_cast<FunctorHolderBase *>(arg);
|
||||
return funcHolder->check_sample(sample, sampleinfo);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename FUN, typename T, class = void>
|
||||
class FunctorHolder;
|
||||
|
||||
template <typename FUN, typename T>
|
||||
class FunctorHolder<FUN, T, ::detail::sample_only_t<FUN, T>>: public FunctorHolderBase
|
||||
{
|
||||
public:
|
||||
/* Remove const to be able to call non-const functors. */
|
||||
FunctorHolder(FUN functor)
|
||||
: myFunctor(std::move(functor)) {}
|
||||
|
||||
bool check_sample(const void * sample, const dds_sample_info_t *) override
|
||||
{
|
||||
return myFunctor(*(reinterpret_cast<const T*>(sample)));
|
||||
}
|
||||
|
||||
private:
|
||||
FUN myFunctor;
|
||||
};
|
||||
|
||||
template<typename FUN, typename T>
|
||||
class FunctorHolder<FUN, T, ::detail::sample_info_only_t<FUN>>: public FunctorHolderBase
|
||||
{
|
||||
public:
|
||||
/* Remove const to be able to call non-const functors. */
|
||||
FunctorHolder(FUN functor)
|
||||
: myFunctor(std::move(functor)) {}
|
||||
|
||||
bool check_sample(const void *, const dds_sample_info_t * sampleinfo) override
|
||||
{
|
||||
dds::sub::SampleInfo cxxSampleInfo;
|
||||
org::eclipse::cyclonedds::sub::AnyDataReaderDelegate::copy_sample_infos(
|
||||
*sampleinfo,
|
||||
cxxSampleInfo);
|
||||
return myFunctor(cxxSampleInfo);
|
||||
}
|
||||
|
||||
private:
|
||||
FUN myFunctor;
|
||||
};
|
||||
|
||||
template<typename FUN, typename T>
|
||||
class FunctorHolder<FUN, T, ::detail::sample_and_sample_info_t<FUN, T>>: public FunctorHolderBase
|
||||
{
|
||||
public:
|
||||
/* Remove const to be able to call non-const functors. */
|
||||
FunctorHolder(FUN functor)
|
||||
: myFunctor(std::move(functor)) {}
|
||||
|
||||
bool check_sample(const void * sample, const dds_sample_info_t * sampleinfo) override
|
||||
{
|
||||
dds::sub::SampleInfo cxxSampleInfo;
|
||||
org::eclipse::cyclonedds::sub::AnyDataReaderDelegate::copy_sample_infos(*sampleinfo,
|
||||
cxxSampleInfo);
|
||||
return myFunctor(*(reinterpret_cast<const T*>(sample)), cxxSampleInfo);
|
||||
}
|
||||
|
||||
private:
|
||||
FUN myFunctor;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class ContentFilteredTopic :
|
||||
public virtual org::eclipse::cyclonedds::topic::TopicDescriptionDelegate,
|
||||
public virtual org::eclipse::cyclonedds::core::DDScObjectDelegate
|
||||
{
|
||||
public:
|
||||
ContentFilteredTopic(
|
||||
const dds::topic::Topic<T>& topic,
|
||||
const std::string& name,
|
||||
const dds::topic::Filter& filter)
|
||||
: org::eclipse::cyclonedds::core::DDScObjectDelegate(),
|
||||
org::eclipse::cyclonedds::topic::TopicDescriptionDelegate(topic.domain_participant(), name, topic.type_name()),
|
||||
myTopic(topic),
|
||||
myFilter(filter),
|
||||
myFunctor(nullptr)
|
||||
{
|
||||
topic.delegate()->incrNrDependents();
|
||||
this->myParticipant.delegate()->add_cfTopic(*this);
|
||||
this->ser_type_ = topic->get_ser_type();
|
||||
}
|
||||
|
||||
virtual ~ContentFilteredTopic()
|
||||
{
|
||||
if (!this->closed) {
|
||||
try {
|
||||
this->close();
|
||||
} catch (...) {
|
||||
/* Empty: the exception throw should have already traced an error. */
|
||||
}
|
||||
}
|
||||
// delete the functor
|
||||
delete myFunctor;
|
||||
myFunctor = nullptr;
|
||||
}
|
||||
|
||||
virtual void close()
|
||||
{
|
||||
org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
|
||||
|
||||
myTopic.delegate()->decrNrDependents();
|
||||
|
||||
// Remove the ContentFilteredTopic from the list of topics in its participant.
|
||||
this->myParticipant.delegate()->remove_cfTopic(*this);
|
||||
|
||||
org::eclipse::cyclonedds::core::ObjectDelegate::close();
|
||||
}
|
||||
|
||||
void
|
||||
init(org::eclipse::cyclonedds::core::ObjectDelegate::weak_ref_type weak_ref)
|
||||
{
|
||||
/* Set weak_ref before passing ourselves to other isocpp objects. */
|
||||
this->set_weak_ref(weak_ref);
|
||||
/* Register topic at participant. */
|
||||
this->myParticipant.delegate()->add_cfTopic(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
#if 0
|
||||
void validate_filter()
|
||||
{
|
||||
q_expr expr = NULL;
|
||||
uint32_t length;
|
||||
c_value *params;
|
||||
|
||||
length = myFilter.parameters_length();
|
||||
if (length < 100) {
|
||||
expr = q_parse(myFilter.expression().c_str());
|
||||
if (!expr ) {
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
|
||||
"filter_expression '%s' is invalid", myFilter.expression().c_str());
|
||||
}
|
||||
} else {
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
|
||||
"Invalid number of filter_parameters '%d', maximum is 99", length);
|
||||
}
|
||||
|
||||
u_topic uTopic = (u_topic)(myTopic.delegate()->get_user_handle());
|
||||
|
||||
params = reader_parameters();
|
||||
if (!u_topicContentFilterValidate2(uTopic, expr, params)) {
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
|
||||
"filter_expression '%s' is invalid.", myFilter.expression().c_str());
|
||||
}
|
||||
q_dispose(expr);
|
||||
os_free(params);
|
||||
}
|
||||
#endif
|
||||
public:
|
||||
std::string reader_expression() const
|
||||
{
|
||||
std::string rExpr;
|
||||
|
||||
rExpr += "select * from ";
|
||||
rExpr += myTopic.name();
|
||||
rExpr += " where ";
|
||||
rExpr += myFilter.expression();
|
||||
return rExpr;
|
||||
}
|
||||
#if 0
|
||||
c_value *reader_parameters() const
|
||||
{
|
||||
c_value *params = NULL;
|
||||
uint32_t n, length;
|
||||
org::eclipse::cyclonedds::topic::FilterDelegate::const_iterator paramIterator;
|
||||
|
||||
length = myFilter.parameters_length();
|
||||
params = (c_value *)os_malloc(length * sizeof(struct c_value));
|
||||
for (n = 0, paramIterator = myFilter.begin(); n < length; n++, paramIterator++) {
|
||||
params[n] = c_stringValue(const_cast<char *>(paramIterator->c_str()));
|
||||
}
|
||||
return params;
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* @internal Accessor to return the topic filter.
|
||||
* @return The dds::topic::Filter in effect on this topic.
|
||||
*/
|
||||
const dds::topic::Filter& filter() const
|
||||
{
|
||||
return myFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal Sets the filter parameters for this content filtered topic.
|
||||
* @param begin The iterator holding the first string param
|
||||
* @param end The last item in the string iteration
|
||||
*/
|
||||
template <typename FWIterator>
|
||||
void filter_parameters(const FWIterator& begin, const FWIterator& end)
|
||||
{
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_UNSUPPORTED_ERROR, "Changing of Filter parameters is currently not supported.");
|
||||
myFilter.parameters(begin, end);
|
||||
//@todo validate_filter();
|
||||
}
|
||||
|
||||
const dds::topic::Topic<T>& topic() const
|
||||
{
|
||||
return myTopic;
|
||||
}
|
||||
|
||||
const std::string& filter_expression() const
|
||||
{
|
||||
return myFilter.expression();
|
||||
}
|
||||
|
||||
const dds::core::StringSeq filter_parameters() const
|
||||
{
|
||||
return dds::core::StringSeq(myFilter.begin(), myFilter.end());
|
||||
}
|
||||
#if 0
|
||||
dds::topic::TTopicDescription<TopicDescriptionDelegate> clone()
|
||||
{
|
||||
org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
|
||||
|
||||
typename dds::topic::ContentFilteredTopic<T, ContentFilteredTopic>::DELEGATE_REF_T ref(
|
||||
new ContentFilteredTopic<T>(this->myTopic, this->myTopicName, this->myFilter));
|
||||
ref->init(ref);
|
||||
|
||||
return dds::topic::ContentFilteredTopic<T, ContentFilteredTopic>(ref);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class Functor, ::detail::sample_only_t<Functor, T> * = nullptr>
|
||||
void filter_function(Functor && func)
|
||||
{
|
||||
dds_topic_filter flt;
|
||||
flt.mode = DDS_TOPIC_FILTER_SAMPLE_ARG;
|
||||
flt.f.sample_arg = &FunctorHolderBase::c99_check_sample;
|
||||
filter_function_internal(std::forward<Functor>(func), &flt);
|
||||
}
|
||||
|
||||
template<class Functor, ::detail::sample_info_only_t<Functor> * = nullptr>
|
||||
void filter_function(Functor && func)
|
||||
{
|
||||
dds_topic_filter flt;
|
||||
flt.mode = DDS_TOPIC_FILTER_SAMPLEINFO_ARG;
|
||||
flt.f.sampleinfo_arg = &FunctorHolderBase::c99_check_sample_info;
|
||||
filter_function_internal(std::forward<Functor>(func), &flt);
|
||||
}
|
||||
|
||||
template<class Functor, ::detail::sample_and_sample_info_t<Functor, T> * = nullptr>
|
||||
void filter_function(Functor && func)
|
||||
{
|
||||
dds_topic_filter flt;
|
||||
flt.mode = DDS_TOPIC_FILTER_SAMPLE_SAMPLEINFO_ARG;
|
||||
flt.f.sample_sampleinfo_arg = &FunctorHolderBase::c99_check_sample_and_sample_info;
|
||||
filter_function_internal(std::forward<Functor>(func), &flt);
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename Functor>
|
||||
void filter_function_internal(Functor && func, dds_topic_filter * flt)
|
||||
{
|
||||
/* Make a private copy of the topic so my filter doesn't bother the original topic. */
|
||||
dds_qos_t* ddsc_qos = myTopic.qos()->ddsc_qos();
|
||||
ddsi_sertype *st = org::eclipse::cyclonedds::topic::TopicTraits<T>::getSerType();
|
||||
dds_entity_t cfTopic = dds_create_topic_sertype(
|
||||
myTopic.domain_participant().delegate()->get_ddsc_entity(), myTopic.name().c_str(), &st, ddsc_qos, NULL, NULL);
|
||||
dds_delete_qos(ddsc_qos);
|
||||
this->set_ddsc_entity(cfTopic);
|
||||
|
||||
org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
|
||||
if (this->myFunctor)
|
||||
{
|
||||
delete this->myFunctor;
|
||||
}
|
||||
myFunctor = new FunctorHolder<Functor, T>(std::forward<Functor>(func));
|
||||
flt->arg = myFunctor;
|
||||
dds_set_topic_filter_extended(cfTopic, flt);
|
||||
}
|
||||
|
||||
dds::topic::Topic<T> myTopic;
|
||||
dds::topic::Filter myFilter;
|
||||
FunctorHolderBase *myFunctor;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT */
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_ */
|
||||
25
unitree_SDK/include/ddscxx/dds/topic/detail/Filter.hpp
Normal file
25
unitree_SDK/include/ddscxx/dds/topic/detail/Filter.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef DDS_TOPIC_DETAIL_QUERY_HPP_
|
||||
#define DDS_TOPIC_DETAIL_QUERY_HPP_
|
||||
|
||||
#include <dds/topic/detail/TFilterImpl.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/FilterDelegate.hpp>
|
||||
|
||||
namespace dds {
|
||||
namespace topic {
|
||||
namespace detail {
|
||||
typedef ::dds::topic::TFilter< ::org::eclipse::cyclonedds::topic::FilterDelegate > Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* DDS_TOPIC_DETAIL_QUERY_HPP_ */
|
||||
135
unitree_SDK/include/ddscxx/dds/topic/detail/MultiTopic.hpp
Normal file
135
unitree_SDK/include/ddscxx/dds/topic/detail/MultiTopic.hpp
Normal file
@@ -0,0 +1,135 @@
|
||||
#ifndef OMG_DDS_TOPIC_DETAIL_MULTI_TOPIC_HPP_
|
||||
#define OMG_DDS_TOPIC_DETAIL_MULTI_TOPIC_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
#include <dds/topic/detail/TopicDescription.hpp>
|
||||
#include <dds/core/Query.hpp>
|
||||
|
||||
#ifdef OMG_DDS_MULTI_TOPIC_SUPPORT
|
||||
|
||||
namespace dds { namespace topic { namespace detail {
|
||||
|
||||
|
||||
template <typename T>
|
||||
class MultiTopic : public org::eclipse::cyclonedds::topic::TopicDescriptionDelegate
|
||||
{
|
||||
public:
|
||||
MultiTopic(
|
||||
const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const std::string expression,
|
||||
const FWDIterator& params_begin,
|
||||
const FWDIterator& params_end)
|
||||
: ::dds::core::Reference< DELEGATE<T> >(
|
||||
new dds::topic::detail::MultiTopic<T>(dp, name, expression, params_begin, params_end))
|
||||
{
|
||||
// Set the correct (IDL) type_name in the TopicDescription.
|
||||
dds::topic::detail::TopicDescription<T>::myTypeName = org::eclipse::cyclonedds::topic::TopicTraits<T>::getTypeName();
|
||||
|
||||
//@todo validate_filter();
|
||||
}
|
||||
|
||||
virtual ~MultiTopic()
|
||||
{
|
||||
// Assume destructor of Filter attribute cleans up itself.
|
||||
}
|
||||
|
||||
private:
|
||||
#if 0
|
||||
void validate_filter()
|
||||
{
|
||||
q_expr expr = NULL;
|
||||
uint32_t length;
|
||||
c_value *params;
|
||||
|
||||
length = myFilter.parameters_length();
|
||||
if (length < 100) {
|
||||
expr = q_parse(myFilter.expression().c_str());
|
||||
if (!expr ) {
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
|
||||
"filter_expression '%s' is invalid", myFilter.expression().c_str());
|
||||
}
|
||||
} else {
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
|
||||
"Invalid number of filter_parameters '%d', maximum is 99", length);
|
||||
}
|
||||
|
||||
params = reader_parameters();
|
||||
/* The function below does not exist yet, but probably a function like it will need to be developed. */
|
||||
if (!u_topicMultiExprValidate(dp.delegate()->get_user_handle(), myFilter.expression().c_str(), params)) {
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
|
||||
"filter_expression '%s' is invalid.", myFilter.expression().c_str());
|
||||
}
|
||||
q_dispose(expr);
|
||||
os_free(params);
|
||||
}
|
||||
#endif
|
||||
public:
|
||||
std::string reader_expression() const
|
||||
{
|
||||
return myFilter.expression();
|
||||
}
|
||||
#if 0
|
||||
c_value *reader_parameters() const
|
||||
{
|
||||
c_value *params = NULL;
|
||||
uint32_t n, length;
|
||||
org::eclipse::cyclonedds::topic::FilterDelegate::const_iterator paramIterator;
|
||||
|
||||
length = myFilter.parameters_length();
|
||||
params = (c_value *)os_malloc(length * sizeof(struct c_value));
|
||||
for (n = 0, paramIterator = myFilter.begin(); n < length; n++, paramIterator++) {
|
||||
params[n] = c_stringValue(const_cast<char *>(paramIterator->c_str()));
|
||||
}
|
||||
return params;
|
||||
}
|
||||
#endif
|
||||
const std::string expression() const
|
||||
{
|
||||
return myFilter.expression();
|
||||
}
|
||||
|
||||
template <typename FWIterator>
|
||||
void expression_parameters(const FWIterator& params_begin, const FWIterator& params_end)
|
||||
{
|
||||
myFilter.parameters(begin, end);
|
||||
validate_filter();
|
||||
}
|
||||
|
||||
const dds::core::StringSeq expression_parameters() const
|
||||
{
|
||||
return dds::core::StringSeq(myFilter.begin(), myFilter.end());
|
||||
}
|
||||
|
||||
private:
|
||||
dds::topic::Filter myFilter;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* OMG_DDS_MULTI_TOPIC_SUPPORT */
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_DETAIL_MULTI_TOPIC_HPP_ */
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_TANYTOPIC_IMPL_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_TANYTOPIC_IMPL_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
/*
|
||||
* OMG PSM class declaration
|
||||
*/
|
||||
#include <dds/topic/TAnyTopic.hpp>
|
||||
|
||||
// Implementation
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
template <typename DELEGATE>
|
||||
dds::topic::qos::TopicQos
|
||||
TAnyTopic<DELEGATE>::qos() const
|
||||
{
|
||||
return this->delegate()->qos();
|
||||
}
|
||||
|
||||
template <typename DELEGATE>
|
||||
void
|
||||
TAnyTopic<DELEGATE>::qos(const dds::topic::qos::TopicQos& qos)
|
||||
{
|
||||
this->delegate()->qos(qos);
|
||||
}
|
||||
|
||||
template <typename DELEGATE>
|
||||
TAnyTopic<DELEGATE>&
|
||||
TAnyTopic<DELEGATE>::operator << (const dds::topic::qos::TopicQos& qos)
|
||||
{
|
||||
this->delegate()->qos(qos);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename DELEGATE>
|
||||
const TAnyTopic<DELEGATE>&
|
||||
TAnyTopic<DELEGATE>::operator >> (dds::topic::qos::TopicQos& qos) const
|
||||
{
|
||||
qos = this->delegate()->qos();
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename DELEGATE>
|
||||
dds::core::status::InconsistentTopicStatus
|
||||
TAnyTopic<DELEGATE>::inconsistent_topic_status() const
|
||||
{
|
||||
return this->delegate()->inconsistent_topic_status();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_TANYTOPIC_IMPL_HPP_ */
|
||||
@@ -0,0 +1,580 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_TBUILTINTOPIC_IMPL_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_TBUILTINTOPIC_IMPL_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
/*
|
||||
* OMG PSM class declaration
|
||||
*/
|
||||
#include <dds/topic/TBuiltinTopic.hpp>
|
||||
|
||||
// Implementation
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
//TParticipantBuiltinTopicData
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TParticipantBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return this->delegate().key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::UserData& TParticipantBuiltinTopicData<D>::user_data() const
|
||||
{
|
||||
return this->delegate().user_data();
|
||||
}
|
||||
|
||||
//TTopicBuiltinTopicData
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TTopicBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return this->delegate().key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TTopicBuiltinTopicData<D>::name() const
|
||||
{
|
||||
return this->delegate().name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TTopicBuiltinTopicData<D>::type_name() const
|
||||
{
|
||||
return this->delegate().type_name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Durability& TTopicBuiltinTopicData<D>::durability() const
|
||||
{
|
||||
return this->delegate().durability();
|
||||
}
|
||||
|
||||
#ifdef OMG_DDS_PERSISTENCE_SUPPORT
|
||||
template <typename D>
|
||||
const ::dds::core::policy::DurabilityService& TTopicBuiltinTopicData<D>::durability_service() const
|
||||
{
|
||||
return this->delegate().durability_service();
|
||||
}
|
||||
|
||||
#endif // OMG_DDS_PERSISTENCE_SUPPORT
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Deadline& TTopicBuiltinTopicData<D>::deadline() const
|
||||
{
|
||||
return this->delegate().deadline();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::LatencyBudget& TTopicBuiltinTopicData<D>::latency_budget() const
|
||||
{
|
||||
return this->delegate().latency_budget();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Liveliness& TTopicBuiltinTopicData<D>::liveliness() const
|
||||
{
|
||||
return this->delegate().liveliness();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Reliability& TTopicBuiltinTopicData<D>::reliability() const
|
||||
{
|
||||
return this->delegate().reliability();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::TransportPriority& TTopicBuiltinTopicData<D>::transport_priority() const
|
||||
{
|
||||
return this->delegate().transport_priority();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Lifespan& TTopicBuiltinTopicData<D>::lifespan() const
|
||||
{
|
||||
return this->delegate().lifespan();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::DestinationOrder& TTopicBuiltinTopicData<D>::destination_order() const
|
||||
{
|
||||
return this->delegate().destination_order();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::History& TTopicBuiltinTopicData<D>::history() const
|
||||
{
|
||||
return this->delegate().history();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::ResourceLimits& TTopicBuiltinTopicData<D>::resource_limits() const
|
||||
{
|
||||
return this->delegate().resource_limits();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Ownership& TTopicBuiltinTopicData<D>::ownership() const
|
||||
{
|
||||
return this->delegate().ownership();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::TopicData& TTopicBuiltinTopicData<D>::topic_data() const
|
||||
{
|
||||
return this->delegate().topic_data();
|
||||
}
|
||||
|
||||
//TPublicationBuiltinTopicData
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TPublicationBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return this->delegate().key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TPublicationBuiltinTopicData<D>::participant_key() const
|
||||
{
|
||||
return this->delegate().key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TPublicationBuiltinTopicData<D>::topic_name() const
|
||||
{
|
||||
return this->delegate().topic_name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TPublicationBuiltinTopicData<D>::type_name() const
|
||||
{
|
||||
return this->delegate().type_name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Durability& TPublicationBuiltinTopicData<D>::durability() const
|
||||
{
|
||||
return this->delegate().durability();
|
||||
}
|
||||
|
||||
#ifdef OMG_DDS_PERSISTENCE_SUPPORT
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::DurabilityService& TPublicationBuiltinTopicData<D>::durability_service() const
|
||||
{
|
||||
return this->delegate().durability_service();
|
||||
}
|
||||
#endif // OMG_DDS_PERSISTENCE_SUPPORT
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Deadline& TPublicationBuiltinTopicData<D>::deadline() const
|
||||
{
|
||||
return this->delegate().deadline();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::LatencyBudget& TPublicationBuiltinTopicData<D>::latency_budget() const
|
||||
{
|
||||
return this->delegate().latency_budget();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Liveliness& TPublicationBuiltinTopicData<D>::liveliness() const
|
||||
{
|
||||
return this->delegate().liveliness();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Reliability& TPublicationBuiltinTopicData<D>::reliability() const
|
||||
{
|
||||
return this->delegate().reliability();
|
||||
}
|
||||
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Lifespan& TPublicationBuiltinTopicData<D>::lifespan() const
|
||||
{
|
||||
return this->delegate().lifespan();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::UserData& TPublicationBuiltinTopicData<D>::user_data() const
|
||||
{
|
||||
return this->delegate().user_data();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Ownership& TPublicationBuiltinTopicData<D>::ownership() const
|
||||
{
|
||||
return this->delegate().ownership();
|
||||
}
|
||||
|
||||
#ifdef OMG_DDS_OWNERSHIP_SUPPORT
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::OwnershipStrength& TPublicationBuiltinTopicData<D>::ownership_strength() const
|
||||
{
|
||||
return this->delegate().ownership_strength();
|
||||
}
|
||||
#endif // OMG_DDS_OWNERSHIP_SUPPORT
|
||||
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::DestinationOrder& TPublicationBuiltinTopicData<D>::destination_order() const
|
||||
{
|
||||
return this->delegate().destination_order();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Presentation& TPublicationBuiltinTopicData<D>::presentation() const
|
||||
{
|
||||
return this->delegate().presentation();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Partition& TPublicationBuiltinTopicData<D>::partition() const
|
||||
{
|
||||
return this->delegate().partition();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::TopicData& TPublicationBuiltinTopicData<D>::topic_data() const
|
||||
{
|
||||
return this->delegate().topic_data();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::GroupData& TPublicationBuiltinTopicData<D>::group_data() const
|
||||
{
|
||||
return this->delegate().group_data();
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TSubscriptionBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return this->delegate().key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TSubscriptionBuiltinTopicData<D>::participant_key() const
|
||||
{
|
||||
return this->delegate().key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TSubscriptionBuiltinTopicData<D>::topic_name() const
|
||||
{
|
||||
return this->delegate().topic_name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TSubscriptionBuiltinTopicData<D>::type_name() const
|
||||
{
|
||||
return this->delegate().type_name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Durability& TSubscriptionBuiltinTopicData<D>::durability() const
|
||||
{
|
||||
return this->delegate().durability();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Deadline& TSubscriptionBuiltinTopicData<D>::deadline() const
|
||||
{
|
||||
return this->delegate().deadline();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::LatencyBudget& TSubscriptionBuiltinTopicData<D>::latency_budget() const
|
||||
{
|
||||
return this->delegate().latency_budget();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Liveliness& TSubscriptionBuiltinTopicData<D>::liveliness() const
|
||||
{
|
||||
return this->delegate().liveliness();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Reliability& TSubscriptionBuiltinTopicData<D>::reliability() const
|
||||
{
|
||||
return this->delegate().reliability();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Ownership& TSubscriptionBuiltinTopicData<D>::ownership() const
|
||||
{
|
||||
return this->delegate().ownership();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::DestinationOrder& TSubscriptionBuiltinTopicData<D>::destination_order() const
|
||||
{
|
||||
return this->delegate().destination_order();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::UserData& TSubscriptionBuiltinTopicData<D>::user_data() const
|
||||
{
|
||||
return this->delegate().user_data();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::TimeBasedFilter& TSubscriptionBuiltinTopicData<D>::time_based_filter() const
|
||||
{
|
||||
return this->delegate().time_based_filter();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Presentation& TSubscriptionBuiltinTopicData<D>::presentation() const
|
||||
{
|
||||
return this->delegate().presentation();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Partition& TSubscriptionBuiltinTopicData<D>::partition() const
|
||||
{
|
||||
return this->delegate().partition();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::TopicData& TSubscriptionBuiltinTopicData<D>::topic_data() const
|
||||
{
|
||||
return this->delegate().topic_data();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::GroupData& TSubscriptionBuiltinTopicData<D>::group_data() const
|
||||
{
|
||||
return this->delegate().group_data();
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
//TCMParticipantBuiltinTopicData
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMParticipantBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return ((D)this->delegate()).key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMParticipantBuiltinTopicData<D>::product() const
|
||||
{
|
||||
return ((D)this->delegate()).product();
|
||||
}
|
||||
|
||||
//TCMPublisherBuiltinTopicData
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMPublisherBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return ((D)this->delegate()).key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMPublisherBuiltinTopicData<D>::product() const
|
||||
{
|
||||
return ((D)this->delegate()).product();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMPublisherBuiltinTopicData<D>::participant_key() const
|
||||
{
|
||||
return ((D)this->delegate()).participant_key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TCMPublisherBuiltinTopicData<D>::name() const
|
||||
{
|
||||
return ((D)this->delegate()).name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::EntityFactory& TCMPublisherBuiltinTopicData<D>::entity_factory() const
|
||||
{
|
||||
return ((D)this->delegate()).entity_factory();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Partition& TCMPublisherBuiltinTopicData<D>::partition() const
|
||||
{
|
||||
return ((D)this->delegate()).partition();
|
||||
}
|
||||
|
||||
//TCMSubscriberBuiltinTopicData
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMSubscriberBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return ((D)this->delegate()).key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMSubscriberBuiltinTopicData<D>::product() const
|
||||
{
|
||||
return ((D)this->delegate()).product();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMSubscriberBuiltinTopicData<D>::participant_key() const
|
||||
{
|
||||
return ((D)this->delegate()).participant_key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TCMSubscriberBuiltinTopicData<D>::name() const
|
||||
{
|
||||
return ((D)this->delegate()).name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::EntityFactory& TCMSubscriberBuiltinTopicData<D>::entity_factory() const
|
||||
{
|
||||
return ((D)this->delegate()).entity_factory();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::Partition& TCMSubscriberBuiltinTopicData<D>::partition() const
|
||||
{
|
||||
return ((D)this->delegate()).partition();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::Share& TCMSubscriberBuiltinTopicData<D>::share() const
|
||||
{
|
||||
return ((D)this->delegate()).share();
|
||||
}
|
||||
|
||||
//TCMDataWriterBuiltinTopicData
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMDataWriterBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return ((D)this->delegate()).key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMDataWriterBuiltinTopicData<D>::product() const
|
||||
{
|
||||
return ((D)this->delegate()).product();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMDataWriterBuiltinTopicData<D>::publisher_key() const
|
||||
{
|
||||
return ((D)this->delegate()).publisher_key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TCMDataWriterBuiltinTopicData<D>::name() const
|
||||
{
|
||||
return ((D)this->delegate()).name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::History& TCMDataWriterBuiltinTopicData<D>::history() const
|
||||
{
|
||||
return ((D)this->delegate()).history();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::ResourceLimits& TCMDataWriterBuiltinTopicData<D>::resource_limits() const
|
||||
{
|
||||
return ((D)this->delegate()).resource_limits();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::WriterDataLifecycle& TCMDataWriterBuiltinTopicData<D>::writer_data_lifecycle() const
|
||||
{
|
||||
return ((D)this->delegate()).writer_data_lifecycle();
|
||||
}
|
||||
|
||||
//TCMDataReaderBuiltinTopicData
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMDataReaderBuiltinTopicData<D>::key() const
|
||||
{
|
||||
return ((D)this->delegate()).key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::ProductData& TCMDataReaderBuiltinTopicData<D>::product() const
|
||||
{
|
||||
return ((D)this->delegate()).product();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const dds::topic::BuiltinTopicKey& TCMDataReaderBuiltinTopicData<D>::subscriber_key() const
|
||||
{
|
||||
return ((D)this->delegate()).subscriber_key();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const std::string& TCMDataReaderBuiltinTopicData<D>::name() const
|
||||
{
|
||||
return ((D)this->delegate()).name();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::History& TCMDataReaderBuiltinTopicData<D>::history() const
|
||||
{
|
||||
return ((D)this->delegate()).history();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::ResourceLimits& TCMDataReaderBuiltinTopicData<D>::resource_limits() const
|
||||
{
|
||||
return ((D)this->delegate()).resource_limits();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::dds::core::policy::ReaderDataLifecycle& TCMDataReaderBuiltinTopicData<D>::reader_data_lifecycle() const
|
||||
{
|
||||
return ((D)this->delegate()).reader_data_lifecycle();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::SubscriptionKey& TCMDataReaderBuiltinTopicData<D>::subscription_keys() const
|
||||
{
|
||||
return ((D)this->delegate()).subscription_keys();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::ReaderLifespan& TCMDataReaderBuiltinTopicData<D>::reader_lifespan() const
|
||||
{
|
||||
return ((D)this->delegate()).reader_lifespan();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
const ::org::eclipse::cyclonedds::core::policy::Share& TCMDataReaderBuiltinTopicData<D>::share() const
|
||||
{
|
||||
return ((D)this->delegate()).share();
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_TBUILTINTOPIC_IMPL_HPP_ */
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_TBUILTINTOPICKEY_IMPL_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_DETAIL_TBUILTINTOPICKEY_IMPL_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
/*
|
||||
* OMG PSM class declaration
|
||||
*/
|
||||
#include <dds/topic/TBuiltinTopicKey.hpp>
|
||||
|
||||
// Implementation
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
template <typename D>
|
||||
const int32_t* TBuiltinTopicKey<D>::value() const
|
||||
{
|
||||
return this->delegate().value();
|
||||
}
|
||||
|
||||
template <typename D>
|
||||
void TBuiltinTopicKey<D>::value(int32_t v[])
|
||||
{
|
||||
return this->delegate().value(v);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_TBUILTINTOPICKEY_IMPL_HPP_ */
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_TCONTENTFILTEREDTOPIC_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_TCONTENTFILTEREDTOPIC_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
/*
|
||||
* OMG PSM class declaration
|
||||
*/
|
||||
#include <dds/topic/TContentFilteredTopic.hpp>
|
||||
|
||||
// Implementation
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
ContentFilteredTopic<T, DELEGATE>::ContentFilteredTopic(const Topic<T>& topic,
|
||||
const std::string& name,
|
||||
const dds::topic::Filter& filter) :
|
||||
::dds::core::Reference< DELEGATE<T> >(
|
||||
new dds::topic::detail::ContentFilteredTopic<T>(topic, name, filter))
|
||||
{
|
||||
this->delegate()->init(::dds::core::Reference< DELEGATE<T> >::impl_);
|
||||
}
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
ContentFilteredTopic<T, DELEGATE>::~ContentFilteredTopic()
|
||||
{
|
||||
// Nothing to be done yet....
|
||||
}
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
const std::string& ContentFilteredTopic<T, DELEGATE>::filter_expression() const
|
||||
{
|
||||
return this->delegate()->filter_expression();
|
||||
}
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
const dds::core::StringSeq ContentFilteredTopic<T, DELEGATE>::filter_parameters() const
|
||||
{
|
||||
return this->delegate()->filter_parameters();
|
||||
}
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
template <typename FWDIterator>
|
||||
void ContentFilteredTopic<T, DELEGATE>::filter_parameters(const FWDIterator& begin, const FWDIterator& end)
|
||||
{
|
||||
this->delegate()->filter_parameters(begin, end);
|
||||
}
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
const dds::topic::Topic<T>& ContentFilteredTopic<T, DELEGATE>::topic() const
|
||||
{
|
||||
return this->delegate()->topic();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_TCONTENTFILTEREDTOPIC_HPP_ */
|
||||
105
unitree_SDK/include/ddscxx/dds/topic/detail/TFilterImpl.hpp
Normal file
105
unitree_SDK/include/ddscxx/dds/topic/detail/TFilterImpl.hpp
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_TFILTER_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_TFILTER_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
/*
|
||||
* OMG PSM class declaration
|
||||
*/
|
||||
#include <dds/topic/TFilter.hpp>
|
||||
|
||||
// Implementation
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
template<typename D>
|
||||
TFilter<D>::TFilter(const std::string& query_expression) :
|
||||
dds::core::Value<D>(query_expression)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
template<typename FWIterator>
|
||||
TFilter<D>::TFilter(const std::string& query_expression, const FWIterator& params_begin,
|
||||
const FWIterator& params_end)
|
||||
: dds::core::Value<D>(query_expression, params_begin, params_end)
|
||||
{ }
|
||||
|
||||
template<typename D>
|
||||
TFilter<D>::TFilter(const std::string& query_expression,
|
||||
const std::vector<std::string>& params) :
|
||||
dds::core::Value<D>(query_expression, params.begin(), params.end())
|
||||
{
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
const std::string& TFilter<D>::expression() const
|
||||
{
|
||||
return this->delegate().expression();
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
typename TFilter<D>::const_iterator TFilter<D>::begin() const
|
||||
{
|
||||
return this->delegate().begin();
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
typename TFilter<D>::const_iterator TFilter<D>::end() const
|
||||
{
|
||||
return this->delegate().end();
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
typename TFilter<D>::iterator TFilter<D>::begin()
|
||||
{
|
||||
return this->delegate().begin();
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
typename TFilter<D>::iterator TFilter<D>::end()
|
||||
{
|
||||
return this->delegate().end();
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
template<typename FWIterator>
|
||||
void TFilter<D>::parameters(const FWIterator& begin, const FWIterator end)
|
||||
{
|
||||
this->delegate().parameters(begin, end);
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
void TFilter<D>::add_parameter(const std::string& param)
|
||||
{
|
||||
this->delegate().add_parameter(param);
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
uint32_t TFilter<D>::parameters_length() const
|
||||
{
|
||||
return this->delegate().parameters_length();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_TFILTER_HPP_ */
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_TTOPICDESCRIPTION_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_TTOPICDESCRIPTION_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
/*
|
||||
* OMG PSM class declaration
|
||||
*/
|
||||
#include <dds/topic/TTopicDescription.hpp>
|
||||
|
||||
// Implementation
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
template <typename DELEGATE>
|
||||
const std::string& TTopicDescription<DELEGATE>::name() const
|
||||
{
|
||||
return this->delegate()->name();
|
||||
}
|
||||
|
||||
template <typename DELEGATE>
|
||||
const std::string& TTopicDescription<DELEGATE>::type_name() const
|
||||
{
|
||||
return this->delegate()->type_name();
|
||||
}
|
||||
|
||||
template <typename DELEGATE>
|
||||
const dds::domain::DomainParticipant& TTopicDescription<DELEGATE>::domain_participant() const
|
||||
{
|
||||
return this->delegate()->domain_participant();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_TTOPICDESCRIPTION_HPP_ */
|
||||
395
unitree_SDK/include/ddscxx/dds/topic/detail/TTopicImpl.hpp
Normal file
395
unitree_SDK/include/ddscxx/dds/topic/detail/TTopicImpl.hpp
Normal file
@@ -0,0 +1,395 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_TTOPIC_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_TTOPIC_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
/*
|
||||
* OMG PSM class declaration
|
||||
*/
|
||||
#include <dds/topic/TTopic.hpp>
|
||||
#include "org/eclipse/cyclonedds/topic/TopicTraits.hpp"
|
||||
#include "org/eclipse/cyclonedds/topic/TopicListener.hpp"
|
||||
|
||||
#include <dds/dds.h>
|
||||
#include <functional>
|
||||
|
||||
#define MAX_TOPIC_NAME_LEN 1024
|
||||
|
||||
// Implementation
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* dds/topic/Topic<> WRAPPER implementation.
|
||||
* Declaration can be found in dds/topic/TTopic.hpp
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
Topic<T, DELEGATE>::Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name) :
|
||||
::dds::core::Reference< DELEGATE<T> >(new DELEGATE<T>(
|
||||
dp,
|
||||
topic_name,
|
||||
"",
|
||||
dp.default_topic_qos(),
|
||||
NULL,
|
||||
dds::core::status::StatusMask::none()))
|
||||
{
|
||||
this->delegate()->init(this->impl_);
|
||||
}
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
Topic<T, DELEGATE>::Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const std::string& type_name) :
|
||||
::dds::core::Reference< DELEGATE<T> >(new DELEGATE<T>(
|
||||
dp,
|
||||
topic_name,
|
||||
type_name,
|
||||
dp.default_topic_qos(),
|
||||
NULL,
|
||||
dds::core::status::StatusMask::none())),
|
||||
::dds::topic::TAnyTopic< DELEGATE<T> >(::dds::core::Reference< DELEGATE<T> >::delegate())
|
||||
{
|
||||
throw dds::core::UnsupportedError(std::string("Only Topics with default type_names are supported"));
|
||||
/* this->delegate()->init(this->impl_); */
|
||||
}
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
Topic<T, DELEGATE>::Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds::topic::TopicListener<T>* listener,
|
||||
const dds::core::status::StatusMask& mask) :
|
||||
::dds::core::Reference< DELEGATE<T> >(new DELEGATE<T>(
|
||||
dp,
|
||||
topic_name,
|
||||
"",
|
||||
qos,
|
||||
listener,
|
||||
mask)),
|
||||
::dds::topic::TAnyTopic< DELEGATE<T> >(::dds::core::Reference< DELEGATE<T> >::delegate())
|
||||
{
|
||||
this->delegate()->init(this->impl_);
|
||||
}
|
||||
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
Topic<T, DELEGATE>::Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const std::string& type_name,
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds::topic::TopicListener<T>* listener,
|
||||
const dds::core::status::StatusMask& mask) :
|
||||
::dds::core::Reference< DELEGATE<T> >(new DELEGATE<T>(
|
||||
dp,
|
||||
topic_name,
|
||||
type_name,
|
||||
qos,
|
||||
listener,
|
||||
mask)),
|
||||
::dds::topic::TAnyTopic< DELEGATE<T> >(::dds::core::Reference< DELEGATE<T> >::delegate())
|
||||
{
|
||||
throw dds::core::UnsupportedError(std::string("Only Topics with default type_names are supported"));
|
||||
/* this->delegate()->init(this->impl_); */
|
||||
}
|
||||
|
||||
/** @internal @todo Relates to OMG_DDS_X_TYPE_DYNAMIC_TYPE_SUPPORT OSPL-1736 no implementation */
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
void Topic<T, DELEGATE>::listener(Listener* listener,
|
||||
const ::dds::core::status::StatusMask& event_mask)
|
||||
{
|
||||
this->delegate()->listener(listener, event_mask);
|
||||
}
|
||||
|
||||
/** @internal @todo Relates to OMG_DDS_X_TYPE_DYNAMIC_TYPE_SUPPORT OSPL-1736 no implementation */
|
||||
template <typename T, template <typename Q> class DELEGATE>
|
||||
typename Topic<T, DELEGATE>::Listener* Topic<T, DELEGATE>::listener() const
|
||||
{
|
||||
return this->delegate()->listener();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* dds/topic/detail/Topic<> DELEGATE implementation.
|
||||
* Declaration can be found in dds/topic/detail/Topic.hpp
|
||||
*
|
||||
* Implementation and declaration have been separated because some circular
|
||||
* dependencies, like with TopicListener and AnyTopic.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <dds/topic/detail/Topic.hpp>
|
||||
#include <dds/topic/AnyTopic.hpp>
|
||||
#include <dds/topic/TopicListener.hpp>
|
||||
//#include <dds/domain/DomainParticipantListener.hpp>
|
||||
#include <org/eclipse/cyclonedds/core/ScopedLock.hpp>
|
||||
#include <org/eclipse/cyclonedds/core/ListenerDispatcher.hpp>
|
||||
|
||||
#include "dds/ddsi/ddsi_sertype.h"
|
||||
|
||||
template <typename T>
|
||||
dds::topic::detail::Topic<T>::Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const std::string& type_name,
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds::topic::TopicListener<T>* listener,
|
||||
const dds::core::status::StatusMask& mask)
|
||||
: org::eclipse::cyclonedds::topic::TopicDescriptionDelegate(dp, name, type_name),
|
||||
org::eclipse::cyclonedds::topic::AnyTopicDelegate(qos, dp, name, type_name)
|
||||
{
|
||||
// Set the correct (IDL) type_name in the TopicDescription.
|
||||
org::eclipse::cyclonedds::topic::TopicDescriptionDelegate::myTypeName = org::eclipse::cyclonedds::topic::TopicTraits<T>::getTypeName();
|
||||
|
||||
// get and validate the ddsc qos
|
||||
org::eclipse::cyclonedds::topic::qos::TopicQosDelegate tQos = qos.delegate();
|
||||
tQos.check();
|
||||
dds_qos_t* ddsc_qos = tQos.ddsc_qos();
|
||||
dds_entity_t ddsc_par = dp.delegate()->get_ddsc_entity();
|
||||
|
||||
ser_type_ = org::eclipse::cyclonedds::topic::TopicTraits<T>::getSerType();
|
||||
|
||||
dds_entity_t ddsc_topic = dds_create_topic_sertype(
|
||||
ddsc_par, name.c_str(), &ser_type_, ddsc_qos, NULL, NULL);
|
||||
|
||||
dds_delete_qos(ddsc_qos);
|
||||
|
||||
if (ddsc_topic < 0) {
|
||||
ddsi_sertype_unref(ser_type_);
|
||||
ISOCPP_DDSC_RESULT_CHECK_AND_THROW(ddsc_topic, "Could not create topic.");
|
||||
}
|
||||
|
||||
this->set_ddsc_entity(ddsc_topic);
|
||||
|
||||
this->listener(listener, mask);
|
||||
|
||||
this->AnyTopicDelegate::set_sample(&this->sample_);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
dds::topic::detail::Topic<T>::Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const std::string& type_name,
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds_entity_t ddsc_topic)
|
||||
: org::eclipse::cyclonedds::topic::TopicDescriptionDelegate(dp, name, type_name),
|
||||
org::eclipse::cyclonedds::topic::AnyTopicDelegate(qos, dp, name, type_name)
|
||||
{
|
||||
this->set_ddsc_entity(ddsc_topic);
|
||||
this->listener(NULL, dds::core::status::StatusMask::none());
|
||||
|
||||
this->AnyTopicDelegate::set_sample(&this->sample_);
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
dds::topic::detail::Topic<T>::~Topic<T>()
|
||||
{
|
||||
if (!closed) {
|
||||
try {
|
||||
close();
|
||||
} catch (...) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
dds::topic::detail::Topic<T>::close()
|
||||
{
|
||||
org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
|
||||
|
||||
if (this->hasDependents()) {
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_PRECONDITION_NOT_MET_ERROR, "Topic still has unclosed dependencies (e.g. Readers/Writers/ContentFilteredTopics)");
|
||||
}
|
||||
|
||||
this->listener_set(NULL, dds::core::status::StatusMask::none());
|
||||
|
||||
this->myParticipant.delegate()->remove_topic(*this);
|
||||
|
||||
org::eclipse::cyclonedds::core::EntityDelegate::close();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
dds::topic::detail::Topic<T>::init(ObjectDelegate::weak_ref_type weak_ref)
|
||||
{
|
||||
/* Set weak_ref before passing ourselves to other isocpp objects. */
|
||||
this->set_weak_ref(weak_ref);
|
||||
/* Add weak_ref to the map of entities */
|
||||
this->add_to_entity_map(weak_ref);
|
||||
/* Register topic at participant. */
|
||||
this->myParticipant.delegate()->add_topic(*this);
|
||||
|
||||
/* Enable when needed. */
|
||||
if (this->myParticipant.delegate()->is_auto_enable()) {
|
||||
this->enable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
dds::topic::detail::Topic<T>::listener(TopicListener<T>* listener,
|
||||
const ::dds::core::status::StatusMask& mask)
|
||||
{
|
||||
org::eclipse::cyclonedds::core::ScopedObjectLock scopedLock(*this);
|
||||
this->listener_set(listener, mask);
|
||||
scopedLock.unlock();
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
dds::topic::TopicListener<T>*
|
||||
dds::topic::detail::Topic<T>::listener()
|
||||
{
|
||||
this->check();
|
||||
return reinterpret_cast<dds::topic::TopicListener<T>*>(this->listener_get());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
dds::topic::Topic<T, dds::topic::detail::Topic>
|
||||
dds::topic::detail::Topic<T>::wrapper()
|
||||
{
|
||||
|
||||
typename Topic::ref_type ref =
|
||||
::std::dynamic_pointer_cast<Topic<T> >(this->get_strong_ref());
|
||||
dds::topic::Topic<T, dds::topic::detail::Topic> topic(ref);
|
||||
|
||||
return topic;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
dds::topic::detail::Topic<T>::listener_notify(
|
||||
ObjectDelegate::ref_type source,
|
||||
uint32_t triggerMask,
|
||||
void *eventData,
|
||||
void *l)
|
||||
{
|
||||
(void)source;
|
||||
(void)triggerMask;
|
||||
(void)eventData;
|
||||
(void)l;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
dds::topic::Topic<T, dds::topic::detail::Topic>
|
||||
dds::topic::detail::Topic<T>::discover_topic(
|
||||
const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const dds::core::Duration& timeout)
|
||||
{
|
||||
dds::topic::Topic<T> found = dds::core::null;
|
||||
std::unique_ptr<dds_typeinfo_t, std::function<void(dds_typeinfo_t *)> >
|
||||
type_info(org::eclipse::cyclonedds::topic::TopicTraits<T>::getTypeInfo(nullptr),
|
||||
[](dds_typeinfo_t *ti) { static_cast<void>(dds_free_typeinfo(ti)); });
|
||||
dds_entity_t ddsc_topic = dp.delegate()->lookup_topic(name, type_info.get(), timeout);
|
||||
|
||||
if (ddsc_topic <= 0) {
|
||||
return dds::core::null;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Add type_name here when non-default ones are supported. */
|
||||
size_t slen = MAX_TOPIC_NAME_LEN;
|
||||
char *ddsc_type_name;
|
||||
ddsc_type_name = (char *)dds_alloc(slen);
|
||||
dds_get_type_name(ddsc_topic, ddsc_type_name, slen);
|
||||
std::string type_name = ddsc_type_name;
|
||||
dds_free(ddsc_type_name);
|
||||
#endif
|
||||
|
||||
dds_return_t ret;
|
||||
dds_qos_t* ddsc_qos = dds_create_qos();
|
||||
ret = dds_get_qos(ddsc_topic, ddsc_qos);
|
||||
dds::topic::qos::TopicQos qos;
|
||||
if (ret == DDS_RETCODE_OK) {
|
||||
qos.delegate().ddsc_qos(ddsc_qos);
|
||||
}
|
||||
dds_delete_qos(ddsc_qos);
|
||||
ISOCPP_DDSC_RESULT_CHECK_AND_THROW(ret, "Failed to get the qos from discovered topic");
|
||||
|
||||
/*
|
||||
* The found topic could be of the wrong type. This will be indicated
|
||||
* with a PreconditionNotMetError when we try to create it.
|
||||
*/
|
||||
try {
|
||||
found = dds::topic::Topic<T>(dp, name, qos);
|
||||
} catch (dds::core::PreconditionNotMetError&) {
|
||||
/* Ignore; just return dds::core::null */
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
dds::topic::detail::Topic<T>::discover_topics(
|
||||
const dds::domain::DomainParticipant& dp,
|
||||
std::vector<dds::topic::Topic<T, dds::topic::detail::Topic> >& topics,
|
||||
uint32_t max_size)
|
||||
{
|
||||
(void)dp;
|
||||
(void)topics;
|
||||
std::vector<dds_entity_t> ddsc_topics;
|
||||
topics.clear();
|
||||
/*
|
||||
* Unfortunately, DomainParticipantDelegate::lookup_topics() is not
|
||||
* supported yet and will throw an exception.
|
||||
*/
|
||||
dp.delegate()->lookup_topics(topic_type_name<T>::value(), ddsc_topics, max_size);
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
void dds::topic::detail::Topic<T>::on_inconsistent_topic(
|
||||
dds_entity_t topic,
|
||||
org::eclipse::cyclonedds::core::InconsistentTopicStatusDelegate &sd )
|
||||
{
|
||||
dds::core::status::InconsistentTopicStatus s ;
|
||||
s.delegate() = sd ;
|
||||
(void)topic;
|
||||
dds::topic::Topic<T, dds::topic::detail::Topic> t = wrapper() ;
|
||||
|
||||
dds::topic::TopicListener<T> *l =
|
||||
reinterpret_cast<dds::topic::TopicListener<T> *>(this->listener_get());
|
||||
if( (l != NULL) &&
|
||||
(this->get_listener_mask().to_ulong() &
|
||||
dds::core::status::StatusMask::inconsistent_topic().to_ulong()) )
|
||||
{
|
||||
l->on_inconsistent_topic( t, s ) ;
|
||||
}
|
||||
}
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_TTOPIC_HPP_ */
|
||||
131
unitree_SDK/include/ddscxx/dds/topic/detail/Topic.hpp
Normal file
131
unitree_SDK/include/ddscxx/dds/topic/detail/Topic.hpp
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
// Implementation
|
||||
|
||||
#include <dds/core/ref_traits.hpp>
|
||||
#include <dds/topic/TopicTraits.hpp>
|
||||
#include <dds/core/status/Status.hpp>
|
||||
#include <dds/core/status/State.hpp>
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
#include <dds/topic/qos/TopicQos.hpp>
|
||||
#include <dds/topic/AnyTopic.hpp>
|
||||
|
||||
#include <org/eclipse/cyclonedds/core/config.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/TopicTraits.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/AnyTopicDelegate.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/TopicDescriptionDelegate.hpp>
|
||||
|
||||
#include <dds/dds.h>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
template <typename T>
|
||||
class TopicListener;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
class Topic;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* dds/topic/detail/Topic<> DELEGATE declaration.
|
||||
* Implementation can be found in dds/topic/detail/TTopicImpl.hpp
|
||||
*
|
||||
***************************************************************************/
|
||||
template <typename T>
|
||||
class dds::topic::detail::Topic : public org::eclipse::cyclonedds::topic::AnyTopicDelegate
|
||||
{
|
||||
public:
|
||||
typedef typename ::dds::core::smart_ptr_traits< Topic<T> >::ref_type ref_type;
|
||||
typedef typename ::dds::core::smart_ptr_traits< Topic<T> >::weak_ref_type weak_ref_type;
|
||||
|
||||
Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const std::string& type_name,
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds::topic::TopicListener<T>* listener,
|
||||
const dds::core::status::StatusMask& mask);
|
||||
|
||||
Topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const std::string& type_name,
|
||||
const dds::topic::qos::TopicQos& qos,
|
||||
dds_entity_t ddsc_topic);
|
||||
|
||||
virtual ~Topic();
|
||||
|
||||
virtual void close();
|
||||
|
||||
void init(ObjectDelegate::weak_ref_type weak_ref);
|
||||
|
||||
dds::topic::Topic<T, dds::topic::detail::Topic> wrapper();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
void listener(dds::topic::TopicListener<T>* listener,
|
||||
const ::dds::core::status::StatusMask& mask);
|
||||
|
||||
dds::topic::TopicListener<T>* listener();
|
||||
|
||||
virtual void listener_notify(ObjectDelegate::ref_type source,
|
||||
uint32_t triggerMask,
|
||||
void *eventData,
|
||||
void *listener);
|
||||
|
||||
dds::topic::TTopicDescription<TopicDescriptionDelegate> clone();
|
||||
|
||||
static dds::topic::Topic<T, dds::topic::detail::Topic>
|
||||
discover_topic(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const dds::core::Duration& timeout);
|
||||
|
||||
static void
|
||||
discover_topics(const dds::domain::DomainParticipant& dp,
|
||||
std::vector<dds::topic::Topic<T, dds::topic::detail::Topic> >& topics,
|
||||
uint32_t max_size);
|
||||
|
||||
//using ::org::eclipse::cyclonedds::topic::AnyTopicDelegate<T>::on_inconsistent_topic;
|
||||
|
||||
void on_inconsistent_topic(
|
||||
dds_entity_t topic,
|
||||
org::eclipse::cyclonedds::core::InconsistentTopicStatusDelegate &s ) ; // !!!
|
||||
|
||||
private:
|
||||
T sample_;
|
||||
};
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_ */
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_TOPICDESCRIPTION_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_DETAIL_TOPICDESCRIPTION_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
// Implementation
|
||||
|
||||
#include <dds/topic/detail/TTopicDescriptionImpl.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/TopicDescriptionDelegate.hpp>
|
||||
|
||||
namespace dds { namespace topic { namespace detail {
|
||||
typedef dds::topic::TTopicDescription<org::eclipse::cyclonedds::topic::TopicDescriptionDelegate> TopicDescription;
|
||||
} } }
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_TOPICDESCRIPTION_HPP_ */
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_TOPICINSTANCE_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_TOPICINSTANCE_HPP_
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
/*
|
||||
* OMG PSM class declaration
|
||||
*/
|
||||
#include <dds/topic/TopicInstance.hpp>
|
||||
|
||||
// Implementation
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
template <typename T>
|
||||
TopicInstance<T>::TopicInstance() : h_(dds::core::null) {}
|
||||
|
||||
template <typename T>
|
||||
TopicInstance<T>::TopicInstance(const ::dds::core::InstanceHandle& h)
|
||||
: h_(h), sample_() {}
|
||||
|
||||
template <typename T>
|
||||
TopicInstance<T>::TopicInstance(const ::dds::core::InstanceHandle& h, const T& sample)
|
||||
: h_(h), sample_(sample) { }
|
||||
|
||||
template <typename T>
|
||||
TopicInstance<T>::operator const ::dds::core::InstanceHandle() const
|
||||
{
|
||||
return h_;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
const ::dds::core::InstanceHandle TopicInstance<T>::handle() const
|
||||
{
|
||||
return h_;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TopicInstance<T>::handle(const ::dds::core::InstanceHandle& h)
|
||||
{
|
||||
h_ = h;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
const T& TopicInstance<T>::sample() const
|
||||
{
|
||||
return sample_;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T& TopicInstance<T>::sample()
|
||||
{
|
||||
return sample_;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TopicInstance<T>::sample(const T& sample)
|
||||
{
|
||||
sample_ = sample;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// End of implementation
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_TOPICINSTANCE_HPP_ */
|
||||
20
unitree_SDK/include/ddscxx/dds/topic/detail/ddstopic.hpp
Normal file
20
unitree_SDK/include/ddscxx/dds/topic/detail/ddstopic.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef OMG_DDS_TOPIC_PACKAGE_DETAIL_INCLUDE_HPP_
|
||||
#define OMG_DDS_TOPIC_PACKAGE_DETAIL_INCLUDE_HPP_
|
||||
|
||||
#include "dds/topic/detail/TTopicDescriptionImpl.hpp"
|
||||
#include "dds/topic/detail/TTopicImpl.hpp"
|
||||
#include "dds/topic/detail/TopicInstanceImpl.hpp"
|
||||
#include "dds/topic/detail/TContentFilteredTopicImpl.hpp"
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_PACKAGE_DETAIL_INCLUDE_HPP_ */
|
||||
100
unitree_SDK/include/ddscxx/dds/topic/detail/discovery.hpp
Normal file
100
unitree_SDK/include/ddscxx/dds/topic/detail/discovery.hpp
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_DISCOVER_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_DETAIL_DISCOVER_HPP_
|
||||
|
||||
#include <dds/topic/AnyTopic.hpp>
|
||||
#include <dds/topic/Topic.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/discovery.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
template <typename TOPIC>
|
||||
TOPIC
|
||||
discover(
|
||||
const dds::domain::DomainParticipant& dp,
|
||||
const std::string& topic_name,
|
||||
const dds::core::Duration& timeout)
|
||||
{
|
||||
TOPIC t = org::eclipse::cyclonedds::topic::lookup_topic<TOPIC, typename TOPIC::DELEGATE_T>::discover(dp, topic_name, timeout);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
template <typename ANYTOPIC, typename FwdIterator>
|
||||
uint32_t
|
||||
discover(
|
||||
const dds::domain::DomainParticipant& dp,
|
||||
FwdIterator begin,
|
||||
uint32_t max_size)
|
||||
{
|
||||
std::vector<ANYTOPIC> list;
|
||||
|
||||
org::eclipse::cyclonedds::topic::lookup_topic<ANYTOPIC, typename ANYTOPIC::DELEGATE_T>::discover(dp, list, max_size);
|
||||
|
||||
FwdIterator fit = begin;
|
||||
for (typename std::vector<ANYTOPIC>::const_iterator it = list.begin(); it != list.end(); ++it) {
|
||||
*fit++ = *it;
|
||||
}
|
||||
|
||||
return static_cast<uint32_t>(list.size());
|
||||
}
|
||||
|
||||
template <typename ANYTOPIC, typename BinIterator>
|
||||
uint32_t
|
||||
discover_all(
|
||||
const dds::domain::DomainParticipant& dp,
|
||||
BinIterator begin)
|
||||
{
|
||||
std::vector<ANYTOPIC> list;
|
||||
|
||||
org::eclipse::cyclonedds::topic::lookup_topic<ANYTOPIC, typename ANYTOPIC::DELEGATE_T>::discover(dp, list, static_cast<uint32_t>(dds::core::LENGTH_UNLIMITED));
|
||||
|
||||
BinIterator bit = begin;
|
||||
for (typename std::vector<ANYTOPIC>::const_iterator it = list.begin(); it != list.end(); ++it) {
|
||||
*bit++ = *it;
|
||||
}
|
||||
|
||||
return list.size();
|
||||
}
|
||||
|
||||
|
||||
template <typename FwdIterator>
|
||||
void
|
||||
ignore(
|
||||
const dds::domain::DomainParticipant& dp,
|
||||
FwdIterator begin, FwdIterator end)
|
||||
{
|
||||
(void)dp;
|
||||
(void)begin;
|
||||
(void)end;
|
||||
ISOCPP_THROW_EXCEPTION(ISOCPP_UNSUPPORTED_ERROR, "Function not currently supported");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_DISCOVER_HPP_ */
|
||||
46
unitree_SDK/include/ddscxx/dds/topic/detail/find.hpp
Normal file
46
unitree_SDK/include/ddscxx/dds/topic/detail/find.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_FIND_HPP_
|
||||
#define CYCLONEDDS_DDS_TOPIC_DETAIL_FIND_HPP_
|
||||
|
||||
|
||||
#include <org/eclipse/cyclonedds/topic/find.hpp>
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
template <typename TOPIC>
|
||||
TOPIC
|
||||
find(const dds::domain::DomainParticipant& dp, const std::string& topic_name)
|
||||
{
|
||||
TOPIC t = org::eclipse::cyclonedds::topic::finder<TOPIC, typename TOPIC::DELEGATE_T>::find(dp, topic_name);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_FIND_HPP_ */
|
||||
153
unitree_SDK/include/ddscxx/dds/topic/discovery.hpp
Normal file
153
unitree_SDK/include/ddscxx/dds/topic/discovery.hpp
Normal file
@@ -0,0 +1,153 @@
|
||||
#ifndef OMG_DDS_TOPIC_DISCOVER_HPP_
|
||||
#define OMG_DDS_TOPIC_DISCOVER_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
/**
|
||||
* This operation gives access to an specific existing (or ready to exist) enabled
|
||||
* Topic, ContentFilteredTopic, MultiTopic, AnyTopic or TopicDescription based
|
||||
* on its topic_name.
|
||||
*
|
||||
* Topics that the application has indicated should be 'ignored' (by means of the
|
||||
* dds::topic::ignore operation) will not appear in this list (note: the ignore
|
||||
* feature is not yet supported).
|
||||
*
|
||||
* If a Topic of the same topic_name already exists, it gives access to this Topic.
|
||||
* Otherwise it waits (blocks the caller) until another mechanism creates it. This other
|
||||
* mechanism can be another thread, a configuration tool, or some other Data
|
||||
* Distribution Service utility. If after the specified timeout the Topic can still not be
|
||||
* found, the caller gets unblocked and the returned Topic will be dds::core::null.
|
||||
*
|
||||
* A Topic that is obtained by means of find_topic in a specific
|
||||
* DomainParticipant can only be used to create DataReaders and
|
||||
* DataWriters in that DomainParticipant.
|
||||
*
|
||||
* This operation usually results in network look-ups.
|
||||
*
|
||||
* For finding only locally created Topics, look
|
||||
* @link find(const dds::domain::DomainParticipant& dp, const std::string& topic_name)
|
||||
* here.@endlink
|
||||
*
|
||||
* @param dp the DomainParticipant
|
||||
* @param name the topic name to discover
|
||||
* @param timeout the time out
|
||||
* @throws dds::core::Error
|
||||
* An internal error has occurred.
|
||||
* @throws dds::core::NullReferenceError
|
||||
* The DomainParticipant was not properly created and references to dds::core::null.
|
||||
* @throws dds::core::AlreadyClosedError
|
||||
* The DomainParticipant has already been closed.
|
||||
* @throws dds::core::NotEnabledError
|
||||
* The DomainParticipant has not yet been enabled.
|
||||
* @throws dds::core::OutOfResourcesError
|
||||
* The Data Distribution Service ran out of resources to
|
||||
* complete this operation.
|
||||
* @throws dds::core::TimeoutError
|
||||
* No Topics of the given name found within the timeout.
|
||||
*/
|
||||
template <typename TOPIC>
|
||||
TOPIC discover(const dds::domain::DomainParticipant& dp,
|
||||
const std::string& name,
|
||||
const dds::core::Duration& timeout = dds::core::Duration::infinite());
|
||||
|
||||
/**
|
||||
* This operation retrieves a list of Topics that have been discovered in the domain.
|
||||
*
|
||||
* If the max_size of the given list is large enough, all discovered Topics will be
|
||||
* present in that list. Otherwise, a random sub-set of max_size elements is returned.
|
||||
*
|
||||
* Topics that the application has indicated should be 'ignored' (by means of the
|
||||
* dds::topic::ignore operation) will not appear in this list (note: the ignore
|
||||
* feature is not yet supported).
|
||||
*
|
||||
* Because Topics of various different kinds can be retrieved, the list contains
|
||||
* AnyTopics.
|
||||
*
|
||||
* This operation usually results in network look-ups.
|
||||
*
|
||||
* @param dp the DomainParticipant
|
||||
* @param begin a forward iterator pointing to the beginning of a container
|
||||
* in which to insert the topics
|
||||
* @param max_size the maximum number of topics to return
|
||||
*/
|
||||
template <typename ANYTOPIC, typename FwdIterator>
|
||||
uint32_t discover(const dds::domain::DomainParticipant& dp, FwdIterator begin, uint32_t max_size);
|
||||
|
||||
/**
|
||||
* This operation retrieves a list of all Topics that have been discovered in the domain.
|
||||
*
|
||||
* Topics that the application has indicated should be 'ignored' (by means of the
|
||||
* dds::topic::ignore operation) will not appear in this list (note: the ignore
|
||||
* feature is not yet supported).
|
||||
*
|
||||
* Because Topics of various different kinds can be retrieved, the list contains
|
||||
* AnyTopics.
|
||||
*
|
||||
* This operation usually results in network look-ups.
|
||||
*
|
||||
* @param dp the DomainParticipant
|
||||
* @param begin a back inserting iterator pointing to the beginning of a container
|
||||
* in which to insert the topics
|
||||
*/
|
||||
template <typename ANYTOPIC, typename BinIterator>
|
||||
uint32_t discover_all(const dds::domain::DomainParticipant& dp, BinIterator begin);
|
||||
|
||||
/**
|
||||
* This operation allows an application to instruct the Service to locally ignore
|
||||
* a remote domain participant. From that point onwards the Service will locally
|
||||
* behave as if the remote participant did not exist. This means it will ignore any
|
||||
* Topic, publication, or subscription that originates on that domain participant.
|
||||
*
|
||||
* <b><i>This operation is not yet implemented. It is scheduled for a future release.</i></b>
|
||||
*
|
||||
* @param dp the DomainParticipant
|
||||
* @param handle the handle of the DomainParticipant to ignore
|
||||
*/
|
||||
void OMG_DDS_API ignore(const dds::domain::DomainParticipant& dp, const dds::core::InstanceHandle& handle);
|
||||
|
||||
/**
|
||||
* This operation allows an application to instruct the Service to locally ignore
|
||||
* a remote domain participant. From that point onwards the Service will locally
|
||||
* behave as if the remote participant did not exist. This means it will ignore any
|
||||
* Topic, publication, or subscription that originates on that domain participant.
|
||||
*
|
||||
* <b><i>This operation is not yet implemented. It is scheduled for a future release.</i></b>
|
||||
*
|
||||
* @param dp the DomainParticipant
|
||||
* @param begin a forward iterator pointing to the beginning of a sequence of
|
||||
* InstanceHandles to ignore
|
||||
* @param end a forward iterator pointing to the end of a sequence of
|
||||
* InstanceHandles to ignore
|
||||
*/
|
||||
template <typename FwdIterator>
|
||||
void ignore(const dds::domain::DomainParticipant& dp, FwdIterator begin, FwdIterator end);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <dds/topic/detail/discovery.hpp>
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_DISCOVER_HPP_ */
|
||||
53
unitree_SDK/include/ddscxx/dds/topic/find.hpp
Normal file
53
unitree_SDK/include/ddscxx/dds/topic/find.hpp
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef OMG_DDS_TOPIC_FIND_HPP_
|
||||
#define OMG_DDS_TOPIC_FIND_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Inc.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <dds/topic/detail/find.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
|
||||
/**
|
||||
* This operation gives access to a locally-created Topic, ContentFilteredTopic,
|
||||
* MultiTopic, AnyTopic and TopicDescription with a matching name.
|
||||
*
|
||||
* dds::topic::find will never create a Topic but returns a reference to an
|
||||
* Topic proxy that already exists locally. When no local proxy exists, the
|
||||
* returned Topic will be a dds::core::null object. The operation never blocks.
|
||||
*
|
||||
* For discovering globally available Topics, look
|
||||
* @link dds::topic::discover(const dds::domain::DomainParticipant&, const std::string&, const dds::core::Duration&)
|
||||
* here.@endlink
|
||||
*
|
||||
* @param dp the DomainParticipant to find the topic on
|
||||
* @param topic_name the topic name to find
|
||||
*/
|
||||
template <typename TOPIC>
|
||||
TOPIC
|
||||
find(const dds::domain::DomainParticipant& dp, const std::string& topic_name);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_FIND_HPP_ */
|
||||
36
unitree_SDK/include/ddscxx/dds/topic/qos/TopicQos.hpp
Normal file
36
unitree_SDK/include/ddscxx/dds/topic/qos/TopicQos.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_
|
||||
#define OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/topic/qos/detail/TopicQos.hpp>
|
||||
|
||||
namespace dds
|
||||
{
|
||||
namespace topic
|
||||
{
|
||||
namespace qos
|
||||
{
|
||||
typedef dds::topic::qos::detail::TopicQos TopicQos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_ */
|
||||
93
unitree_SDK/include/ddscxx/dds/topic/qos/detail/TopicQos.hpp
Normal file
93
unitree_SDK/include/ddscxx/dds/topic/qos/detail/TopicQos.hpp
Normal file
@@ -0,0 +1,93 @@
|
||||
#ifndef OMG_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_
|
||||
#define OMG_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_
|
||||
|
||||
/* Copyright 2010, Object Management Group, Inc.
|
||||
* Copyright 2010, PrismTech, Corp.
|
||||
* Copyright 2010, Real-Time Innovations, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dds/core/detail/TEntityQosImpl.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/qos/TopicQosDelegate.hpp>
|
||||
|
||||
#ifdef DOXYGEN_FOR_ISOCPP
|
||||
/* The above macro is never (and must never) be defined in normal compilation.
|
||||
*
|
||||
* The class below is just used to create informative API documentation.
|
||||
* The predoxygen.py script will copy this over the QoS API header file.
|
||||
*/
|
||||
/**
|
||||
* @brief
|
||||
* This struct provides the basic mechanism for an application to specify Quality of
|
||||
* Service attributes for a Topic.
|
||||
*
|
||||
* @par Attributes
|
||||
* @anchor anchor_dds_topic_qos_defaults
|
||||
* QosPolicy | Desciption | Default Value
|
||||
* ------------------------------------ | -------------------------------------------------------------------------- | --------------------
|
||||
* dds::core::policy::TopicData | Additional information (@ref DCPS_QoS_TopicData "info") | TopicData::TopicData(empty)
|
||||
* dds::core::policy::Durability | Data storage settings for late joiners (@ref DCPS_QoS_Durability "info") | Durability::Volatile()
|
||||
* dds::core::policy::DurabilityService | Transient/persistent behaviour (@ref DCPS_QoS_DurabilityService "info") | DurabilityService::DurabilityService()
|
||||
* dds::core::policy::Deadline | Period in which new sample is written (@ref DCPS_QoS_Deadline "info") | Deadline::Deadline(infinite)
|
||||
* dds::core::policy::LatencyBudget | Used for optimization (@ref DCPS_QoS_LatencyBudget "info") | LatencyBudget::LatencyBudget(zero)
|
||||
* dds::core::policy::Liveliness | Liveliness assertion mechanism (@ref DCPS_QoS_Liveliness "info") | Liveliness::Automatic()
|
||||
* dds::core::policy::Reliability | Reliability settings (@ref DCPS_QoS_Reliability "info") | Reliability::Reliable()
|
||||
* dds::core::policy::DestinationOrder | DataReader data order settings (@ref DCPS_QoS_DestinationOrder "info") | DestinationOrder::ReceptionTimestamp()
|
||||
* dds::core::policy::History | Data storage settings (@ref DCPS_QoS_History "info") | History::KeepLast(depth 1)
|
||||
* dds::core::policy::ResourceLimits | Maximum resource settings (@ref DCPS_QoS_ResourceLimits "info") | ResourceLimits::ResourceLimits(all unlimited)
|
||||
* dds::core::policy::TransportPriority | Priority hint for transport layer (@ref DCPS_QoS_TransportPriority "info") | TransportPriority::TTransportPriority(0)
|
||||
* dds::core::policy::Lifespan | Maximum duration of validity of data (@ref DCPS_QoS_Lifespan "info") | Lifespan::Lifespan(infinite)
|
||||
* dds::core::policy::Ownership | Exclusive ownership or not (@ref DCPS_QoS_Ownership "info") | Ownership::Shared()
|
||||
* dds::core::policy::DataRepresentation | Supported data representation kinds (@ref DCPS_QoS_DataRepresentation "info") | DataRepresentation::DataRepresentation(dds::core::policy::DataRepresentationId::XCDR1)
|
||||
* dds::core::policy::TypeConsistencyEnforcement | Type consistency enforcement policies (@ref DCPS_QoS_TypeConsistencyEnforcement "info") | dds::core::policy::TypeConsistencyKind::DISALLOW_TYPE_COERCION
|
||||
*
|
||||
* A QosPolicy can be set when the Topic is created or modified with the set
|
||||
* qos operation.
|
||||
* Both operations take the TopicQos object as a parameter. There may be cases
|
||||
* where several policies are in conflict. Consistency checking is performed each time
|
||||
* the policies are modified when they are being created and, in case they are already
|
||||
* enabled, via the set qos operation.
|
||||
*
|
||||
* Some QosPolicy have "immutable" semantics meaning that they can only be
|
||||
* specified either at Topic creation time or prior to calling the enable
|
||||
* operation on the Topic.
|
||||
*
|
||||
* @see for more information: @ref DCPS_QoS
|
||||
*/
|
||||
class dds::topic::qos::TopicQos : public ::dds::core::EntityQos<org::eclipse::cyclonedds::topic::qos::TopicQosDelegate>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Create @ref anchor_dds_topic_qos_defaults "default" QoS.
|
||||
*/
|
||||
TopicQos() {}
|
||||
|
||||
/**
|
||||
* Create copied QoS type.
|
||||
*
|
||||
* @param qos the QoS to copy policies from.
|
||||
*/
|
||||
TopicQos(const TopicQos& qos);
|
||||
};
|
||||
|
||||
#else /* DOXYGEN_FOR_ISOCPP */
|
||||
|
||||
namespace dds { namespace topic { namespace qos { namespace detail {
|
||||
typedef ::dds::core::TEntityQos< ::org::eclipse::cyclonedds::topic::qos::TopicQosDelegate > TopicQos;
|
||||
} } } }
|
||||
|
||||
#endif /* DOXYGEN_FOR_ISOCPP */
|
||||
|
||||
#endif /* OMG_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_ */
|
||||
Reference in New Issue
Block a user