GSDFPacket_listener.cpp
Go to the documentation of this file.
1 
25 #include <boost/archive/text_oarchive.hpp>
26 #include <boost/archive/text_iarchive.hpp>
27 #include <boost/serialization/string.hpp>
28 #include <boost/serialization/vector.hpp>
29 #include <sstream>
30 #include <fstream>
31 
32 using namespace DDS;
33 
34 namespace opensplice_dds_comm{
35 
36  void GSDFPacketListener::on_data_available(DDS::DataReader_ptr reader)
37  THROW_ORB_EXCEPTIONS
38  {
39  DDS::ReturnCode_t status;
40  GSDFPacketSeq packetSeq;
41  SampleInfoSeq infoSeq;
42 
43  GSDFPacketDataReader_var GSDFPacketDR_ = GSDFPacketDataReader::_narrow(reader);
44 
45  status = GSDFPacketDR_->take(packetSeq, infoSeq, LENGTH_UNLIMITED,
46  ANY_SAMPLE_STATE, ANY_VIEW_STATE, ANY_INSTANCE_STATE);
47  checkStatus(status, "GSDFPacketDataReader::read");
48 
49  for (CORBA::ULong i = 0; i < packetSeq.length(); i++)
50  {
51  try{
52  callBack_(packetSeq[i]);
53  }catch(const std::bad_alloc&){
54  return;
55  }
56  }
57  status = GSDFPacketDR_->return_loan(packetSeq, infoSeq);
58  checkStatus(status, "GSDFPacketDataReader::return_loan");
59  };
60 
61  void GSDFPacketListener::on_requested_deadline_missed(DDS::DataReader_ptr
62  reader, const DDS::RequestedDeadlineMissedStatus &status)THROW_ORB_EXCEPTIONS
63  {
64  printf("\n=== [GSDFPacketListener::on_requested_deadline_missed] : triggered\n");
65  printf("\n=== [GSDFPacketListener::on_requested_deadline_missed] : stopping\n");
66  };
67 
68  void GSDFPacketListener::on_requested_incompatible_qos(DDS::DataReader_ptr
69  reader, const DDS::RequestedIncompatibleQosStatus &status)
70  THROW_ORB_EXCEPTIONS
71  {
72  printf("\n=== [GSDFPacketListener::on_requested_incompatible_qos] : triggered\n");
73  };
74 
75  void GSDFPacketListener::on_sample_rejected(DDS::DataReader_ptr reader, const
76  DDS::SampleRejectedStatus &status)THROW_ORB_EXCEPTIONS
77  {
78  printf("\n=== [GSDFPacketListener::on_sample_rejected] : triggered\n");
79  };
80 
81  void GSDFPacketListener::on_liveliness_changed(DDS::DataReader_ptr reader,
82  const DDS::LivelinessChangedStatus &status)THROW_ORB_EXCEPTIONS
83  {
84  printf("\n=== [GSDFPacketListener::on_liveliness_changed] : triggered\n");
85  };
86 
87  void GSDFPacketListener::on_subscription_matched(DDS::DataReader_ptr reader,
88  const DDS::SubscriptionMatchedStatus &status)THROW_ORB_EXCEPTIONS
89  {
90  printf("\n=== [GSDFPacketListener::on_subscription_matched] : triggered\n");
91  };
92 
93  void GSDFPacketListener::on_sample_lost(DDS::DataReader_ptr reader, const DDS
94  ::SampleLostStatus &status)THROW_ORB_EXCEPTIONS
95  {
96  printf("\n=== [GSDFPacketListener::on_sample_lost] : triggered\n");
97  };
98 };
DDS_DCPSInterface_var< GSDFPacketDataReader > GSDFPacketDataReader_var
void checkStatus(DDS::ReturnCode_t status, const char *info)
DDS_DCPSUVLSeq< GSDFPacket, struct GSDFPacketSeq_uniq_ > GSDFPacketSeq


opensplice_dds_comm
Author(s):
autogenerated on Thu Jun 1 2017 02:43:49