• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/hpp/dds/sub/DataReaderListener.hpp

Go to the documentation of this file.
00001 #ifndef OMG_DDS_SUB_DATA_READER_LISTENER_HPP_
00002 #define OMG_DDS_SUB_DATA_READER_LISTENER_HPP_
00003 
00004 /* Copyright 2010, Object Management Group, Inc.
00005  * Copyright 2010, PrismTech, Corp.
00006  * Copyright 2010, Real-Time Innovations, Inc.
00007  * All rights reserved.
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License");
00010  * you may not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  *     http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS,
00017  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021 
00022 #include <dds/core/corefwd.hpp>
00023 #include <dds/sub/subfwd.hpp>
00024 
00025 
00026 namespace dds { namespace sub {
00027 
00028 template <typename T>
00029 class DataReaderListener {
00030 public:
00031     virtual ~DataReaderListener() { }
00032 
00033 public:
00034     virtual void on_requested_deadline_missed(
00035             DataReader<T>& the_reader,
00036             const dds::core::status::RequestedDeadlineMissedStatus& status) = 0;
00037     
00038     virtual void on_requested_incompatible_qos(
00039             DataReader<T>& the_reader,
00040             const dds::core::status::RequestedIncompatibleQosStatus& status) = 0;
00041     
00042     virtual void on_sample_rejected(
00043             DataReader<T>& the_reader,
00044             const dds::core::status::SampleRejectedStatus& status) = 0;
00045     
00046     virtual void on_liveliness_changed(
00047             DataReader<T>& the_reader,
00048             const dds::core::status::LivelinessChangedStatus& status) = 0;
00049     
00050     virtual void on_data_available(DataReader<T>& the_reader) = 0;
00051     
00052     virtual void on_subscription_matched(
00053             DataReader<T>& the_reader,
00054             const dds::core::status::SubscriptionMatchedStatus& status) = 0;
00055     
00056     virtual void on_sample_lost(
00057             DataReader<T>& the_reader,
00058             const dds::core::status::SampleLostStatus& status) = 0;
00059 };
00060 
00061 
00062 template <typename T>
00063 class NoOpDataReaderListener : public virtual DataReaderListener<T> {
00064 public:
00065     virtual ~NoOpDataReaderListener() { }
00066 
00067 public:
00068     virtual void on_requested_deadline_missed(
00069             DataReader<T>& the_reader,
00070             const dds::core::status::RequestedDeadlineMissedStatus& status) { }
00071 
00072     virtual void on_requested_incompatible_qos(
00073             DataReader<T>& the_reader,
00074             const dds::core::status::RequestedIncompatibleQosStatus& status) { }
00075 
00076     virtual void on_sample_rejected(
00077             DataReader<T>& the_reader,
00078             const dds::core::status::SampleRejectedStatus& status) { }
00079 
00080     virtual void on_liveliness_changed(
00081             DataReader<T>& the_reader,
00082             const dds::core::status::LivelinessChangedStatus& status) { }
00083 
00084     virtual void on_data_available(DataReader<T>& the_reader) { }
00085 
00086     virtual void on_subscription_matched(
00087             DataReader<T>& the_reader,
00088             const dds::core::status::SubscriptionMatchedStatus& status) { }
00089 
00090     virtual void on_sample_lost(
00091             DataReader<T>& the_reader,
00092             const dds::core::status::SampleLostStatus& status) { }
00093 };
00094     
00095 } }
00096 
00097 #endif /* OMG_DDS_SUB_DATA_READER_LISTENER_HPP_ */

Generated on Tue Nov 9 2010 02:16:21 for dds-psm-cxx-doc by  doxygen 1.7.1