Cyclone ISO C++ API Reference Guide
DataWriter.hpp
Go to the documentation of this file.
1 #ifndef OMG_DDS_PUB_DATA_WRITER_HPP_
2 #define OMG_DDS_PUB_DATA_WRITER_HPP_
3 
4 /* Copyright 2010, Object Management Group, Inc.
5  * Copyright 2010, PrismTech, Corp.
6  * Copyright 2010, Real-Time Innovations, Inc.
7  * All rights reserved.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
23 #include <dds/topic/Topic.hpp>
25 //#include <dds/topic/BuiltinTopic.hpp>
26 #include <dds/pub/Publisher.hpp>
28 
29 #include <dds/pub/detail/DataWriter.hpp>
30 
32 namespace dds
33 {
34 namespace pub
35 {
36 template <typename T,
37  template <typename Q> class DELEGATE = dds::pub::detail::DataWriter >
38 class DataWriter;
39 
40 template <typename T> class DataWriterListener;
41 }
42 }
88 template <typename T>
90 {
91 
92 public:
97 
98 public:
101 
102 public:
103 
120  DataWriter(const dds::pub::Publisher& pub,
121  const ::dds::topic::Topic<T>& topic);
122 
169  DataWriter(const dds::pub::Publisher& pub,
170  const ::dds::topic::Topic<T>& topic,
174 
175 public:
177  virtual ~DataWriter();
181 public:
182  //==========================================================================
183  //== Write API
184 
234  void write(const T& sample);
235 
274  void write(const T& sample, const dds::core::Time& timestamp);
275 
338  void write(const T& sample, const ::dds::core::InstanceHandle& instance);
339 
384  void write(const T& data,
385  const ::dds::core::InstanceHandle& instance,
386  const dds::core::Time& timestamp);
387 
388 
429  void write(const dds::topic::TopicInstance<T>& i);
430 
475  void write(const dds::topic::TopicInstance<T>& i,
476  const dds::core::Time& timestamp);
477 
526  template <typename FWIterator>
527  void write(const FWIterator& begin, const FWIterator& end);
528 
579  template <typename FWIterator>
580  void write(const FWIterator& begin, const FWIterator& end,
581  const dds::core::Time& timestamp);
582 
627  template <typename SamplesFWIterator, typename HandlesFWIterator>
628  void write(const SamplesFWIterator& data_begin,
629  const SamplesFWIterator& data_end,
630  const HandlesFWIterator& handle_begin,
631  const HandlesFWIterator& handle_end);
632 
679  template <typename SamplesFWIterator, typename HandlesFWIterator>
680  void write(const SamplesFWIterator& data_begin,
681  const SamplesFWIterator& data_end,
682  const HandlesFWIterator& handle_begin,
683  const HandlesFWIterator& handle_end,
684  const dds::core::Time& timestamp);
685 
686 
688  DataWriter& operator << (const T& data);
689 
691  DataWriter& operator << (const std::pair<T, dds::core::Time>& data);
692 
694  DataWriter& operator << (const std::pair<T, ::dds::core::InstanceHandle>& data);
695 
700  DataWriter& operator <<(DataWriter & (*manipulator)(DataWriter&));
703  //==========================================================================
704  //== Instance Management
705 
770  const ::dds::core::InstanceHandle register_instance(const T& key);
771 
823  const ::dds::core::InstanceHandle register_instance(const T& key,
824  const dds::core::Time& timestamp);
825 
906  DataWriter& unregister_instance(const ::dds::core::InstanceHandle& i);
907 
957  DataWriter& unregister_instance(const ::dds::core::InstanceHandle& i,
958  const dds::core::Time& timestamp);
959 
1011  DataWriter& unregister_instance(const T& key);
1012 
1066  DataWriter& unregister_instance(const T& key,
1067  const dds::core::Time& timestamp);
1068 
1172  DataWriter& dispose_instance(const ::dds::core::InstanceHandle& i);
1173 
1226  DataWriter& dispose_instance(const ::dds::core::InstanceHandle& i,
1227  const dds::core::Time& timestamp);
1228 
1276  DataWriter& dispose_instance(const T& key);
1277 
1326  DataWriter& dispose_instance(const T& key,
1327  const dds::core::Time& timestamp);
1328 
1361  const ::dds::core::InstanceHandle& h);
1362 
1394  T& key_value(T& sample, const ::dds::core::InstanceHandle& h);
1395 
1420 
1421  //==========================================================================
1422  //== QoS Management
1423 
1425  DataWriter& operator <<(const ::dds::pub::qos::DataWriterQos& qos);
1426 
1427 
1428  //==========================================================================
1429  //== Entity Navigation
1430 
1442  const dds::topic::Topic<T>& topic() const;
1443 
1444  //==========================================================================
1445  //== Listeners Management
1446 
1524  const ::dds::core::status::StatusMask& mask);
1525 
1536 };
1537 
1538 #endif /* OMG_DDS_PUB_DATA_WRITER_HPP_ */
dds::pub::qos::DataWriterQos
This object provides the basic mechanism for an application to specify Quality of Service attributes ...
Definition: DataWriterQos.hpp:68
dds::pub::DataWriter::lookup_instance
dds::core::InstanceHandle lookup_instance(const T &key)
Topic.hpp
dds::core::status::StatusMask
StatusMask is a bitmap or bitset field.
Definition: State.hpp:144
dds::pub::DataWriter::Listener
dds::pub::DataWriterListener< T > Listener
Definition: DataWriter.hpp:96
OMG_DDS_IMPLICIT_REF_BASE
#define OMG_DDS_IMPLICIT_REF_BASE(TYPE)
Definition: refmacros.hpp:75
dds::pub::DataWriterListener
DataWriter events Listener.
Definition: DataWriterListener.hpp:102
dds::pub::DataWriter::operator<<
DataWriter & operator<<(const T &data)
dds::pub::DataWriter::key_value
dds::topic::TopicInstance< T > & key_value(dds::topic::TopicInstance< T > &i, const ::dds::core::InstanceHandle &h)
dds::core::InstanceHandle
Class to hold the handle associated with in sample instance.
Definition: InstanceHandle.hpp:40
dds::core::status::StatusMask::none
static StatusMask none()
Definition: State.hpp:205
AnyDataWriter.hpp
dds::pub::DataWriter::listener
DataWriterListener< T > * listener() const
dds::pub::AnyDataWriter
Typeless base class for the typed DataWriter.
Definition: AnyDataWriter.hpp:48
dds::pub::Publisher
The Publisher acts on the behalf of one or several DataWriter objects that belong to it.
Definition: Publisher.hpp:55
dds::topic::TopicInstance
A TopicInstance encapsulates a dds::sub::Sample and its associated dds::core::InstanceHandle.
Definition: TopicInstance.hpp:30
dds::pub::DataWriter
DataWriter allows the application to set the value of the sample to be published under a given Topic.
Definition: DataWriter.hpp:89
dds::pub::DataWriter::unregister_instance
DataWriter & unregister_instance(const ::dds::core::InstanceHandle &i)
dds::pub::DataWriter::register_instance
const ::dds::core::InstanceHandle register_instance(const T &key)
dds::pub::DataWriter::DataWriter
DataWriter(const dds::pub::Publisher &pub, const ::dds::topic::Topic< T > &topic)
dds
Definition: array.hpp:30
dds::core::begin
T::iterator begin(T &t)
Definition: array.hpp:34
OMG_DDS_REF_TYPE_PROTECTED_DC_T
#define OMG_DDS_REF_TYPE_PROTECTED_DC_T(TYPE, BASE, T_PARAM, DELEGATE)
Definition: refmacros.hpp:171
dds::core::end
T::iterator end(T &t)
Definition: array.hpp:39
InstanceHandle.hpp
Publisher.hpp
dds::topic::Topic
Topic is the most basic description of the data to be published and subscribed.
Definition: Topic.hpp:36
dds::core::Time
Definition: Time.hpp:42
dds::pub::DataWriter::topic
const dds::topic::Topic< T > & topic() const
dds::pub::DataWriter::write
void write(const T &sample)
dds::pub::AnyDataWriter::qos
dds::pub::qos::DataWriterQos qos() const
TopicInstance.hpp
dds::pub::DataWriter::dispose_instance
DataWriter & dispose_instance(const ::dds::core::InstanceHandle &i)