Go to the documentation of this file.00001
00023 #include "opensplice_dds_broker/GSDFPacket_listener.h"
00024 #include "opensplice_dds_broker/check_status.h"
00025 #include <boost/archive/text_oarchive.hpp>
00026 #include <boost/archive/text_iarchive.hpp>
00027 #include <boost/serialization/string.hpp>
00028 #include <boost/serialization/vector.hpp>
00029 #include <sstream>
00030 #include <fstream>
00031
00032 using namespace DDS;
00033
00034 namespace opensplice_dds_broker{
00035
00036 void GSDFPacketListener::on_data_available(DDS::DataReader_ptr reader)
00037 THROW_ORB_EXCEPTIONS
00038 {
00039 DDS::ReturnCode_t status;
00040 GSDFPacketSeq packetSeq;
00041 SampleInfoSeq infoSeq;
00042
00043 GSDFPacketDataReader_var GSDFPacketDR_ = GSDFPacketDataReader::_narrow(reader);
00044
00045 status = GSDFPacketDR_->take(packetSeq, infoSeq, LENGTH_UNLIMITED,
00046 ANY_SAMPLE_STATE, ANY_VIEW_STATE, ANY_INSTANCE_STATE);
00047 checkStatus(status, "GSDFPacketDataReader::read");
00048
00049 for (CORBA::ULong i = 0; i < packetSeq.length(); i++)
00050 {
00051 try{
00052 callBack_(packetSeq[i]);
00053 }catch(const std::bad_alloc&){
00054 return;
00055 }
00056 }
00057 status = GSDFPacketDR_->return_loan(packetSeq, infoSeq);
00058 checkStatus(status, "GSDFPacketDataReader::return_loan");
00059 };
00060
00061 void GSDFPacketListener::on_requested_deadline_missed(DDS::DataReader_ptr
00062 reader, const DDS::RequestedDeadlineMissedStatus &status)THROW_ORB_EXCEPTIONS
00063 {
00064 printf("\n=== [GSDFPacketListener::on_requested_deadline_missed] : triggered\n");
00065 printf("\n=== [GSDFPacketListener::on_requested_deadline_missed] : stopping\n");
00066 };
00067
00068 void GSDFPacketListener::on_requested_incompatible_qos(DDS::DataReader_ptr
00069 reader, const DDS::RequestedIncompatibleQosStatus &status)
00070 THROW_ORB_EXCEPTIONS
00071 {
00072 printf("\n=== [GSDFPacketListener::on_requested_incompatible_qos] : triggered\n");
00073 };
00074
00075 void GSDFPacketListener::on_sample_rejected(DDS::DataReader_ptr reader, const
00076 DDS::SampleRejectedStatus &status)THROW_ORB_EXCEPTIONS
00077 {
00078 printf("\n=== [GSDFPacketListener::on_sample_rejected] : triggered\n");
00079 };
00080
00081 void GSDFPacketListener::on_liveliness_changed(DDS::DataReader_ptr reader,
00082 const DDS::LivelinessChangedStatus &status)THROW_ORB_EXCEPTIONS
00083 {
00084 printf("\n=== [GSDFPacketListener::on_liveliness_changed] : triggered\n");
00085 };
00086
00087 void GSDFPacketListener::on_subscription_matched(DDS::DataReader_ptr reader,
00088 const DDS::SubscriptionMatchedStatus &status)THROW_ORB_EXCEPTIONS
00089 {
00090 printf("\n=== [GSDFPacketListener::on_subscription_matched] : triggered\n");
00091 };
00092
00093 void GSDFPacketListener::on_sample_lost(DDS::DataReader_ptr reader, const DDS
00094 ::SampleLostStatus &status)THROW_ORB_EXCEPTIONS
00095 {
00096 printf("\n=== [GSDFPacketListener::on_sample_lost] : triggered\n");
00097 };
00098 };