Program Listing for File Topic.hpp

Return to documentation for file (/tmp/ws/src/fastrtps/include/fastdds/dds/topic/Topic.hpp)

// Copyright 2020 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_TOPIC_HPP_
#define _FASTDDS_TOPIC_HPP_

#include <fastrtps/fastrtps_dll.h>
#include <fastdds/dds/core/Entity.hpp>
#include <fastdds/dds/core/status/BaseStatus.hpp>
#include <fastdds/dds/topic/TopicDescription.hpp>
#include <fastdds/dds/topic/qos/TopicQos.hpp>

using eprosima::fastrtps::types::ReturnCode_t;

namespace dds {
namespace topic {

class Topic;

} // namespace topic
} // namespace dds

namespace eprosima {
namespace fastdds {
namespace dds {

class DomainParticipant;
class TopicListener;
class DomainParticipantImpl;
class TopicProxy;

class Topic : public DomainEntity, public TopicDescription
{
    friend class TopicProxy;
    friend class DomainParticipantImpl;

    Topic(
            const std::string& topic_name,
            const std::string& type_name,
            TopicProxy* p,
            const StatusMask& mask = StatusMask::all());

    Topic(
            DomainParticipant* dp,
            const std::string& topic_name,
            const std::string& type_name,
            const TopicQos& qos = TOPIC_QOS_DEFAULT,
            TopicListener* listener = nullptr,
            const StatusMask& mask = StatusMask::all());

public:

    virtual ~Topic();

    virtual DomainParticipant* get_participant() const override;

    ReturnCode_t get_inconsistent_topic_status(
            InconsistentTopicStatus& status);

    RTPS_DllAPI const TopicQos& get_qos() const;

    RTPS_DllAPI ReturnCode_t get_qos(
            TopicQos& qos) const;

    RTPS_DllAPI ReturnCode_t set_qos(
            const TopicQos& qos);

    RTPS_DllAPI const TopicListener* get_listener() const;

    RTPS_DllAPI ReturnCode_t set_listener(
            TopicListener* listener,
            const StatusMask& mask = StatusMask::all());

    TopicDescriptionImpl* get_impl() const override;

protected:

    TopicProxy* impl_;

    friend class ::dds::topic::Topic;

};

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

#endif /* _FASTDDS_TOPIC_HPP_ */