RTI Connext DDS Micro  Version 2.4.8
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dds_c_publication.h
Go to the documentation of this file.
1 /*
2  * FILE: dds_c_publication.h - DDS publication module
3  *
4  * (c) Copyright, Real-Time Innovations, 2012-2016.
5  *
6  * All rights reserved.
7  *
8  * No duplications, whole or partial, manual or electronic, may be made
9  * without express written permission. Any such copies, or
10  * revisions thereof, must display this notice unaltered.
11  * This code contains trade secrets of Real-Time Innovations, Inc.
12  *
13  * Modification History
14  * --------------------
15  * 07apr2016,tk MICRO-1541 Fixed assignment operator issues for C++
16  * 04nov2015,tk MICRO-1505 - Reduce memory footprint
17  * 29jun2015,tk MICRO-1351/PR#15141 Removed prototypes for non-Cert function
18  * 20sep2014,as Explicitly define public support functions for Status types
19  * 07may2014,as MICRO-784 Expose get_X_status API in C++
20  * 19mar2014,tk MICRO-74: Support endpoint specific transport
21  * 04mar2014,tk MICRO-84: Added C listener for writer-side notification of
22  * unacknowledged samples
23  * 19jul2013,as Added support for C++
24  * 06feb2013,eh MICRO-262: add writer_resource_limits
25  * 30apr2012,tk Written
26  */
27 /*ce
28  * \file
29  * \brief DDS publication module
30  */
31 /*e
32  @addtogroup DDSPublicationModule
33  @ingroup DDSCModule
34 
35  @brief Defines the \dds publication package
36 */
37 #ifndef dds_c_publication_h
38 #define dds_c_publication_h
39 
40 #include "dds_c_config.h"
41 #include "dds_c_sequence.h"
42 
43 #ifndef db_api_h
44 #include "db/db_api.h"
45 #endif
46 #ifndef dds_c_topic_h
47 #include "dds_c/dds_c_topic.h"
48 #endif
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54 
55 /*ci
56  * \brief Default name for the automatically registered DataWriter NETIO
57  * interface.
58  */
59 NETIODllVariable extern
60 const char* const DDS_DEFAULT_DATAWRITER_NETIO_NAME;
61 
62 /* ================================================================= */
63 /* Typedef for DataWriter */
64 /* ================================================================= */
65 
66 /*ce \dref_DataWriter
67  */
68 typedef struct DDS_DataWriterImpl DDS_DataWriter;
69 
70 /* ================================================================= */
71 /* Typedef for Publisher */
72 /* ================================================================= */
73 
74 /*ce \dref_Publisher
75  */
76 typedef struct DDS_PublisherImpl DDS_Publisher;
77 
78 /* ================================================================= */
79 /* Status */
80 /* ================================================================= */
81 
82 /*e \dref_OfferedDeadlineMissedStatus
83  */
84 struct DDSCPPDllExport DDS_OfferedDeadlineMissedStatus
85 {
86  /*e \dref_OfferedDeadlineMissedStatus_total_count
87  *
88  * \brief total count
89  */
91 
92  /*e \dref_OfferedDeadlineMissedStatus_total_count_change
93  */
95 
96  /*e \dref_OfferedDeadlineMissedStatus_last_instance_handle
97  */
99 
100  DDSC_CPP_STATUS_METHODS(DDS_OfferedDeadlineMissedStatus)
101 };
102 
103 /*ce \dref_OfferedDeadlineMissedStatus_INITIALIZER
104  */
105 #define DDS_OfferedDeadlineMissedStatus_INITIALIZER \
106  { 0L, 0L, DDS_HANDLE_NIL_NATIVE }
107 
108 /*ci
109  * \brief Reset the changed counters in DDS_OfferedDeadlineMissedStatus
110  *
111  * \param[in] s Structure to clear
112  */
113 DDSCDllExport void
114 DDS_OfferedDeadlineMissedStatus_reset(struct DDS_OfferedDeadlineMissedStatus *s);
115 
116 /* ----------------------------------------------------------------- */
117 
118 /*e \dref_LivelinessLostStatus
119  */
120 struct DDSCPPDllExport DDS_LivelinessLostStatus
121 {
122  /*e \dref_LivelinessLostStatus_total_count
123  */
125 
126  /*e \dref_LivelinessLostStatus_total_count_change
127  */
129 
130  DDSC_CPP_STATUS_METHODS(DDS_LivelinessLostStatus)
131 };
132 
133 /*ce \dref_LivelinessLostStatus_INITIALIZER
134  */
135 #define DDS_LivelinessLostStatus_INITIALIZER { 0L, 0L }
136 
137 /*ci
138  * \brief Reset the changed counters in DDS_LivelinessLostStatus
139  *
140  * \param[in] s Structure to clear
141  */
142 DDSCDllExport void
143 DDS_LivelinessLostStatus_reset(struct DDS_LivelinessLostStatus *s);
144 
145 /* ----------------------------------------------------------------- */
146 
147 /*e \dref_OfferedIncompatibleQosStatus
148  */
149 struct DDSCPPDllExport DDS_OfferedIncompatibleQosStatus
150 {
151  /*e \dref_OfferedIncompatibleQosStatus_total_count
152  */
154 
155  /*e \dref_OfferedIncompatibleQosStatus_total_count_change
156  */
158 
159  /*e \dref_OfferedIncompatibleQosStatus_last_policy_id
160  */
162 
163  /*e \dref_OfferedIncompatibleQosStatus_policies
164  */
165  struct DDS_QosPolicyCountSeq policies;
166 
167  DDSC_CPP_STATUS_METHODS(DDS_OfferedIncompatibleQosStatus)
168 };
169 
170 /*ce \dref_OfferedIncompatibleQosStatus_INITIALIZER
171  */
172 #define DDS_OfferedIncompatibleQosStatus_INITIALIZER \
173 { \
174  0L, 0L,DDS_INVALID_QOS_POLICY_ID, \
175  DDS_SEQUENCE_INITIALIZER \
176 }
177 
178 /*ci
179  * \brief Reset the changed counters in DDS_OfferedIncompatibleQosStatus
180  *
181  * \param[in] s Structure to clear
182  */
183 DDSCDllExport void
184 DDS_OfferedIncompatibleQosStatus_reset(struct DDS_OfferedIncompatibleQosStatus *s);
185 
186 /* ----------------------------------------------------------------- */
187 
188 /*e \dref_PublicationMatchedStatus
189  */
190 struct DDSCPPDllExport DDS_PublicationMatchedStatus
191 {
192  /*e \dref_PublicationMatchedStatus_total_count
193  */
195 
196  /*e \dref_PublicationMatchedStatus_total_count_change
197  */
199 
200  /*e \dref_PublicationMatchedStatus_current_count
201  */
203 
204  /*e \dref_PublicationMatchedStatus_current_count_change
205  */
207 
208  /*e \dref_PublicationMatchedStatus_last_subscription_handle
209  */
211 
212  DDSC_CPP_STATUS_METHODS(DDS_PublicationMatchedStatus)
213 };
214 
215 /*ce \dref_PublicationMatchedStatus_INITIALIZER
216  */
217 #define DDS_PublicationMatchedStatus_INITIALIZER \
218  { 0L, 0L, 0L, 0L, DDS_HANDLE_NIL_NATIVE }
219 
220 /*ci
221  * \brief Reset the changed counters in DDS_PublicationMatchedStatus
222  *
223  * \param[in] s Structure to reset
224  */
225 DDSCDllExport void
226 DDS_PublicationMatchedStatus_reset(struct DDS_PublicationMatchedStatus *s);
227 
228 /* ------------------------------------------------------------------------ */
229 
230 /*e \dref_ReliableReaderActivityChangedStatus
231  */
233 {
234  /*e \dref_ReliableReaderActivityChangedStatus_active_count
235  */
237 
238  /*e \dref_ReliableReaderActivityChangedStatus_inactive_count
239  */
241 
242  /*e \dref_ReliableReaderActivityChangedStatus_active_count_change
243  */
245 
246  /*e \dref_ReliableReaderActivityChangedStatus_inactive_count_change
247  */
249 
250  /*e \dref_ReliableReaderActivityChangedStatus_last_instance_handle
251  */
253 
254  DDSC_CPP_STATUS_METHODS(DDS_ReliableReaderActivityChangedStatus)
255 };
256 
257 /*e \dref_ReliableReaderActivityChangedStatus_INITIALIZER
258  */
259 #define DDS_ReliableReaderActivityChangedStatus_INITIALIZER \
260  {0, 0, 0, 0,DDS_HANDLE_NIL_NATIVE}
261 
262 /*ci
263  * \brief Reset the changed counters in DDS_ReliableReaderActivityChangedStatus
264  *
265  * \param[in] s Structure to clear
266  */
267 DDSCDllExport void
268 DDS_ReliableReaderActivityChangedStatus_reset(struct DDS_ReliableReaderActivityChangedStatus *s);
269 
270 /* ------------------------------------------------------------------------ */
271 
272 /*i \dref_ReliableSampleUnacknowledgedStatus
273  */
274 struct DDSCPPDllExport DDS_ReliableSampleUnacknowledgedStatus
275 {
276  /*i \dref_ReliableSampleUnacknowledgedStatus_sequence_number
277  */
278  struct DDS_SequenceNumber_t sequence_number;
279 
280  /*i \dref_ReliableSampleUnacknowledgedStatus_unacknowledged_count
281  */
282  DDS_Long unacknowledged_count;
283 
284  /*i \dref_ReliableSampleUnacknowledgedStatus_instance_handle
285  */
286  DDS_InstanceHandle_t instance_handle;
287 };
288 
289 /*i \dref_ReliableSampleUnacknowledgedStatus_INITIALIZER
290  */
291 #define DDS_ReliableSampleUnacknowledgedStatus_INITIALIZER \
292 {\
293  {0,0},\
294  0,\
295  DDS_HANDLE_NIL_NATIVE\
296 }
297 
298 /*ci
299  * \brief Initialize a DDS_OfferedDeadlineMissedStatus structure
300  *
301  * \param[in] self DDS_OfferedDeadlineMissedStatus to initialize
302  *
303  * \return DDS_RETCODE_OK on success, one of the standard error codes on
304  * failure
305  */
306 DDSCDllExport DDS_ReturnCode_t
307 DDS_OfferedDeadlineMissedStatus_initialize(
308  struct DDS_OfferedDeadlineMissedStatus *self);
309 
310 /*ci
311  * \brief Initialize a DDS_OfferedIncompatibleQosStatus structure
312  *
313  * \param[in] self DDS_OfferedIncompatibleQosStatus to initialize
314  *
315  * \return DDS_RETCODE_OK on success, one of the standard error codes on
316  * failure
317  */
318 DDSCDllExport DDS_ReturnCode_t
319 DDS_OfferedIncompatibleQosStatus_initialize(
320  struct DDS_OfferedIncompatibleQosStatus *self);
321 
322 /*ci
323  * \brief Initialize a DDS_PublicationMatchedStatus structure
324  *
325  * \param[in] self DDS_PublicationMatchedStatus to initialize
326  *
327  * \return DDS_RETCODE_OK on success, one of the standard error codes on
328  * failure
329  */
330 DDSCDllExport DDS_ReturnCode_t
331 DDS_PublicationMatchedStatus_initialize(
332  struct DDS_PublicationMatchedStatus *self);
333 
334 /*ci
335  * \brief Initialize a DDS_LivelinessLostStatus structure
336  *
337  * \param[in] self DDS_LivelinessLostStatus to initialize
338  *
339  * \return DDS_RETCODE_OK on success, one of the standard error codes on
340  * failure
341  */
342 DDSCDllExport DDS_ReturnCode_t
343 DDS_LivelinessLostStatus_initialize(
344  struct DDS_LivelinessLostStatus *self);
345 
346 /*ci
347  * \brief Initialize a DDS_ReliableReaderActivityChangedStatus structure
348  *
349  * \param[in] self DDS_ReliableReaderActivityChangedStatus to initialize
350  *
351  * \return DDS_RETCODE_OK on success, one of the standard error codes on
352  * failure
353  */
354 DDSCDllExport DDS_ReturnCode_t
355 DDS_ReliableReaderActivityChangedStatus_initialize(
357 
358 /* ----------------------------------------------------------------- */
359 
360 #ifdef __cplusplus
361 } /* extern "C" */
362 #endif
363 
364 /* ================================================================= */
365 /* QoS */
366 /* ================================================================= */
367 
368 /*i \dref_DataWriterData
369  */
370 struct DDS_DataWriterData
371 {
372  /*ci
373  * \brief Pointer to the datawriter specific unicast locators, if any
374  */
375  struct DDS_LocatorSeq *unicast_locator;
376 };
377 
378 /*e \dref_DataWriterQos
379  */
380 struct DDSCPPDllExport DDS_DataWriterQos
381 {
382  /*e \dref_DataWriterQos_deadline
383  */
384  struct DDS_DeadlineQosPolicy deadline;
385 
386  /*e \dref_DataWriterQos_liveliness
387  */
388  struct DDS_LivelinessQosPolicy liveliness;
389 
390  /*e \dref_DataWriterQos_history
391  */
392  struct DDS_HistoryQosPolicy history;
393 
394  /*e \dref_DataWriterQos_resource_limits
395  */
396  struct DDS_ResourceLimitsQosPolicy resource_limits;
397 
398  /*e \dref_DataWriterQos_ownership
399  */
400  struct DDS_OwnershipQosPolicy ownership;
401 
402  /*e \dref_DataWriterQos_ownership_strength
403  */
404  struct DDS_OwnershipStrengthQosPolicy ownership_strength;
405 
406  /*e \dref_DataWriterQos_reliability
407  */
408  struct DDS_ReliabilityQosPolicy reliability;
409 
410  /*e \dref_DataWriterQos_durability
411  */
412  struct DDS_DurabilityQosPolicy durability;
413 
414  /* --- Extensions: ---------------------------------------------------- */
415 
416  /*e \dref_DataWriterQos_protocol
417  */
419 
420  /*i \dref_DataWriterQos_type_support
421  */
422  struct DDS_TypeSupportQosPolicy type_support;
423 
424  /*e \dref_DataWriterQos_transport
425  */
426  struct DDS_TransportQosPolicy transport;
427 
428  /*i \dref_DataWriterQos_management
429  */
430  struct RTI_ManagementQosPolicy management;
431 
432  /*i \dref_DataWriterQos_writer_resource_limits
433  */
434  struct DDS_DataWriterResourceLimitsQosPolicy writer_resource_limits;
435 
436  struct DDS_DataWriterData *data;
437 
438  DDSC_CPP_QOS_METHODS(DDS_DataWriterQos)
439 };
440 
441 #ifdef __cplusplus
442 extern "C" {
443 #endif
444 
445 /*ce \dref_DataWriterQos_initialize
446  */
447 DDSCDllExport DDS_ReturnCode_t
449 
450 /*ce \dref_DataWriterQos_copy
451  */
452 DDSCDllExport DDS_ReturnCode_t
454  const struct DDS_DataWriterQos *source);
455 
456 /*ci
457  * \brief Compare two DDS_DataWriterQos policies for equality
458  *
459  * \param[in] left The left side of the comparison
460  * \param[in] right The right side of the comparison
461  *
462  * \return DDS_BOOLEAN_TRUE if the structures are equal,
463  * DDS_BOOLEAN_FALSE otherwise
464  */
465 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
466 DDS_DataWriterQos_is_equal(const struct DDS_DataWriterQos *left,
467  const struct DDS_DataWriterQos *right);
468 
469 #ifndef RTI_CERT
470 /*ce \dref_DataWriterQos_finalize
471  */
472 DDSCDllExport DDS_ReturnCode_t
474 #endif /* !RTI_CERT */
475 
476 /*ce \dref_DataWriterQos_INITIALIZER
477  */
478 #define DDS_DataWriterQos_INITIALIZER { \
479  DDS_DEADLINE_QOS_POLICY_DEFAULT, \
480  DDS_LIVELINESS_QOS_POLICY_DEFAULT, \
481  DDS_HISTORY_QOS_POLICY_DEFAULT, \
482  DDS_RESOURCE_LIMITS_QOS_POLICY_DEFAULT, \
483  DDS_OWNERSHIP_QOS_POLICY_DEFAULT, \
484  DDS_OWNERSHIP_STRENGTH_QOS_POLICY_DEFAULT, \
485  DDS_RELIABILITY_QOS_POLICY_DEFAULT, \
486  DDS_DURABILITY_QOS_POLICY_DEFAULT, \
487  DDS_DATA_WRITER_PROTOCOL_QOS_POLICY_DEFAULT, \
488  DDS_TYPESUPPORT_QOS_POLICY_DEFAULT, \
489  DDS_TRANSPORT_QOS_POLICY_DEFAULT, \
490  RTI_MANAGEMENT_QOS_POLICY_DEFAULT, \
491  DDS_DATAWRITERRESOURCE_LIMITS_QOS_POLICY_DEFAULT, \
492  NULL \
493 }
494 
495 #ifdef __cplusplus
496 } /* extern "C" */
497 #endif
498 
499 /* ----------------------------------------------------------------- */
500 
501 /*e \dref_PublisherQos
502  */
503 struct DDSCPPDllExport DDS_PublisherQos
504 {
505  /*e \dref_PublisherQos_entity_factory
506  */
507  struct DDS_EntityFactoryQosPolicy entity_factory;
508 
509  /*i \dref_PublisherQos_management
510  */
511  struct RTI_ManagementQosPolicy management;
512 
513  DDSC_CPP_QOS_METHODS(DDS_PublisherQos)
514 };
515 
516 #ifdef __cplusplus
517 extern "C" {
518 #endif
519 
520 /*ce \dref_PublisherQos_initialize
521  */
522 /* #if INCLUDE_API_QOS */
523 DDSCDllExport DDS_ReturnCode_t
525 
526 /*ce \dref_PublisherQos_copy
527  */
528 DDSCDllExport DDS_ReturnCode_t
530  const struct DDS_PublisherQos *source);
531 
532 /*ci
533  * \brief Compare two DDS_PublisherQos policies for equality
534  *
535  * \param[in] left The left side of the comparison
536  * \param[in] right The right side of the comparison
537  *
538  * \return DDS_BOOLEAN_TRUE if the structures are equal,
539  * DDS_BOOLEAN_FALSE otherwise
540  */
541 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
542 DDS_PublisherQos_is_equal(const struct DDS_PublisherQos *left,
543  const struct DDS_PublisherQos *right);
544 
545 #ifndef RTI_CERT
546 /*ce \dref_PublisherQos_finalize
547  */
548 DDSCDllExport DDS_ReturnCode_t
550 #endif
551 
552 /*ce \dref_PublisherQos_INITIALIZER
553  */
554 #define DDS_PublisherQos_INITIALIZER { \
555  DDS_ENTITY_FACTORY_QOS_POLICY_DEFAULT, \
556  RTI_MANAGEMENT_QOS_POLICY_DEFAULT \
557 }
558 
559 /* ================================================================= */
560 /* Listeners */
561 /* ================================================================= */
562 
563 /*ce \dref_DataWriterListener_OfferedDeadlineMissedCallback
564  */
565 typedef void
567  void *listener_data,
568  DDS_DataWriter* writer,
569  const struct DDS_OfferedDeadlineMissedStatus* status);
570 
571 /* ----------------------------------------------------------------- */
572 /*ce \dref_DataWriterListener_LivelinessLostCallback
573  */
574 typedef void
576  void *listener_data,
577  DDS_DataWriter *writer,
578  const struct DDS_LivelinessLostStatus *status);
579 
580 /* ----------------------------------------------------------------- */
581 /*ce \dref_DataWriterListener_OfferedIncompatibleQosCallback
582  */
583 typedef void
585  void *listener_data,
586  DDS_DataWriter* writer,
587  const struct DDS_OfferedIncompatibleQosStatus *status);
588 
589 /* ----------------------------------------------------------------- */
590 /*ce \dref_DataWriterListener_PublicationMatchedCallback
591  */
593  void *listener_data,
594  DDS_DataWriter *writer,
595  const struct DDS_PublicationMatchedStatus *status);
596 
597 /* ------------------------------------------------------------------------ */
598 /*e \dref_DataWriterListener_ReliableReaderActivityChangedCallback
599  */
600 typedef void
602  void *listener_data,
603  DDS_DataWriter * writer,
604  const struct DDS_ReliableReaderActivityChangedStatus * status);
605 
606 /* ------------------------------------------------------------------------ */
607 /*i \dref_DataWriterListener_ReliableSampleUnacknowledgedCallback
608  */
609 typedef void
610 (*DDS_DataWriterListener_ReliableSampleUnacknowledgedCallback)(
611  void *listener_data,
612  DDS_DataWriter *writer,
613  const struct DDS_ReliableSampleUnacknowledgedStatus *status);
614 
615 /* ----------------------------------------------------------------- */
616 /*ce \dref_DataWriterListener
617  */
619 {
620  /*ce \dref_DataWriterListener_as_listener
621  */
623 
624  /*ce \dref_DataWriterListener_on_offered_deadline_missed
625  */
628 
629  /*ce \dref_DataWriterListener_on_offered_incompatible_qos
630  */
633 
634  /*ce \dref_DataWriterListener_on_liveliness_lost
635  */
637 
638  /*ce \dref_DataWriterListener_on_publication_matched
639  */
642 
643  /*e \dref_DataWriterListener_on_reliable_reader_activity_changed
644  */
647 
648  /*i \dref_DataWriterListener_on_reliable_sample_unacknowledged
649  */
650  DDS_DataWriterListener_ReliableSampleUnacknowledgedCallback
651  on_reliable_sample_unacknowledged;
652 };
653 
654 /*ce \dref_DataWriterListener_INITIALIZER
655  */
656 #define DDS_DataWriterListener_INITIALIZER { \
657  DDS_Listener_INITIALIZER, \
658  (DDS_DataWriterListener_OfferedDeadlineMissedCallback)NULL, \
659  (DDS_DataWriterListener_OfferedIncompatibleQosCallback)NULL, \
660  (DDS_DataWriterListener_LivelinessLostCallback)NULL, \
661  (DDS_DataWriterListener_PublicationMatchedCallback)NULL,\
662  NULL,\
663  NULL\
664 }
665 
666 /* ----------------------------------------------------------------- */
667 /*ce \dref_PublisherListener
668  */
670 {
671  /*ce \dref_PublisherListener_as_datawriterlistener
672  */
674 };
675 
676 /*ce \dref_PublisherListener_INITIALIZER
677  */
678 #define DDS_PublisherListener_INITIALIZER { \
679  DDS_DataWriterListener_INITIALIZER }
680 
681 /* ================================================================= */
682 /* Publisher */
683 /* ================================================================= */
684 
685 /* ----------------------------------------------------------------- */
686 
687 /*e \dref_DATAWRITER_QOS_DEFAULT
688  */
689 extern DDSCDllVariable const struct DDS_DataWriterQos
691 
692 /* ----------------------------------------------------------------- */
693 #define DDS_Publisher_as_entity(publisherPtr) \
694  ((DDS_Entity*) publisherPtr)
695 
696 #ifdef DOXYGEN_DOCUMENTATION_ONLY
697 /*ce \dref_Publisher_as_entity
698  */
700 #endif /*DOXYGEN_DOCUMENTATION_ONLY */
701 
702 /* ----------------------------------------------------------------- */
703 #if INCLUDE_API_QOS
704 /*ce \dref_Publisher_get_default_datawriter_qos
705  */
706 DDSCDllExport DDS_ReturnCode_t
708  DDS_Publisher *self,
709  struct DDS_DataWriterQos *qos);
710 
711 /* ----------------------------------------------------------------- */
712 /* #if INCLUDE_API_QOS */
713 /*ce \dref_Publisher_set_default_datawriter_qos
714  */
715 DDSCDllExport DDS_ReturnCode_t
717  DDS_Publisher *self,
718  const struct DDS_DataWriterQos *qos);
719 #endif
720 /* ----------------------------------------------------------------- */
721 /*ce \dref_Publisher_create_datawriter
722  */
723 DDSCDllExport DDS_DataWriter*
725  DDS_Publisher *self,
726  DDS_Topic *topic,
727  const struct DDS_DataWriterQos *qos,
728  const struct DDS_DataWriterListener *listener,
729  DDS_StatusMask mask);
730 
731 /* ----------------------------------------------------------------- */
732 /*ce \dref_Publisher_enable
733  */
734 DDSCDllExport DDS_ReturnCode_t
736 
737 /* ----------------------------------------------------------------- */
738 #ifndef RTI_CERT
739 /*ce \dref_Publisher_delete_datawriter
740  */
741 DDSCDllExport DDS_ReturnCode_t
743  DDS_Publisher *self,
744  DDS_DataWriter *a_datawriter);
745 #endif
746 
747 /* ----------------------------------------------------------------- */
748 /*ce \dref_Publisher_lookup_datawriter
749  */
750 /* #if INCLUDE_API_LOOKUP || RTI_CERT */
751 DDSCDllExport DDS_DataWriter*
753  DDS_Publisher *self,
754  const char *topic_name);
755 
756 /* ----------------------------------------------------------------- */
757 /*ce \dref_Publisher_get_participant
758  */
759 DDSCDllExport DDS_DomainParticipant*
761 
762 /* ----------------------------------------------------------------- */
763 
764 #ifndef RTI_CERT
765 /*ce \dref_Publisher_delete_contained_entities
766  */
767 DDSCDllExport DDS_ReturnCode_t
769 #endif
770 
771 /* ----------------------------------------------------------------- */
772 #if INCLUDE_API_QOS
773 /*ce \dref_Publisher_set_qos
774  */
775 DDSCDllExport DDS_ReturnCode_t
777  DDS_Publisher *self,
778  const struct DDS_PublisherQos *qos);
779 
780 /* ----------------------------------------------------------------- */
781 /*ce \dref_Publisher_get_qos
782  */
783 DDSCDllExport DDS_ReturnCode_t
785  DDS_Publisher *self,
786  struct DDS_PublisherQos *qos);
787 #endif
788 
789 /* ----------------------------------------------------------------- */
790 #ifndef RTI_CERT
791 /*ce \dref_Publisher_set_listener
792  */
793 /* called internally by Pub_new() */
794 DDSCDllExport DDS_ReturnCode_t
796  DDS_Publisher * self,
797  const struct DDS_PublisherListener *l,
798  DDS_StatusMask mask);
799 #endif
800 
801 #ifndef RTI_CERT
802 /*ce \dref_Publisher_get_listener
803  */
804 DDSCDllExport struct DDS_PublisherListener
806 #endif
807 
808 /* ================================================================= */
809 /* Data Writer */
810 /* ================================================================= */
811 
812 /* ----------------------------------------------------------------- */
813 #define DDS_DataWriter_as_entity(dataWriterPtr) \
814  ((DDS_Entity*) dataWriterPtr)
815 
816 #ifdef DOXYGEN_DOCUMENTATION_ONLY
817 /*ce \dref_DataWriter_as_entity
818  */
820 #endif /*DOXYGEN_DOCUMENTATION_ONLY */
821 
822 /* ----------------------------------------------------------------- */
823 /*ce \dref_DataWriter_enable
824 */
825 DDSCDllExport DDS_ReturnCode_t
827 
828 /*ce \dref_DataWriter_assert_liveliness
829  */
830 DDSCDllExport DDS_ReturnCode_t
832 
833 /* ----------------------------------------------------------------- */
834 #if INCLUDE_API_LOOKUP
835 /*ce \dref_DataWriter_get_matched_subscriptions
836  */
837 DDSCDllExport DDS_ReturnCode_t
839  DDS_DataWriter *self,
840  struct DDS_InstanceHandleSeq *subscription_handles);
841 #endif /* INCLUDE_API_LOOKUP */
842 
844 
845 /* ----------------------------------------------------------------- */
846 #if INCLUDE_API_LOOKUP
847 /*ce \dref_DataWriter_get_matched_subscription_data
848  */
849 DDSCDllExport DDS_ReturnCode_t
851  DDS_DataWriter *self,
852  struct DDS_SubscriptionBuiltinTopicData *subscription_data,
853  const DDS_InstanceHandle_t *subscription_handle);
854 #endif /* INCLUDE_API_LOOKUP */
855 
856 /* ----------------------------------------------------------------- */
857 /*ce \dref_DataWriter_get_topic
858  */
859 DDSCDllExport DDS_Topic*
861 
862 /* ----------------------------------------------------------------- */
863 /*ce \dref_DataWriter_get_publisher
864  */
865 DDSCDllExport DDS_Publisher*
867 
868 /* ----------------------------------------------------------------- */
869 /*ce \dref_DataWriter_get_liveliness_lost_status
870  */
871 DDSCDllExport DDS_ReturnCode_t
873  DDS_DataWriter *self,
874  struct DDS_LivelinessLostStatus *status);
875 
876 /* ----------------------------------------------------------------- */
877 /*ce \dref_DataWriter_get_offered_deadline_missed_status
878  */
879 DDSCDllExport DDS_ReturnCode_t
881  DDS_DataWriter *self,
882  struct DDS_OfferedDeadlineMissedStatus *status);
883 
884 /* ----------------------------------------------------------------- */
885 /*ce \dref_DataWriter_get_offered_incompatible_qos_status
886  */
887 DDSCDllExport DDS_ReturnCode_t
889  DDS_DataWriter *self,
890  struct DDS_OfferedIncompatibleQosStatus *status);
891 
892 /* ----------------------------------------------------------------- */
893 /*ce \dref_DataWriter_get_publication_matched_status
894  */
895 DDSCDllExport DDS_ReturnCode_t
897  DDS_DataWriter *self,
898  struct DDS_PublicationMatchedStatus *status);
899 
900 /* ------------------------------------------------------------------------ */
901 /*e \dref_DataWriter_get_reliable_reader_activity_changed_status
902  */
903 DDSCDllExport DDS_ReturnCode_t
905  DDS_DataWriter *self,
907 
908 /* ----------------------------------------------------------------- */
909 /*ci
910  * \brief Get a pointer to the DataWriter's Qos policy
911  *
912  * \details
913  * NOTE: It is up to the caller to ensure the datawriter is not deleted while
914  * the Qos is being accessed.
915  *
916  * \return Pointer to DDS_DataWriterQos*
917  */
918 DDSCDllExport struct DDS_DataWriterQos*
919 DDS_DataWriter_get_qos_ref(DDS_DataWriter *self);
920 
921 #if INCLUDE_API_QOS
922 /*ce \dref_DataWriter_set_qos
923  */
924 DDSCDllExport DDS_ReturnCode_t
926  DDS_DataWriter *self,
927  const struct DDS_DataWriterQos *qos);
928 
929 
930 /* ----------------------------------------------------------------- */
931 /*ce \dref_DataWriter_get_qos
932  */
933 DDSCDllExport DDS_ReturnCode_t
935  struct DDS_DataWriterQos *qos);
936 #endif
937 
938 /* ----------------------------------------------------------------- */
939 #ifndef RTI_CERT
940 /*ce \dref_DataWriter_set_listener
941  */
942 DDSCDllExport DDS_ReturnCode_t
944  DDS_DataWriter * self,
945  const struct DDS_DataWriterListener *l,
946  DDS_StatusMask mask);
947 #endif
948 
949 #ifndef RTI_CERT
950 /*ce \dref_DataWriter_get_listener
951  */
952 DDSCDllExport struct DDS_DataWriterListener
954 #endif
955 
956 /********************* Untyped Writer API ****************************/
957 /*e \dref_DataWriter_register_instance
958  */
959 DDSCDllExport DDS_InstanceHandle_t
961  DDS_DataWriter * self,
962  const void *instance_data);
963 
964 /*e \dref_DataWriter_register_instance_w_timestamp
965  */
966 DDSCDllExport DDS_InstanceHandle_t
968  DDS_DataWriter * self,
969  const void *instance_data,
970  const struct DDS_Time_t *source_timestamp);
971 
972 /*ce \dref_DataWriter_unregister_instance
973  */
974 DDSCDllExport DDS_ReturnCode_t
976  DDS_DataWriter *self,
977  const void *instance_data,
978  const DDS_InstanceHandle_t *handle);
979 
980 /*ce \dref_DataWriter_unregister_instance_w_timestamp
981  */
982 DDSCDllExport DDS_ReturnCode_t
984  DDS_DataWriter *self,
985  const void *instance_data,
986  const DDS_InstanceHandle_t *handle,
987  const struct DDS_Time_t *source_timestamp);
988 
989 /*ce \dref_DataWriter_dispose
990  */
991 DDSCDllExport DDS_ReturnCode_t
993  DDS_DataWriter *self,
994  const void *instance_data,
995  const DDS_InstanceHandle_t *handle);
996 
997 /*ce \dref_DataWriter_dispose_w_timestamp
998  */
999 DDSCDllExport DDS_ReturnCode_t
1001  DDS_DataWriter *self,
1002  const void *instance_data,
1003  const DDS_InstanceHandle_t *handle,
1004  const struct DDS_Time_t *source_timestamp);
1005 
1006 /*ce \dref_DataWriter_write
1007  */
1008 DDSCDllExport DDS_ReturnCode_t
1010  DDS_DataWriter *self,
1011  const void *instance_data,
1012  const DDS_InstanceHandle_t * handle);
1013 
1014 /*ce \dref_DataWriter_write_w_timestamp
1015  */
1016 DDSCDllExport DDS_ReturnCode_t
1018  DDS_DataWriter *self,
1019  const void *instance_data,
1020  const DDS_InstanceHandle_t *handle,
1021  const struct DDS_Time_t *source_timestamp);
1022 
1023 /*ce \dref_DataWriter_write_w_params
1024  */
1025 DDSCDllExport DDS_ReturnCode_t
1027  DDS_DataWriter *self,
1028  const void *instance_data,
1029  struct DDS_WriteParams_t *params);
1030 
1031 /*i \dref_DataWriteR_get_liveliness_count
1032  */
1033 DDSCDllExport DDS_Long
1034 DDS_DataWriter_get_liveliness_count(DDS_DataWriter * self);
1035 
1036 /****************** Additional Internal APIs **************************/
1037 
1038 /*ci
1039  * \brief Increment the sequence number the datawriter is using for samples
1040  *
1041  * \details
1042  * An anonymous datawriter does not increment the sequence number on each
1043  * send. Instead the application using this datawriter must increment the
1044  * sequence number. When a datareader receives a sequence number it has
1045  * already seen it drops the samples. Thus, this function enables an
1046  * application to determine when the content of a sample has changed and
1047  * should be processed by a datareader by incrementing the sequence number.
1048  * This is typically used as part of participant discovery to prevent known
1049  * remote participants from processing known information, while sending the
1050  * same sample to newly discovered remote participants.
1051  *
1052  * \param[in] self Datawriter to increment the sequence number on
1053  *
1054  * \return DDS_RETCODE_OK on success, one the the standard return codes on
1055  * failure
1056  */
1057 MUST_CHECK_RETURN DDSCDllExport DDS_ReturnCode_t
1058 DDS_DataWriter_advance_sn(DDS_DataWriter *self);
1059 
1060 /*ci
1061  * \brief Add a new peer to a DDS participant
1062  *
1063  * \details
1064  * The peers for a participant is usually specified in the initial peer
1065  * list in the participant Qos policy. This function lets an application
1066  * add additional peers.
1067  *
1068  * \param[in] datawriter Datawriter to add the peer to
1069  * \param[in] dst_reader The peer datareader to send data to
1070  * \param[in] address The address of the peer datareader in NETIO address
1071  * string format
1072  *
1073  * \return DDS_BOOLEAN_TRUE on success, DDS_BOOLEAN_FALSE on failure
1074  */
1075 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1076 DDS_DataWriter_add_anonymous_peer(DDS_DataWriter *datawriter,
1077  struct NETIO_Address *dst_reader,
1078  const char *address);
1079 
1080 #ifndef RTI_CERT
1081 /*ci
1082  * \brief Remove a peer from a DDS participant
1083  *
1084  * \details
1085  * The peers for a participant is usually specified in the initial peer
1086  * list in the participant Qos policy. This function lets an application
1087  * remove a peer.
1088  *
1089  * \param[in] datawriter Datawriter to remote the peer from
1090  * \param[in] dst_reader The peer datareader to remove
1091  * \param[in] address The address of the peer datareader in NETIO address
1092  * string format
1093  *
1094  * \return DDS_BOOLEAN_TRUE on success, DDS_BOOLEAN_FALSE on failure
1095  */
1096 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1097 DDS_DataWriter_delete_anonymous_peer(DDS_DataWriter *datawriter,
1098  struct NETIO_Address *dst_reader,
1099  const char *address);
1100 #endif /* !RTI_CERT */
1101 /*
1102  * \brief Add an anonymous route to a DDS DataReader
1103  *
1104  * \details
1105  * This function adds an anonymous route to a DataWriter. An anonymous
1106  * route is a route with no state information and is typically used
1107  * by a DDS participant to send to discovery traffic to other
1108  * participants in a domain.
1109  *
1110  * \param[in] self The datawriter to add the route to
1111  * \param[in] dst_reader The peer reader to listen to
1112  * \param[in] via_address The address to send data on
1113  *
1114  * \return DDS_BOOLEAN_TRUE on success, DDS_BOOLEAN_FALSE on failure
1115  */
1116 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1117 DDS_DataWriter_add_anonymous_route(DDS_DataWriter *datawriter,
1118  struct NETIO_Address *dst_reader,
1119  struct NETIO_Address *via_address);
1120 
1121 #ifndef RTI_CERT
1122 /*ci
1123  * \brief Remove an anonymous route from a DDS DataWriter
1124  *
1125  * \details
1126  * This function removes an anonymous route from a DataWriter. An anonymous
1127  * route is a route with no state information and is typically used
1128  * by a DDS participant to send discovery traffic to other
1129  * participants in a domain. This function stops sending traffic
1130  * to a particular address.
1131  *
1132  * \param[in] self The datareader to remove the route from
1133  * \param[in] src_writer The peer writer to stop listening to
1134  * \param[in] from_address The address to stop listening on
1135  *
1136  * \return DDS_BOOLEAN_TRUE on success, DDS_BOOLEAN_FALSE on failure
1137  */
1138 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1139 DDS_DataWriter_delete_anonymous_route(DDS_DataWriter *datawriter,
1140  struct NETIO_Address *dst_reader,
1141  struct NETIO_Address *via_address);
1142 #endif
1143 
1144 /*ci
1145  * \brief Check if a route exists from a datawriter to a datareader
1146  *
1147  * \details
1148  * Check if a route exists from a datawriter to a datareader using any of
1149  * the locators passed in. Note that there is an implicit assumption that
1150  * the protocol stack is DDS<->RTPS<->"transport" where transport can be
1151  * any NETIO_Interface compliant layer.
1152  *
1153  * \param[in] src_writer Source data-writer
1154  * \param[in] dst_reader Destination data-reader
1155  * \param[in] loc_seq Sequence of addresses the data-reader is located at
1156  *
1157  * \return DDS_BOOLEAN_TRUE if a path exists, DDS_BOOLEAN is no
1158  */
1159 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1160 DDS_DataWriter_lookup_route(DDS_DataWriter *src_writer,
1161  struct NETIO_Address *dst_reader,
1162  const struct DDS_LocatorSeq *loc_seq);
1163 
1164 struct DDS_DataReaderQos;
1165 
1166 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1167 DDS_DataWriter_add_route(DDS_DataWriter *datawriter,
1168  const DDS_BuiltinTopicKey_t *key,
1169  const struct DDS_DataReaderQos *const qos,
1170  const struct DDS_LocatorSeq *uc_locator,
1171  const struct DDS_LocatorSeq *mc_locator,
1172  RTI_BOOL *route_existed);
1173 
1174 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1175 DDS_DataWriter_delete_route(DDS_DataWriter *datawriter,
1176  const DDS_BuiltinTopicKey_t *key,
1177  const struct DDS_LocatorSeq *uc_locator,
1178  const struct DDS_LocatorSeq *mc_locator,
1179  RTI_BOOL *route_existed);
1180 
1181 /* ----------------------------------------------------------------- */
1182 
1183 #ifdef __cplusplus
1184 } /* extern "C" */
1185 #endif
1186 
1187 #ifndef dds_c_w_history_plugin_h
1188 #include "dds_c/dds_c_wh_plugin.h"
1189 #endif
1190 
1191 
1192 #endif /* dds_c_publication_h */

RTI Connext DDS Micro Version 2.4.8 Copyright © Tue Apr 12 2016 Real-Time Innovations, Inc