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

RTI Connext DDS Micro Version 2.4.6 Copyright © Mon Jan 25 2016 Real-Time Innovations, Inc