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

src/hpp/tdds/sub/Subscriber.hpp

Go to the documentation of this file.
00001 #ifndef OMG_TDDS_SUB_SUBSCRIBER_HPP_
00002 #define OMG_TDDS_SUB_SUBSCRIBER_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 <tdds/core/Entity.hpp>
00024 #include <dds/core/cond/StatusCondition.hpp>
00025 #include <dds/topic/topicfwd.hpp>
00026 #include <dds/sub/subfwd.hpp>
00027 #include <dds/sub/qos/SubscriberQos.hpp>
00028 
00029 
00030 namespace tdds { namespace sub {
00031 
00032 template <typename DELEGATE>
00033 class Subscriber : public tdds::core::Entity<DELEGATE> {
00034 public:
00035         OMG_DDS_REF_TYPE(Subscriber, tdds::core::Entity, DELEGATE)
00036 
00037 public:
00038     typedef dds::sub::SubscriberListener                 Listener;
00039     typedef dds::core::cond::StatusCondition<Subscriber> StatusCondition;
00040 
00041 public:
00042         ~Subscriber() {}
00043 public:
00053     StatusCondition status_condition() const{
00054         return this->delegate()->template status_condition<Subscriber>(*this);
00055     }
00056 
00057 public:
00065         void notify_datareaders() {
00066                 this->delegate()->notify_datareaders();
00067         }
00068 
00069     void listener(Listener*,
00070                   const dds::core::status::StatusMask& event_mask);
00071 
00072     Listener* listener() const;
00073 
00074     using tdds::core::Entity<DELEGATE>::qos;
00075 
00076         const dds::sub::qos::SubscriberQos qos() const {
00077                 return this->delegate()->qos();
00078         }
00079 
00080         void qos(const dds::sub::qos::SubscriberQos& the_qos) {
00081                 this->delegate()->qos(the_qos);
00082         }
00083 
00084     // --- DataReader Factory Methods: --- //
00085 public:
00086     template <typename T>
00087     dds::sub::DataReader<T> create_datareader(
00088             const dds::topic::TopicDescription<T>&  a_topic);
00089 
00090     template <typename T>
00091     dds::sub::DataReader<T> create_datareader(
00092             const dds::topic::TopicDescription<T>&  a_topic,
00093             const dds::sub::qos::DataReaderQos&     a_qos,
00094             dds::sub::DataReaderListener<T>*        a_listener = NULL,
00095             const dds::core::status::StatusMask&    a_mask     =
00096                     dds::core::status::StatusMask::all());
00097 
00098     template <typename T>
00099     dds::sub::DataReader<T> create_datareader(
00100             const dds::topic::TopicDescription<T>&  a_topic,
00101             const std::string&                      qos_library_name,
00102             const std::string&                      qos_profile_name,
00103             dds::sub::DataReaderListener<T>*        a_listener = NULL,
00104             const dds::core::status::StatusMask&    a_mask     =
00105                     dds::core::status::StatusMask::all());
00106 
00107     const dds::sub::qos::DataReaderQos default_datareader_qos() const;
00108     void default_datareader_qos(const dds::sub::qos::DataReaderQos &qos);
00109     void default_datareader_qos(const std::string& qos_library_name,
00110                                 const std::string& qos_profile_name);
00111 };
00112 
00113 }}
00114 #endif /* OMG_TDDS_SUB_SUBSCRIBER_HPP_ */

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