Program Listing for File SampleInfo.hpp

Return to documentation for file (/tmp/ws/src/fastrtps/include/fastdds/dds/subscriber/SampleInfo.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_DDS_SUBSCRIBER_SAMPLEINFO_HPP_
#define _FASTDDS_DDS_SUBSCRIBER_SAMPLEINFO_HPP_

#include <fastdds/dds/subscriber/InstanceState.hpp>
#include <fastdds/dds/subscriber/SampleState.hpp>
#include <fastdds/dds/subscriber/ViewState.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>

#include <fastdds/rtps/common/SampleIdentity.h>
#include <fastdds/rtps/common/Time_t.h>
#include <fastdds/rtps/common/Types.h>
#include <fastdds/dds/common/InstanceHandle.hpp>

namespace eprosima {
namespace fastdds {
namespace dds {

FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::READ",
        "Use eprosima::fastdds::dds::READ_SAMPLE_STATE instead.")
constexpr SampleStateKind READ = READ_SAMPLE_STATE;

FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NOT_READ",
        "Use eprosima::fastdds::dds::NOT_READ_SAMPLE_STATE instead.")
constexpr SampleStateKind NOT_READ = NOT_READ_SAMPLE_STATE;

FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NEW",
        "Use eprosima::fastdds::dds::NEW_VIEW_STATE instead.")
constexpr ViewStateKind NEW = NEW_VIEW_STATE;

FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NOT_NEW",
        "Use eprosima::fastdds::dds::NOT_NEW_VIEW_STATE instead.")
constexpr ViewStateKind NOT_NEW = NOT_NEW_VIEW_STATE;

FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::ALIVE",
        "Use eprosima::fastdds::dds::ALIVE_INSTANCE_STATE instead.")
constexpr InstanceStateKind ALIVE = ALIVE_INSTANCE_STATE;

FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NOT_ALIVE_DISPOSED",
        "Use eprosima::fastdds::dds::NOT_ALIVE_DISPOSED_INSTANCE_STATE instead.")
constexpr InstanceStateKind NOT_ALIVE_DISPOSED = NOT_ALIVE_DISPOSED_INSTANCE_STATE;

FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NOT_ALIVE_NO_WRITERS",
        "Use eprosima::fastdds::dds::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE instead.")
constexpr InstanceStateKind NOT_ALIVE_NO_WRITERS = NOT_ALIVE_NO_WRITERS_INSTANCE_STATE;

struct SampleInfo
{
    SampleStateKind sample_state;

    ViewStateKind view_state;

    InstanceStateKind instance_state;

    int32_t disposed_generation_count;

    int32_t no_writers_generation_count;

    int32_t sample_rank;

    int32_t generation_rank;

    int32_t absolute_generation_rank;

    fastrtps::rtps::Time_t source_timestamp;

    fastrtps::rtps::Time_t reception_timestamp;

    InstanceHandle_t instance_handle;

    InstanceHandle_t publication_handle;

    bool valid_data;

    fastrtps::rtps::SampleIdentity sample_identity;

    fastrtps::rtps::SampleIdentity related_sample_identity;

};

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

#endif /* _FASTDDS_DDS_SUBSCRIBER_SAMPLEINFO_HPP_*/