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> 36 void GSDFPacketListener::on_data_available(DDS::DataReader_ptr reader)
39 DDS::ReturnCode_t status;
41 SampleInfoSeq infoSeq;
45 status = GSDFPacketDR_->take(packetSeq, infoSeq, LENGTH_UNLIMITED,
46 ANY_SAMPLE_STATE, ANY_VIEW_STATE, ANY_INSTANCE_STATE);
49 for (CORBA::ULong i = 0; i < packetSeq.length(); i++)
52 callBack_(packetSeq[i]);
53 }
catch(
const std::bad_alloc&){
57 status = GSDFPacketDR_->return_loan(packetSeq, infoSeq);
58 checkStatus(status,
"GSDFPacketDataReader::return_loan");
61 void GSDFPacketListener::on_requested_deadline_missed(DDS::DataReader_ptr
62 reader,
const DDS::RequestedDeadlineMissedStatus &status)THROW_ORB_EXCEPTIONS
64 printf(
"\n=== [GSDFPacketListener::on_requested_deadline_missed] : triggered\n");
65 printf(
"\n=== [GSDFPacketListener::on_requested_deadline_missed] : stopping\n");
68 void GSDFPacketListener::on_requested_incompatible_qos(DDS::DataReader_ptr
69 reader,
const DDS::RequestedIncompatibleQosStatus &status)
72 printf(
"\n=== [GSDFPacketListener::on_requested_incompatible_qos] : triggered\n");
75 void GSDFPacketListener::on_sample_rejected(DDS::DataReader_ptr reader,
const 76 DDS::SampleRejectedStatus &status)THROW_ORB_EXCEPTIONS
78 printf(
"\n=== [GSDFPacketListener::on_sample_rejected] : triggered\n");
81 void GSDFPacketListener::on_liveliness_changed(DDS::DataReader_ptr reader,
82 const DDS::LivelinessChangedStatus &status)THROW_ORB_EXCEPTIONS
84 printf(
"\n=== [GSDFPacketListener::on_liveliness_changed] : triggered\n");
87 void GSDFPacketListener::on_subscription_matched(DDS::DataReader_ptr reader,
88 const DDS::SubscriptionMatchedStatus &status)THROW_ORB_EXCEPTIONS
90 printf(
"\n=== [GSDFPacketListener::on_subscription_matched] : triggered\n");
93 void GSDFPacketListener::on_sample_lost(DDS::DataReader_ptr reader,
const DDS 94 ::SampleLostStatus &status)THROW_ORB_EXCEPTIONS
96 printf(
"\n=== [GSDFPacketListener::on_sample_lost] : triggered\n");
void checkStatus(DDS::ReturnCode_t status, const char *info)
DDS_DCPSUVLSeq< GSDFPacket, struct GSDFPacketSeq_uniq_ > GSDFPacketSeq
DDS_DCPSInterface_var< GSDFPacketDataReader > GSDFPacketDataReader_var