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 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00020 00021 namespace OpenDDS { 00022 namespace Federator { 00023 00024 /// @class UpdateListener<DataType, ReaderType> 00025 template<class DataType, class ReaderType> 00026 class UpdateListener 00027 : public virtual OpenDDS::DCPS::LocalObject<DDS::DataReaderListener> { 00028 public: 00029 UpdateListener(UpdateProcessor<DataType>& processor); 00030 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 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00080 00081 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00082 #include "UpdateListener_T.cpp" 00083 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00084 00085 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00086 #pragma message ("UpdateListener_T.cpp template inst") 00087 #pragma implementation ("UpdateListener_T.cpp") 00088 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00089 00090 #endif /* UPDATELISTENER_T_H */