00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef UPDATELISTENER_T_H 00009 #define UPDATELISTENER_T_H 00010 00011 #include "dds/DCPS/SubscriberImpl.h" 00012 #include "FederationId.h" 00013 #include "UpdateReceiver_T.h" 00014 00015 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00016 #pragma once 00017 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00018 00019 namespace OpenDDS { 00020 namespace Federator { 00021 00022 /// @class UpdateListener<DataType, ReaderType> 00023 template<class DataType, class ReaderType> 00024 class UpdateListener 00025 : public virtual OpenDDS::DCPS::LocalObject<DDS::DataReaderListener> { 00026 public: 00027 /// Default constructor 00028 UpdateListener(UpdateProcessor<DataType>& processor); 00029 00030 /// Virtual destructor 00031 virtual ~UpdateListener(); 00032 00033 virtual void on_requested_deadline_missed( 00034 DDS::DataReader_ptr reader, 00035 const DDS::RequestedDeadlineMissedStatus & status); 00036 00037 virtual void on_requested_incompatible_qos( 00038 DDS::DataReader_ptr reader, 00039 const DDS::RequestedIncompatibleQosStatus & status); 00040 00041 virtual void on_liveliness_changed( 00042 DDS::DataReader_ptr reader, 00043 const DDS::LivelinessChangedStatus & status); 00044 00045 virtual void on_subscription_matched( 00046 DDS::DataReader_ptr reader, 00047 const DDS::SubscriptionMatchedStatus & status); 00048 00049 virtual void on_sample_rejected( 00050 DDS::DataReader_ptr reader, 00051 const DDS::SampleRejectedStatus& status); 00052 00053 virtual void on_data_available( 00054 DDS::DataReader_ptr reader); 00055 00056 virtual void on_sample_lost( 00057 DDS::DataReader_ptr reader, 00058 const DDS::SampleLostStatus& status); 00059 00060 /// Access our Federation Id value. 00061 void federationId(const TAO_DDS_DCPSFederationId& id); 00062 const TAO_DDS_DCPSFederationId& federationId() const; 00063 00064 void stop(); 00065 void join(); 00066 00067 private: 00068 /// Our Federation Id value. 00069 TAO_DDS_DCPSFederationId federationId_; 00070 00071 /// Manager object to delegate sample processing to. 00072 UpdateReceiver<DataType> receiver_; 00073 00074 }; 00075 00076 } // namespace Federator 00077 } // namespace OpenDDS 00078 00079 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00080 #include "UpdateListener_T.cpp" 00081 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00082 00083 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00084 #pragma message ("UpdateListener_T.cpp template inst") 00085 #pragma implementation ("UpdateListener_T.cpp") 00086 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00087 00088 #endif /* UPDATELISTENER_T_H */