Program Listing for File ReaderListener.h

Return to documentation for file (/tmp/ws/src/fastrtps/include/fastdds/rtps/reader/ReaderListener.h)

// Copyright 2016 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_RTPS_READERLISTENER_H_
#define _FASTDDS_RTPS_READERLISTENER_H_

#include <fastdds/dds/core/status/LivelinessChangedStatus.hpp>
#include <fastdds/dds/core/status/SubscriptionMatchedStatus.hpp>
#include <fastdds/dds/core/status/SampleRejectedStatus.hpp>
#include <fastdds/rtps/builtin/data/WriterProxyData.h>
#include <fastdds/rtps/common/Guid.h>
#include <fastdds/rtps/common/MatchingInfo.h>
#include <fastdds/rtps/writer/WriterDiscoveryInfo.h>

namespace eprosima {
namespace fastrtps {
namespace rtps {

class RTPSReader;
struct CacheChange_t;

class RTPS_DllAPI ReaderListener
{
public:

    ReaderListener() = default;

    virtual ~ReaderListener() = default;

    virtual void onReaderMatched(
            RTPSReader* reader,
            MatchingInfo& info)
    {
        static_cast<void>(reader);
        static_cast<void>(info);
    }

    virtual void onReaderMatched(
            RTPSReader* reader,
            const fastdds::dds::SubscriptionMatchedStatus& info)
    {
        static_cast<void>(reader);
        static_cast<void>(info);
    }

    virtual void onNewCacheChangeAdded(
            RTPSReader* reader,
            const CacheChange_t* const change)
    {
        static_cast<void>(reader);
        static_cast<void>(change);
    }

    virtual void on_liveliness_changed(
            RTPSReader* reader,
            const eprosima::fastdds::dds::LivelinessChangedStatus& status)
    {
        static_cast<void>(reader);
        static_cast<void>(status);
    }

    virtual void on_requested_incompatible_qos(
            RTPSReader* reader,
            eprosima::fastdds::dds::PolicyMask qos)
    {
        static_cast<void>(reader);
        static_cast<void>(qos);
    }

    virtual void on_sample_lost(
            RTPSReader* reader,
            int32_t sample_lost_since_last_update)
    {
        static_cast<void>(reader);
        static_cast<void>(sample_lost_since_last_update);
    }

    virtual void on_writer_discovery(
            RTPSReader* reader,
            WriterDiscoveryInfo::DISCOVERY_STATUS reason,
            const GUID_t& writer_guid,
            const WriterProxyData* writer_info)
    {
        static_cast<void>(reader);
        static_cast<void>(reason);
        static_cast<void>(writer_guid);
        static_cast<void>(writer_info);
    }

    virtual void on_sample_rejected(
            RTPSReader* reader,
            eprosima::fastdds::dds::SampleRejectedStatusKind reason,
            const CacheChange_t* const change)
    {
        static_cast<void>(reader);
        static_cast<void>(reason);
        static_cast<void>(change);
    }

    virtual void on_data_available(
            RTPSReader* reader,
            const GUID_t& writer_guid,
            const SequenceNumber_t& first_sequence,
            const SequenceNumber_t& last_sequence,
            bool& should_notify_individual_changes)
    {
        static_cast<void>(reader);
        static_cast<void>(writer_guid);
        static_cast<void>(first_sequence);
        static_cast<void>(last_sequence);

        should_notify_individual_changes = true;
    }

};

} // namespace rtps
} // namespace fastrtps
} // namespace eprosima

#endif /* _FASTDDS_RTPS_READERLISTENER_H_ */