00001 #ifndef OMG_DDS_PUB_DATA_WRITER_LISTENER_HPP_ 00002 #define OMG_DDS_PUB_DATA_WRITER_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/pub/pubfwd.hpp> 00024 00025 00026 namespace dds { namespace pub { 00027 00028 template <typename T> 00029 class DataWriterListener { 00030 public: 00031 virtual ~DataWriterListener() { } 00032 00033 public: 00034 virtual void on_offered_deadline_missed( 00035 dds::pub::DataWriter<T>& writer, 00036 const dds::core::status::OfferedDeadlineMissedStatus& status) = 0; 00037 00038 virtual void on_offered_incompatible_qos( 00039 dds::pub::DataWriter<T> writer, 00040 const dds::core::status::OfferedIncompatibleQosStatus& status) = 0; 00041 00042 virtual void on_liveliness_lost( 00043 dds::pub::DataWriter<T>& writer, 00044 const dds::core::status::LivelinessLostStatus& status) = 0; 00045 00046 virtual void on_publication_matched( 00047 dds::pub::DataWriter<T>& writer, 00048 const dds::core::status::PublicationMatchedStatus& status) = 0; 00049 }; 00050 00051 00052 template <typename T> 00053 class NoOpDataWriterListener : public virtual DataWriterListener<T> { 00054 public: 00055 virtual ~NoOpDataWriterListener() { } 00056 00057 public: 00058 virtual void on_offered_deadline_missed( 00059 dds::pub::DataWriter<T> writer, 00060 const dds::core::status::OfferedDeadlineMissedStatus& status) { } 00061 00062 virtual void on_offered_incompatible_qos( 00063 dds::pub::DataWriter<T> writer, 00064 const dds::core::status::OfferedIncompatibleQosStatus& status) { } 00065 00066 virtual void on_liveliness_lost( 00067 dds::pub::DataWriter<T> writer, 00068 const dds::core::status::LivelinessLostStatus& status) { } 00069 00070 virtual void on_publication_matched( 00071 dds::pub::DataWriter<T> writer, 00072 const dds::core::status::PublicationMatchedStatus& status) { } 00073 }; 00074 00075 } } 00076 00077 #endif /* OMG_DDS_PUB_DATA_WRITER_LISTENER_HPP_ */
1.7.1