File content_filter_property.hpp

File List > astutedds > dcps > content_filter_property.hpp

Go to the documentation of this file

//
// Copyright (c) 2026, Astute Systems PTY LTD
//
// This file is part of the Astute DDS developed by Astute Systems.
//
// See the commercial LICENSE file in the project root for full license details.
//
// @file content_filter_property.hpp
// @brief PID_CONTENT_FILTER_PROPERTY (0x0035) discovery struct + CDR codec
//
// This header intentionally carries only the OMG-defined discovery
// datatype and its serialisation helpers so it can be included by
// layers (RTPS transport, DCPS Subscriber) that must NOT pull in the
// DDSSQL filter engine (which defines FilterValue / FilterOperator /
// LogicalOperator symbols that collide with ContentFilteredTopic).
//
// Reference: RTPS 2.5 §8.7.3.1, §9.4.2.11, §9.6.4.1
//

#ifndef ASTUTEDDS_DCPS_CONTENT_FILTER_PROPERTY_HPP
#define ASTUTEDDS_DCPS_CONTENT_FILTER_PROPERTY_HPP

#include <cstdint>
#include <optional>
#include <string>
#include <vector>

namespace astutedds::dcps
{

struct ContentFilterProperty
{
    std::string              content_filtered_topic_name;
    std::string              related_topic_name;
    std::string              filter_class_name;
    std::string              filter_expression;
    std::vector<std::string> expression_parameters;

    std::vector<uint8_t> serialize() const;

    static std::optional<ContentFilterProperty> deserialize(const std::vector<uint8_t>& data);
};

}  // namespace astutedds::dcps

#endif  // ASTUTEDDS_DCPS_CONTENT_FILTER_PROPERTY_HPP