Program Listing for File AnyDataWriter.hpp

Return to documentation for file (/tmp/ws/src/fastrtps/include/dds/pub/AnyDataWriter.hpp)

/*
 * Copyright 2010, Object Management Group, Inc.
 * Copyright 2010, PrismTech, Corp.
 * Copyright 2010, Real-Time Innovations, Inc.
 * 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 OMG_DDS_PUB_ANY_DATA_WRITER_HPP_
#define OMG_DDS_PUB_ANY_DATA_WRITER_HPP_

#include <dds/pub/detail/AnyDataWriter.hpp>

#include <dds/pub/Publisher.hpp>
#include <dds/pub/qos/DataWriterQos.hpp>

#include <dds/core/Entity.hpp>
//#include <dds/topic/TopicDescription.hpp>

namespace dds {
namespace pub {

template<typename DELEGATE>
class TAnyDataWriter : public dds::core::TEntity<DELEGATE>
{
public:

    OMG_DDS_REF_TYPE_PROTECTED_DC(
        TAnyDataWriter,
        dds::core::TEntity,
        DELEGATE)

    OMG_DDS_IMPLICIT_REF_BASE(
        TAnyDataWriter)


    virtual ~TAnyDataWriter();
    //==========================================================================
    //== Entity Navigation

    OMG_DDS_API const Publisher& publisher() const;

    //    const dds::topic::TopicDescription& topic_description() const;



    //==========================================================================
    //== QoS Management

    OMG_DDS_API qos::DataWriterQos qos() const;

    OMG_DDS_API void qos(
            const qos::DataWriterQos& qos);

    OMG_DDS_API TAnyDataWriter& operator <<(
            const qos::DataWriterQos& qos);

    OMG_DDS_API const TAnyDataWriter& operator >>(
            qos::DataWriterQos& qos) const;


    //==========================================================================
    //== ACKs

    OMG_DDS_API void wait_for_acknowledgments(
            const dds::core::Duration& timeout);

    //==========================================================================
    //== Status Management

    OMG_DDS_API const dds::core::status::LivelinessLostStatus liveliness_lost_status();

    OMG_DDS_API const dds::core::status::OfferedDeadlineMissedStatus offered_deadline_missed_status();

    OMG_DDS_API const dds::core::status::OfferedIncompatibleQosStatus offered_incompatible_qos_status();

    OMG_DDS_API const dds::core::status::PublicationMatchedStatus publication_matched_status();


    //==========================================================================
    //== Liveliness Management

    OMG_DDS_API void assert_liveliness();

protected:

    const Publisher* publisher_;

};

typedef ::dds::pub::detail::AnyDataWriter AnyDataWriter;

} //namespace pub
} //namespace dds

#endif //OMG_DDS_PUB_ANY_DATA_WRITER_HPP_