Program Listing for File Topic.hpp

Return to documentation for file (/tmp/ws/src/fastrtps/include/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 OMG_DDS_TOPIC_HPP_
#define OMG_DDS_TOPIC_HPP_


#include <dds/topic/detail/Topic.hpp>
#include <dds/core/Entity.hpp>
#include <dds/topic/qos/TopicQos.hpp>
#include <dds/domain/DomainParticipant.hpp>

namespace dds {
namespace topic {

class TopicListener;


class Topic : public dds::core::TEntity<detail::Topic>
{
    friend class DomainParticipantImpl;

public:

    OMG_DDS_REF_TYPE_PROTECTED_DC(
        Topic,
        dds::core::TEntity,
        detail::Topic)

    OMG_DDS_IMPLICIT_REF_BASE(
        Topic)


    OMG_DDS_API Topic(
            const dds::domain::DomainParticipant& dp,
            const std::string& topic_name,
            const std::string& type_name);

    OMG_DDS_API Topic(
            const dds::domain::DomainParticipant& dp,
            const std::string& topic_name,
            const std::string& type_name,
            const qos::TopicQos& qos,
            TopicListener* listener = nullptr,
            const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none());

    virtual OMG_DDS_API ~Topic();
private:

    dds::domain::DomainParticipant* participant_;

};

} /* namespace topic */
} /* namespace dds */

#endif /* OMG_DDS_TOPIC_HPP_ */