123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- #ifndef TOPICPARAMETERS_H_
- #define TOPICPARAMETERS_H_
- #include <string>
- #include <fastdds/rtps/common/Types.h>
- #include <fastrtps/qos/QosPolicies.h>
- namespace eprosima {
- namespace fastrtps{
- class TopicAttributes
- {
- public:
-
- TopicAttributes()
- : topicKind(rtps::NO_KEY)
- , topicName("UNDEF")
- , topicDataType("UNDEF")
- , auto_fill_type_object(true)
- , auto_fill_type_information(true)
- {
- }
-
- TopicAttributes(
- const char* name,
- const char* dataType,
- rtps::TopicKind_t tKind= rtps::NO_KEY)
- {
- topicKind = tKind;
- topicName = name;
- topicDataType = dataType;
- auto_fill_type_object = true;
- auto_fill_type_information = true;
- }
- virtual ~TopicAttributes() {}
- bool operator==(const TopicAttributes& b) const
- {
- return (this->topicKind == b.topicKind) &&
- (this->topicName == b.topicName) &&
- (this->topicDataType == b.topicDataType) &&
- (this->historyQos == b.historyQos);
- }
-
- const string_255& getTopicDataType() const {
- return topicDataType;
- }
-
- rtps::TopicKind_t getTopicKind() const {
- return topicKind;
- }
-
- const string_255& getTopicName() const {
- return topicName;
- }
-
- rtps::TopicKind_t topicKind;
-
- string_255 topicName;
-
- string_255 topicDataType;
-
- HistoryQosPolicy historyQos;
-
- ResourceLimitsQosPolicy resourceLimitsQos;
-
- TypeIdV1 type_id;
-
- TypeObjectV1 type;
-
- xtypes::TypeInformation type_information;
-
- bool auto_fill_type_object;
-
- bool auto_fill_type_information;
-
- bool checkQos() const;
- };
- #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
- bool inline operator!=(const TopicAttributes& t1, const TopicAttributes& t2)
- {
- if(t1.topicKind != t2.topicKind
- || t1.topicName != t2.topicName
- || t1.topicDataType != t2.topicDataType
- || t1.historyQos.kind != t2.historyQos.kind
- || (t1.historyQos.kind == KEEP_LAST_HISTORY_QOS && t1.historyQos.depth != t2.historyQos.depth))
- {
- return true;
- }
- return false;
- }
- #endif
- }
- }
- #endif
|