Program Listing for File DomainParticipantQos.hpp

Return to documentation for file (include/fastdds/dds/domain/qos/DomainParticipantQos.hpp)

// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// 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 FASTDDS_DDS_DOMAIN_QOS__DOMAINPARTICIPANTQOS_HPP
#define FASTDDS_DDS_DOMAIN_QOS__DOMAINPARTICIPANTQOS_HPP

#include <string>

#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/rtps/attributes/BuiltinTransports.hpp>
#include <fastdds/rtps/attributes/ThreadSettings.hpp>
#include <fastdds/rtps/flowcontrol/FlowControllerDescriptor.hpp>
#include <fastdds/fastdds_dll.hpp>

namespace eprosima {
namespace fastdds {
namespace dds {

class DomainParticipantQos
{
public:

    friend class DomainParticipantExtendedQos;

    using FlowControllerDescriptorList = std::vector<std::shared_ptr<fastdds::rtps::FlowControllerDescriptor>>;

    FASTDDS_EXPORTED_API DomainParticipantQos()
    {
#ifdef FASTDDS_STATISTICS
        /*
         * In the case of Statistics, the following properties are set with an empty value. This is because if these
         * properties are set and empty during the enabling of the DomainParticipant, they are fill with the default
         * mechanism
         */
        properties_.properties().emplace_back(parameter_policy_physical_data_host, "");
        properties_.properties().emplace_back(parameter_policy_physical_data_user, "");
        properties_.properties().emplace_back(parameter_policy_physical_data_process, "");
#endif // ifdef FASTDDS_STATISTICS
    }

    FASTDDS_EXPORTED_API virtual ~DomainParticipantQos()
    {
    }

    virtual bool operator ==(
            const DomainParticipantQos& b) const
    {
        return (this->user_data_ == b.user_data()) &&
               (this->entity_factory_ == b.entity_factory()) &&
               (this->allocation_ == b.allocation()) &&
               (this->properties_ == b.properties()) &&
               (this->wire_protocol_ == b.wire_protocol()) &&
               (this->transport_ == b.transport()) &&
               (this->name_ == b.name()) &&
               (this->builtin_controllers_sender_thread_ == b.builtin_controllers_sender_thread()) &&
               (this->timed_events_thread_ == b.timed_events_thread()) &&
               (this->discovery_server_thread_ == b.discovery_server_thread()) &&
               (this->typelookup_service_thread_ == b.typelookup_service_thread()) &&
#if HAVE_SECURITY
               (this->security_log_thread_ == b.security_log_thread()) &&
#endif // if HAVE_SECURITY
               (compare_flow_controllers(b));
    }

    const UserDataQosPolicy& user_data() const
    {
        return user_data_;
    }

    UserDataQosPolicy& user_data()
    {
        return user_data_;
    }

    void user_data(
            const UserDataQosPolicy& value)
    {
        user_data_ = value;
    }

    const EntityFactoryQosPolicy& entity_factory() const
    {
        return entity_factory_;
    }

    EntityFactoryQosPolicy& entity_factory()
    {
        return entity_factory_;
    }

    void entity_factory(
            const EntityFactoryQosPolicy& value)
    {
        entity_factory_ = value;
    }

    const ParticipantResourceLimitsQos& allocation() const
    {
        return allocation_;
    }

    ParticipantResourceLimitsQos& allocation()
    {
        return allocation_;
    }

    void allocation(
            const ParticipantResourceLimitsQos& allocation)
    {
        allocation_ = allocation;
    }

    const PropertyPolicyQos& properties() const
    {
        return properties_;
    }

    PropertyPolicyQos& properties()
    {
        return properties_;
    }

    void properties(
            const PropertyPolicyQos& properties)
    {
        properties_ = properties;
    }

    const WireProtocolConfigQos& wire_protocol() const
    {
        return wire_protocol_;
    }

    WireProtocolConfigQos& wire_protocol()
    {
        return wire_protocol_;
    }

