11 #ifndef RTIREFLEX_GENERIC_DW_H
12 #define RTIREFLEX_GENERIC_DW_H
28 std::shared_ptr<DDSDynamicDataWriter> initialize_writer(DDSDomainParticipant *participant,
29 const DDS_DataWriterQos & dwqos,
30 const char * topic_name,
31 const char * type_name,
32 DDSDynamicDataTypeSupport * support,
33 DDSDataWriterListener * listener,
34 DDS_DynamicDataTypeProperty_t props);
54 std::shared_ptr<DDSDynamicDataWriter> safe_datawriter_;
58 const char * topic_name,
59 const char * type_name = 0,
60 DDS_DynamicDataTypeProperty_t props =
61 DDS_DYNAMIC_DATA_TYPE_PROPERTY_DEFAULT)
62 : type_manager_(props),
64 safe_datawriter_(detail::initialize_writer(
66 DDS_DATAWRITER_QOS_DEFAULT,
75 DDS_DataWriterQos & dwqos,
76 const char * topic_name,
77 const char * type_name = 0,
78 DDSDataWriterListener * listener = 0,
79 DDS_DynamicDataTypeProperty_t props =
80 DDS_DYNAMIC_DATA_TYPE_PROPERTY_DEFAULT)
81 : type_manager_(props),
83 safe_datawriter_(detail::initialize_writer(
99 DDS_ReturnCode_t
write(
const T & data,
100 const DDS_InstanceHandle_t& handle = DDS_HANDLE_NIL)
103 return safe_datawriter_->write(*dd_instance_.
get(), handle);
115 return safe_datawriter_->write_w_params(*dd_instance_.
get(), params);
123 return safe_datawriter_.get();
138 return type_manager_.get_properties();
146 return type_manager_.get_safe_typecode();
154 return type_manager_.get_typecode();
162 return type_manager_.get_type_support();
170 #ifndef REFLEX_NO_HEADER_ONLY
171 #include "reflex/../../src/generic_dw.cxx"
174 #endif // RTIREFLEX_GENERIC_DW_H
const DDS_DynamicDataTypeProperty_t & get_properties() const
Definition: generic_dw.h:136
void write_dynamicdata(DDS_DynamicData &dest, const T &src)
Copies source data into the destination DDS_DynamicData instance.
Definition: reflex.h:157
DDSDynamicDataWriter * operator->()
Return the underlying DDSDynamicDataWriter.
Definition: generic_dw.h:129
DDS_ReturnCode_t write(const T &data, const DDS_InstanceHandle_t &handle=DDS_HANDLE_NIL)
Publish an instance of type T.
Definition: generic_dw.h:99
const SafeTypeCode< T > & get_safe_typecode() const
Definition: generic_dw.h:144
Manage type-specific context, such as typecode, type-support, and dynamic data properties.
Definition: type_manager.h:44
GenericDataWriter(DDSDomainParticipant *participant, DDS_DataWriterQos &dwqos, const char *topic_name, const char *type_name=0, DDSDataWriterListener *listener=0, DDS_DynamicDataTypeProperty_t props=DDS_DYNAMIC_DATA_TYPE_PROPERTY_DEFAULT)
Definition: generic_dw.h:74
DDS_DynamicData * get()
Return the underlying DynamicData instance.
Definition: auto_dd.cxx:98
const DDSDynamicDataTypeSupport * get_type_support() const
Definition: generic_dw.h:160
Automatically manages the memory of a DynamicData instance.
Definition: auto_dd.h:33
DDS_ReturnCode_t write_w_params(const T &data, DDS_WriteParams_t ¶ms)
Publish an instance of type T.
Definition: generic_dw.h:112
#define REFLEX_DLL_EXPORT
Definition: dllexport.h:35
GenericDataWriter(DDSDomainParticipant *participant, const char *topic_name, const char *type_name=0, DDS_DynamicDataTypeProperty_t props=DDS_DYNAMIC_DATA_TYPE_PROPERTY_DEFAULT)
Definition: generic_dw.h:57
A datawriter for adapted aggregate types.
Definition: generic_dw.h:50
DDSDynamicDataWriter * underlying()
Return the underlying DDSDynamicDataWriter.
Definition: generic_dw.h:121
A type-safe, exception-safe wrapper for DDS TypeCode.
Definition: reflex_fwd.h:27
const DDS_TypeCode * get_typecode() const
Definition: generic_dw.h:152