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

src/hpp/tdds/pub/Publisher.hpp

Go to the documentation of this file.
00001 #ifndef OMG_TDDS_PUB_PUBLISHER_HPP_
00002 #define OMG_TDDS_PUB_PUBLISHER_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/pub/pubfwd.hpp>
00026 #include <dds/pub/DataWriter.hpp>
00027 #include <dds/pub/qos/DataWriterQos.hpp>
00028 #include <dds/pub/qos/PublisherQos.hpp>
00029 #include <dds/domain/domainfwd.hpp>
00030 
00031 
00032 namespace tdds { namespace pub {
00033 
00042 template <typename DELEGATE>
00043 class Publisher : public tdds::core::Entity<DELEGATE> {
00044 public:
00045     typedef dds::pub::PublisherListener                 Listener;
00046     typedef dds::core::cond::StatusCondition<Publisher> StatusCondition;
00047 public:
00048         OMG_DDS_REF_TYPE(Publisher, tdds::core::Entity, DELEGATE)
00049 
00050         ~Publisher() { }
00051 
00052     using tdds::core::Entity<DELEGATE>::qos;
00053 
00054         const dds::pub::qos::PublisherQos qos() const {
00055                 return this->delegate()->qos();
00056         }
00057 
00058 
00059         void qos(const dds::pub::qos::PublisherQos& the_qos) {
00060                 this->delegate()->qos(the_qos);
00061         }
00062 
00063         Publisher& operator <<(const dds::pub::qos::PublisherQos& the_qos) {
00064                 this->delegate()->qos(the_qos);
00065                 return *this;
00066         }
00067 
00068         Publisher& operator >> (dds::pub::qos::PublisherQos& the_qos) {
00069                 the_qos = this->delegate()->qos();
00070                 return *this;
00071         }
00072 
00073     void listener(Listener* the_listener,
00074                   const dds::core::status::StatusMask& event_mask);
00075 
00076     Listener* listener() const;
00077 
00078 public:
00088     StatusCondition status_condition() const{
00089         return this->delegate()->template status_condition<Publisher>(*this);
00090     }
00091 
00092 public:
00102         void wait_for_acknowledgments(const dds::core::Duration& timeout) {
00103                 this->delegate()->wait_for_acknowledgments(timeout);
00104         }
00105 public:
00114         void default_data_writer_qos(const dds::pub::qos::DataWriterQos& dwqos) {
00115                 this->delegate()->default_data_writer_qos(dwqos);
00116         }
00117 
00123         const dds::pub::qos::DataWriterQos default_data_writer_qos() const {
00124                 return this->delegate()->default_data_writer_qos();
00125         }
00126 
00127     template <typename T>
00128     dds::pub::DataWriter<T> create_datawriter(
00129             const dds::topic::Topic<T>& a_topic);
00130 
00131     template <typename T>
00132     dds::pub::DataWriter<T> create_datawriter(
00133             const dds::topic::Topic<T>& a_topic,
00134             const dds::pub::qos::DataWriterQos& a_qos,
00135             dds::pub::DataWriterListener<T>* a_listener = NULL,
00136             const dds::core::status::StatusMask& a_mask =
00137                     dds::core::status::StatusMask::all());
00138 
00139     template <typename T>
00140     dds::pub::DataWriter<T> create_datawriter(
00141             const dds::topic::Topic<T>& a_topic,
00142             const std::string& qos_library_name,
00143             const std::string& qos_profile_name,
00144             dds::pub::DataWriterListener<T>* a_listener = NULL,
00145             const dds::core::status::StatusMask& a_mask =
00146                     dds::core::status::StatusMask::all());
00147 };
00148 
00149 } } /* namespace dds / pub */
00150 
00151 #endif /* OMG_TDDS_PUB_PUBLISHER_HPP_ */

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