    void wire_protocol(
            const WireProtocolConfigQos& wire_protocol)
    {
        wire_protocol_ = wire_protocol;
    }

    const TransportConfigQos& transport() const
    {
        return transport_;
    }

    TransportConfigQos& transport()
    {
        return transport_;
    }

    void transport(
            const TransportConfigQos& transport)
    {
        transport_ = transport;
    }

    const fastcdr::string_255& name() const
    {
        return name_;
    }

    fastcdr::string_255& name()
    {
        return name_;
    }

    void name(
            const fastcdr::string_255& value)
    {
        name_ = value;
    }

    FlowControllerDescriptorList& flow_controllers()
    {
        return flow_controllers_;
    }

    FASTDDS_EXPORTED_API bool compare_flow_controllers(
            const DomainParticipantQos& qos) const;

    const FlowControllerDescriptorList& flow_controllers() const
    {
        return flow_controllers_;
    }

    rtps::ThreadSettings& builtin_controllers_sender_thread()
    {
        return builtin_controllers_sender_thread_;
    }

    const rtps::ThreadSettings& builtin_controllers_sender_thread() const
    {
        return builtin_controllers_sender_thread_;
    }

    FASTDDS_EXPORTED_API void setup_transports(
            rtps::BuiltinTransports transports,
            const rtps::BuiltinTransportsOptions& options = rtps::BuiltinTransportsOptions());

    void builtin_controllers_sender_thread(
            const rtps::ThreadSettings& value)
    {
        builtin_controllers_sender_thread_ = value;
    }

    rtps::ThreadSettings& timed_events_thread()
    {
        return timed_events_thread_;
    }

    const rtps::ThreadSettings& timed_events_thread() const
    {
        return timed_events_thread_;
    }

    void timed_events_thread(
            const rtps::ThreadSettings& value)
    {
        timed_events_thread_ = value;
    }

    rtps::ThreadSettings& discovery_server_thread()
    {
        return discovery_server_thread_;
    }

    const rtps::ThreadSettings& discovery_server_thread() const
    {
        return discovery_server_thread_;
    }

    void discovery_server_thread(
            const rtps::ThreadSettings& value)
    {
        discovery_server_thread_ = value;
    }

    rtps::ThreadSettings& typelookup_service_thread()
    {
        return typelookup_service_thread_;
    }

    const rtps::ThreadSettings& typelookup_service_thread() const
    {
        return typelookup_service_thread_;
    }

    void typelookup_service_thread(
            const rtps::ThreadSettings& value)
    {
        typelookup_service_thread_ = value;
    }

#if HAVE_SECURITY
    rtps::ThreadSettings& security_log_thread()
    {
        return security_log_thread_;
    }

    const rtps::ThreadSettings& security_log_thread() const
    {
        return security_log_thread_;
    }

    void security_log_thread(
            const rtps::ThreadSettings& value)
    {
        security_log_thread_ = value;
    }

#endif // if HAVE_SECURITY

private:

    UserDataQosPolicy user_data_;

    EntityFactoryQosPolicy entity_factory_;

    ParticipantResourceLimitsQos allocation_;

    PropertyPolicyQos properties_;

    WireProtocolConfigQos wire_protocol_;

    TransportConfigQos transport_;

    fastcdr::string_255 name_ = "RTPSParticipant";

    FlowControllerDescriptorList flow_controllers_;

    rtps::ThreadSettings builtin_controllers_sender_thread_;

    rtps::ThreadSettings timed_events_thread_;

    rtps::ThreadSettings discovery_server_thread_;

    rtps::ThreadSettings typelookup_service_thread_;

#if HAVE_SECURITY
    rtps::ThreadSettings security_log_thread_;
#endif // if HAVE_SECURITY

};

FASTDDS_EXPORTED_API extern const DomainParticipantQos PARTICIPANT_QOS_DEFAULT;


} // namespace dds
} // namespace fastdds
} // namespace eprosima

#endif // FASTDDS_DDS_DOMAIN_QOS__DOMAINPARTICIPANTQOS_HPP