summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm/impl/ndds/DataReaderListener.cpp
blob: 5b52d5e2b558ad3b694f9399004828dc3fd58bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// $Id$

#include "dds4ccm/impl/ndds/DataReaderListener.h"
#include "dds4ccm/impl/ndds/convertors/SampleLostStatus.h"
#include "dds4ccm/impl/ndds/convertors/SubscriptionMatchedStatus.h"
#include "dds4ccm/impl/ndds/convertors/RequestedDeadlineMissedStatus.h"
#include "dds4ccm/impl/ndds/convertors/SampleRejectedStatus.h"
#include "dds4ccm/impl/ndds/convertors/LivelinessChangedStatus.h"
#include "dds4ccm/impl/ndds/convertors/RequestedIncompatibleQosStatus.h"
#include "dds4ccm/impl/logger/Log_Macros.h"

namespace CIAO
{
  namespace NDDS
  {
    DDS_DataReaderListener_i::DDS_DataReaderListener_i (
      ::DDS::DataReaderListener_ptr p,
      ::DDS::DataReader_ptr dr)
      : impl_ (::DDS::DataReaderListener::_duplicate (p)),
        dr_ (::DDS::DataReader::_duplicate (dr))
    {
    }

    DDS_DataReaderListener_i::~DDS_DataReaderListener_i (void)
    {
    }

    void
    DDS_DataReaderListener_i::on_requested_deadline_missed (
      ::DDSDataReader* ,
      const ::DDS_RequestedDeadlineMissedStatus & status)
    {
      DDS4CCM_TRACE ("DDS_DataReaderListener_i::on_requested_deadline_missed");
      ::DDS::RequestedDeadlineMissedStatus ddsstatus;
      ddsstatus <<= status;
      this->impl_->on_requested_deadline_missed (this->dr_, ddsstatus);
    }

    void
    DDS_DataReaderListener_i::on_requested_incompatible_qos (
      ::DDSDataReader* ,
      const ::DDS_RequestedIncompatibleQosStatus & status)
    {
      DDS4CCM_TRACE ("DDS_DataReaderListener_i::on_requested_incompatible_qos");
      ::DDS::RequestedIncompatibleQosStatus ddsstatus;
      ddsstatus <<= status;
      this->impl_->on_requested_incompatible_qos (this->dr_, ddsstatus);
    }

    void
    DDS_DataReaderListener_i::on_sample_rejected (
      ::DDSDataReader* ,
      const ::DDS_SampleRejectedStatus & status)
    {
      DDS4CCM_TRACE ("DDS_DataReaderListener_i::on_sample_rejected");
      ::DDS::SampleRejectedStatus ddsstatus;
      ddsstatus <<= status;
      this->impl_->on_sample_rejected (this->dr_, ddsstatus);
    }

    void
    DDS_DataReaderListener_i::on_liveliness_changed (
      ::DDSDataReader* ,
      const ::DDS_LivelinessChangedStatus & status)
    {
      DDS4CCM_TRACE ("DDS_DataReaderListener_i::on_liveliness_changed");
      ::DDS::LivelinessChangedStatus ddsstatus;
      ddsstatus <<= status;
      this->impl_->on_liveliness_changed (this->dr_, ddsstatus);
    }

    void
    DDS_DataReaderListener_i::on_data_available(::DDSDataReader *)
    {
      DDS4CCM_TRACE ("DDS_DataReaderListener_i::on_data_available");
      this->impl_->on_data_available (this->dr_);
    }

    void
    DDS_DataReaderListener_i::on_subscription_matched (
      ::DDSDataReader* ,
      const ::DDS_SubscriptionMatchedStatus & status)
    {
      DDS4CCM_TRACE ("DDS_DataReaderListener_i::on_subscription_matched");
      ::DDS::SubscriptionMatchedStatus ddsstatus;
      ddsstatus <<= status;
      this->impl_->on_subscription_matched (this->dr_, ddsstatus);
    }

    void
    DDS_DataReaderListener_i::on_sample_lost (
      ::DDSDataReader* ,
      const ::DDS_SampleLostStatus & status)
    {
      DDS4CCM_TRACE ("DDS_DataReaderListener_i::on_sample_lost");
      ::DDS::SampleLostStatus ddsstatus;
      ddsstatus <<= status;
      this->impl_->on_sample_lost (this->dr_, ddsstatus);
    }

    ::DDS::DataReaderListener_ptr
    DDS_DataReaderListener_i::get_datareaderlistener (void)
    {
      return ::DDS::DataReaderListener::_duplicate (this->impl_.in ());
    }

    void
    DDS_DataReaderListener_i::set_dds_entity (::DDS::DataReader_ptr dr)
    {
      this->dr_ = ::DDS::DataReader::_duplicate (dr);
    }
  }
}