00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_DCPS_SENDREPONSELISTENER_H 00009 #define OPENDDS_DCPS_SENDREPONSELISTENER_H 00010 00011 #include "dds/DCPS/dcps_export.h" 00012 #include "TransportSendListener.h" 00013 #include "dds/DCPS/MessageTracker.h" 00014 #include "dds/DCPS/PoolAllocator.h" 00015 00016 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00017 00018 namespace OpenDDS { 00019 namespace DCPS { 00020 00021 /** 00022 * @class SendResponseListener 00023 * 00024 * @brief Simple listener to discard response samples. 00025 * 00026 * This is a simple listener implementation used to release response 00027 * samples once they have been either delivered or dropped. No 00028 * special actions are taken to distinguish between the two results. 00029 */ 00030 class OpenDDS_Dcps_Export SendResponseListener 00031 : public TransportSendListener { 00032 public: 00033 explicit SendResponseListener(const OPENDDS_STRING& msg_src); 00034 virtual ~SendResponseListener(); 00035 00036 virtual void data_delivered(const DataSampleElement* sample); 00037 virtual void data_dropped(const DataSampleElement* sample, 00038 bool dropped_by_transport); 00039 00040 virtual void control_delivered(const Message_Block_Ptr& sample); 00041 virtual void control_dropped(const Message_Block_Ptr& sample, 00042 bool dropped_by_transport); 00043 00044 void notify_publication_disconnected(const ReaderIdSeq&) {} 00045 void notify_publication_reconnected(const ReaderIdSeq&) {} 00046 void notify_publication_lost(const ReaderIdSeq&) {} 00047 void remove_associations(const ReaderIdSeq&, bool) {} 00048 00049 void track_message(); 00050 00051 private: 00052 void _add_ref() {} 00053 void _remove_ref() {} 00054 00055 MessageTracker tracker_; 00056 }; 00057 00058 } // namespace DCPS 00059 } // namespace OpenDDS 00060 00061 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00062 00063 #endif /* OPENDDS_DCPS_SENDRESPONSELISTENER_H */