123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- #ifndef _FASTDDS_RTPS_ATTRIBUTES_PROPERTYPOLICY_H_
- #define _FASTDDS_RTPS_ATTRIBUTES_PROPERTYPOLICY_H_
- #include <fastdds/rtps/common/Property.h>
- #include <fastdds/rtps/common/BinaryProperty.h>
- #include <fastrtps/fastrtps_dll.h>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- class PropertyPolicy
- {
- public:
- RTPS_DllAPI PropertyPolicy() {}
- RTPS_DllAPI PropertyPolicy(const PropertyPolicy& property_policy) :
- properties_(property_policy.properties_),
- binary_properties_(property_policy.binary_properties_) {}
- RTPS_DllAPI PropertyPolicy(PropertyPolicy&& property_policy) :
- properties_(std::move(property_policy.properties_)),
- binary_properties_(std::move(property_policy.binary_properties_)) {}
- RTPS_DllAPI PropertyPolicy& operator=(const PropertyPolicy& property_policy)
- {
- properties_ = property_policy.properties_;
- binary_properties_ = property_policy.binary_properties_;
- return *this;
- }
- RTPS_DllAPI PropertyPolicy& operator=(PropertyPolicy&& property_policy)
- {
- properties_ = std::move(property_policy.properties_);
- binary_properties_= std::move(property_policy.binary_properties_);
- return *this;
- }
- RTPS_DllAPI bool operator==(const PropertyPolicy& b) const
- {
- return (this->properties_ == b.properties_) &&
- (this->binary_properties_ == b.binary_properties_);
- }
-
- RTPS_DllAPI const PropertySeq& properties() const
- {
- return properties_;
- }
-
- RTPS_DllAPI PropertySeq& properties()
- {
- return properties_;
- }
-
- RTPS_DllAPI const BinaryPropertySeq& binary_properties() const
- {
- return binary_properties_;
- }
-
- RTPS_DllAPI BinaryPropertySeq& binary_properties()
- {
- return binary_properties_;
- }
- private:
- PropertySeq properties_;
- BinaryPropertySeq binary_properties_;
- };
- class PropertyPolicyHelper
- {
- public:
-
- RTPS_DllAPI static PropertyPolicy get_properties_with_prefix(
- const PropertyPolicy& property_policy,
- const std::string& prefix);
-
- RTPS_DllAPI static size_t length(const PropertyPolicy& property_policy);
-
- RTPS_DllAPI static std::string* find_property(
- PropertyPolicy& property_policy,
- const std::string& name);
-
- RTPS_DllAPI static const std::string* find_property(
- const PropertyPolicy& property_policy,
- const std::string& name);
- };
- }
- }
- }
- #endif // _FASTDDS_RTPS_ATTRIBUTES_PROPERTYPOLICY_H_
|