RTI Connext DDS Micro  Version 2.4.10
 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  /*e \dref_DataWriterQos_destination_order
415  */
416  struct DDS_DestinationOrderQosPolicy destination_order;
417 
418  /* --- Extensions: ---------------------------------------------------- */
419 
420  /*e \dref_DataWriterQos_protocol
421  */
423 
424  /*i \dref_DataWriterQos_type_support
425  */
426  struct DDS_TypeSupportQosPolicy type_support;
427 
428  /*e \dref_DataWriterQos_transport
429  */
430  struct DDS_TransportQosPolicy transport;
431 
432  /*i \dref_DataWriterQos_management
433  */
434  struct RTI_ManagementQosPolicy management;
435 
436  /*i \dref_DataWriterQos_writer_resource_limits
437  */
438  struct DDS_DataWriterResourceLimitsQosPolicy writer_resource_limits;
439 
440  struct DDS_DataWriterData *data;
441 
442  DDSC_CPP_QOS_METHODS(DDS_DataWriterQos)
443 };
444 
445 #ifdef __cplusplus
446 extern "C" {
447 #endif
448 
449 /*ce \dref_DataWriterQos_initialize
450  */
451 DDSCDllExport DDS_ReturnCode_t
453 
454 /*ce \dref_DataWriterQos_copy
455  */
456 DDSCDllExport DDS_ReturnCode_t
458  const struct DDS_DataWriterQos *source);
459 
460 /*ci
461  * \brief Compare two DDS_DataWriterQos policies for equality
462  *
463  * \param[in] left The left side of the comparison
464  * \param[in] right The right side of the comparison
465  *
466  * \return DDS_BOOLEAN_TRUE if the structures are equal,
467  * DDS_BOOLEAN_FALSE otherwise
468  */
469 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
470 DDS_DataWriterQos_is_equal(const struct DDS_DataWriterQos *left,
471  const struct DDS_DataWriterQos *right);
472 
473 #ifndef RTI_CERT
474 /*ce \dref_DataWriterQos_finalize
475  */
476 DDSCDllExport DDS_ReturnCode_t
478 #endif /* !RTI_CERT */
479 
480 /*ce \dref_DataWriterQos_INITIALIZER
481  */
482 #define DDS_DataWriterQos_INITIALIZER { \
483  DDS_DEADLINE_QOS_POLICY_DEFAULT, \
484  DDS_LIVELINESS_QOS_POLICY_DEFAULT, \
485  DDS_HISTORY_QOS_POLICY_DEFAULT, \
486  DDS_RESOURCE_LIMITS_QOS_POLICY_DEFAULT, \
487  DDS_OWNERSHIP_QOS_POLICY_DEFAULT, \
488  DDS_OWNERSHIP_STRENGTH_QOS_POLICY_DEFAULT, \
489  DDS_RELIABILITY_QOS_POLICY_DEFAULT, \
490  DDS_DURABILITY_QOS_POLICY_DEFAULT, \
491  DDS_DESTINATION_ORDER_QOS_POLICY_DEFAULT, \
492  DDS_DATA_WRITER_PROTOCOL_QOS_POLICY_DEFAULT, \
493  DDS_TYPESUPPORT_QOS_POLICY_DEFAULT, \
494  DDS_TRANSPORT_QOS_POLICY_DEFAULT, \
495  RTI_MANAGEMENT_QOS_POLICY_DEFAULT, \
496  DDS_DATAWRITERRESOURCE_LIMITS_QOS_POLICY_DEFAULT, \
497  NULL \
498 }
499 
500 #ifdef __cplusplus
501 } /* extern "C" */
502 #endif
503 
504 /* ----------------------------------------------------------------- */
505 
506 /*e \dref_PublisherQos
507  */
508 struct DDSCPPDllExport DDS_PublisherQos
509 {
510  /*e \dref_PublisherQos_entity_factory
511  */
512  struct DDS_EntityFactoryQosPolicy entity_factory;
513 
514  /*i \dref_PublisherQos_management
515  */
516  struct RTI_ManagementQosPolicy management;
517 
518  DDSC_CPP_QOS_METHODS(DDS_PublisherQos)
519 };
520 
521 #ifdef __cplusplus
522 extern "C" {
523 #endif
524 
525 /*ce \dref_PublisherQos_initialize
526  */
527 /* #if INCLUDE_API_QOS */
528 DDSCDllExport DDS_ReturnCode_t
530 
531 /*ce \dref_PublisherQos_copy
532  */
533 DDSCDllExport DDS_ReturnCode_t
535  const struct DDS_PublisherQos *source);
536 
537 /*ci
538  * \brief Compare two DDS_PublisherQos policies for equality
539  *
540  * \param[in] left The left side of the comparison
541  * \param[in] right The right side of the comparison
542  *
543  * \return DDS_BOOLEAN_TRUE if the structures are equal,
544  * DDS_BOOLEAN_FALSE otherwise
545  */
546 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
547 DDS_PublisherQos_is_equal(const struct DDS_PublisherQos *left,
548  const struct DDS_PublisherQos *right);
549 
550 #ifndef RTI_CERT
551 /*ce \dref_PublisherQos_finalize
552  */
553 DDSCDllExport DDS_ReturnCode_t
555 #endif
556 
557 /*ce \dref_PublisherQos_INITIALIZER
558  */
559 #define DDS_PublisherQos_INITIALIZER { \
560  DDS_ENTITY_FACTORY_QOS_POLICY_DEFAULT, \
561  RTI_MANAGEMENT_QOS_POLICY_DEFAULT \
562 }
563 
564 /* ================================================================= */
565 /* Listeners */
566 /* ================================================================= */
567 
568 /*ce \dref_DataWriterListener_OfferedDeadlineMissedCallback
569  */
570 typedef void
572  void *listener_data,
573  DDS_DataWriter* writer,
574  const struct DDS_OfferedDeadlineMissedStatus* status);
575 
576 /* ----------------------------------------------------------------- */
577 /*ce \dref_DataWriterListener_LivelinessLostCallback
578  */
579 typedef void
581  void *listener_data,
582  DDS_DataWriter *writer,
583  const struct DDS_LivelinessLostStatus *status);
584 
585 /* ----------------------------------------------------------------- */
586 /*ce \dref_DataWriterListener_OfferedIncompatibleQosCallback
587  */
588 typedef void
590  void *listener_data,
591  DDS_DataWriter* writer,
592  const struct DDS_OfferedIncompatibleQosStatus *status);
593 
594 /* ----------------------------------------------------------------- */
595 /*ce \dref_DataWriterListener_PublicationMatchedCallback
596  */
598  void *listener_data,
599  DDS_DataWriter *writer,
600  const struct DDS_PublicationMatchedStatus *status);
601 
602 /* ------------------------------------------------------------------------ */
603 /*e \dref_DataWriterListener_ReliableReaderActivityChangedCallback
604  */
605 typedef void
607  void *listener_data,
608  DDS_DataWriter * writer,
609  const struct DDS_ReliableReaderActivityChangedStatus * status);
610 
611 /* ------------------------------------------------------------------------ */
612 /*i \dref_DataWriterListener_ReliableSampleUnacknowledgedCallback
613  */
614 typedef void
615 (*DDS_DataWriterListener_ReliableSampleUnacknowledgedCallback)(
616  void *listener_data,
617  DDS_DataWriter *writer,
618  const struct DDS_ReliableSampleUnacknowledgedStatus *status);
619 
620 /* ----------------------------------------------------------------- */
621 /*ce \dref_DataWriterListener
622  */
624 {
625  /*ce \dref_DataWriterListener_as_listener
626  */
628 
629  /*ce \dref_DataWriterListener_on_offered_deadline_missed
630  */
633 
634  /*ce \dref_DataWriterListener_on_offered_incompatible_qos
635  */
638 
639  /*ce \dref_DataWriterListener_on_liveliness_lost
640  */
642 
643  /*ce \dref_DataWriterListener_on_publication_matched
644  */
647 
648  /*e \dref_DataWriterListener_on_reliable_reader_activity_changed
649  */
652 
653  /*i \dref_DataWriterListener_on_reliable_sample_unacknowledged
654  */
655  DDS_DataWriterListener_ReliableSampleUnacknowledgedCallback
656  on_reliable_sample_unacknowledged;
657 };
658 
659 /*ce \dref_DataWriterListener_INITIALIZER
660  */
661 #define DDS_DataWriterListener_INITIALIZER { \
662  DDS_Listener_INITIALIZER, \
663  (DDS_DataWriterListener_OfferedDeadlineMissedCallback)NULL, \
664  (DDS_DataWriterListener_OfferedIncompatibleQosCallback)NULL, \
665  (DDS_DataWriterListener_LivelinessLostCallback)NULL, \
666  (DDS_DataWriterListener_PublicationMatchedCallback)NULL,\
667  NULL,\
668  NULL\
669 }
670 
671 /* ----------------------------------------------------------------- */
672 /*ce \dref_PublisherListener
673  */
675 {
676  /*ce \dref_PublisherListener_as_datawriterlistener
677  */
679 };
680 
681 /*ce \dref_PublisherListener_INITIALIZER
682  */
683 #define DDS_PublisherListener_INITIALIZER { \
684  DDS_DataWriterListener_INITIALIZER }
685 
686 /* ================================================================= */
687 /* Publisher */
688 /* ================================================================= */
689 
690 /* ----------------------------------------------------------------- */
691 
692 /*e \dref_DATAWRITER_QOS_DEFAULT
693  */
694 extern DDSCDllVariable const struct DDS_DataWriterQos
696 
697 /* ----------------------------------------------------------------- */
698 #define DDS_Publisher_as_entity(publisherPtr) \
699  ((DDS_Entity*) publisherPtr)
700 
701 #ifdef DOXYGEN_DOCUMENTATION_ONLY
702 /*ce \dref_Publisher_as_entity
703  */
705 #endif /*DOXYGEN_DOCUMENTATION_ONLY */
706 
707 /* ----------------------------------------------------------------- */
708 #if INCLUDE_API_QOS
709 /*ce \dref_Publisher_get_default_datawriter_qos
710  */
711 DDSCDllExport DDS_ReturnCode_t
713  DDS_Publisher *self,
714  struct DDS_DataWriterQos *qos);
715 
716 /* ----------------------------------------------------------------- */
717 /* #if INCLUDE_API_QOS */
718 /*ce \dref_Publisher_set_default_datawriter_qos
719  */
720 DDSCDllExport DDS_ReturnCode_t
722  DDS_Publisher *self,
723  const struct DDS_DataWriterQos *qos);
724 #endif
725 /* ----------------------------------------------------------------- */
726 /*ce \dref_Publisher_create_datawriter
727  */
728 DDSCDllExport DDS_DataWriter*
730  DDS_Publisher *self,
731  DDS_Topic *topic,
732  const struct DDS_DataWriterQos *qos,
733  const struct DDS_DataWriterListener *listener,
734  DDS_StatusMask mask);
735 
736 /* ----------------------------------------------------------------- */
737 /*ce \dref_Publisher_enable
738  */
739 DDSCDllExport DDS_ReturnCode_t
741 
742 /* ----------------------------------------------------------------- */
743 #ifndef RTI_CERT
744 /*ce \dref_Publisher_delete_datawriter
745  */
746 DDSCDllExport DDS_ReturnCode_t
748  DDS_Publisher *self,
749  DDS_DataWriter *a_datawriter);
750 #endif
751 
752 /* ----------------------------------------------------------------- */
753 /*ce \dref_Publisher_lookup_datawriter
754  */
755 /* #if INCLUDE_API_LOOKUP || RTI_CERT */
756 DDSCDllExport DDS_DataWriter*
758  DDS_Publisher *self,
759  const char *topic_name);
760 
761 /* ----------------------------------------------------------------- */
762 /*ce \dref_Publisher_get_participant
763  */
764 DDSCDllExport DDS_DomainParticipant*
766 
767 /* ----------------------------------------------------------------- */
768 
769 #ifndef RTI_CERT
770 /*ce \dref_Publisher_delete_contained_entities
771  */
772 DDSCDllExport DDS_ReturnCode_t
774 #endif
775 
776 /* ----------------------------------------------------------------- */
777 #if INCLUDE_API_QOS
778 /*ce \dref_Publisher_set_qos
779  */
780 DDSCDllExport DDS_ReturnCode_t
782  DDS_Publisher *self,
783  const struct DDS_PublisherQos *qos);
784 
785 /* ----------------------------------------------------------------- */
786 /*ce \dref_Publisher_get_qos
787  */
788 DDSCDllExport DDS_ReturnCode_t
790  DDS_Publisher *self,
791  struct DDS_PublisherQos *qos);
792 #endif
793 
794 /* ----------------------------------------------------------------- */
795 #ifndef RTI_CERT
796 /*ce \dref_Publisher_set_listener
797  */
798 /* called internally by Pub_new() */
799 DDSCDllExport DDS_ReturnCode_t
801  DDS_Publisher * self,
802  const struct DDS_PublisherListener *l,
803  DDS_StatusMask mask);
804 #endif
805 
806 #ifndef RTI_CERT
807 /*ce \dref_Publisher_get_listener
808  */
809 DDSCDllExport struct DDS_PublisherListener
811 #endif
812 
813 /* ================================================================= */
814 /* Data Writer */
815 /* ================================================================= */
816 
817 /* ----------------------------------------------------------------- */
818 #define DDS_DataWriter_as_entity(dataWriterPtr) \
819  ((DDS_Entity*) dataWriterPtr)
820 
821 #ifdef DOXYGEN_DOCUMENTATION_ONLY
822 /*ce \dref_DataWriter_as_entity
823  */
825 #endif /*DOXYGEN_DOCUMENTATION_ONLY */
826 
827 /* ----------------------------------------------------------------- */
828 /*ce \dref_DataWriter_enable
829 */
830 DDSCDllExport DDS_ReturnCode_t
832 
833 /*ce \dref_DataWriter_assert_liveliness
834  */
835 DDSCDllExport DDS_ReturnCode_t
837 
838 /* ----------------------------------------------------------------- */
839 #if INCLUDE_API_LOOKUP
840 /*ce \dref_DataWriter_get_matched_subscriptions
841  */
842 DDSCDllExport DDS_ReturnCode_t
844  DDS_DataWriter *self,
845  struct DDS_InstanceHandleSeq *subscription_handles);
846 #endif /* INCLUDE_API_LOOKUP */
847 
849 
850 /* ----------------------------------------------------------------- */
851 #if INCLUDE_API_LOOKUP
852 /*ce \dref_DataWriter_get_matched_subscription_data
853  */
854 DDSCDllExport DDS_ReturnCode_t
856  DDS_DataWriter *self,
857  struct DDS_SubscriptionBuiltinTopicData *subscription_data,
858  const DDS_InstanceHandle_t *subscription_handle);
859 #endif /* INCLUDE_API_LOOKUP */
860 
861 /* ----------------------------------------------------------------- */
862 /*ce \dref_DataWriter_get_topic
863  */
864 DDSCDllExport DDS_Topic*
866 
867 /* ----------------------------------------------------------------- */
868 /*ce \dref_DataWriter_get_publisher
869  */
870 DDSCDllExport DDS_Publisher*
872 
873 /* ----------------------------------------------------------------- */
874 /*ce \dref_DataWriter_get_liveliness_lost_status
875  */
876 DDSCDllExport DDS_ReturnCode_t
878  DDS_DataWriter *self,
879  struct DDS_LivelinessLostStatus *status);
880 
881 /* ----------------------------------------------------------------- */
882 /*ce \dref_DataWriter_get_offered_deadline_missed_status
883  */
884 DDSCDllExport DDS_ReturnCode_t
886  DDS_DataWriter *self,
887  struct DDS_OfferedDeadlineMissedStatus *status);
888 
889 /* ----------------------------------------------------------------- */
890 /*ce \dref_DataWriter_get_offered_incompatible_qos_status
891  */
892 DDSCDllExport DDS_ReturnCode_t
894  DDS_DataWriter *self,
895  struct DDS_OfferedIncompatibleQosStatus *status);
896 
897 /* ----------------------------------------------------------------- */
898 /*ce \dref_DataWriter_get_publication_matched_status
899  */
900 DDSCDllExport DDS_ReturnCode_t
902  DDS_DataWriter *self,
903  struct DDS_PublicationMatchedStatus *status);
904 
905 /* ------------------------------------------------------------------------ */
906 /*e \dref_DataWriter_get_reliable_reader_activity_changed_status
907  */
908 DDSCDllExport DDS_ReturnCode_t
910  DDS_DataWriter *self,
912 
913 /* ----------------------------------------------------------------- */
914 /*ci
915  * \brief Get a pointer to the DataWriter's Qos policy
916  *
917  * \details
918  * NOTE: It is up to the caller to ensure the datawriter is not deleted while
919  * the Qos is being accessed.
920  *
921  * \return Pointer to DDS_DataWriterQos*
922  */
923 DDSCDllExport struct DDS_DataWriterQos*
924 DDS_DataWriter_get_qos_ref(DDS_DataWriter *self);
925 
926 #if INCLUDE_API_QOS
927 /*ce \dref_DataWriter_set_qos
928  */
929 DDSCDllExport DDS_ReturnCode_t
931  DDS_DataWriter *self,
932  const struct DDS_DataWriterQos *qos);
933 
934 
935 /* ----------------------------------------------------------------- */
936 /*ce \dref_DataWriter_get_qos
937  */
938 DDSCDllExport DDS_ReturnCode_t
940  struct DDS_DataWriterQos *qos);
941 #endif
942 
943 /* ----------------------------------------------------------------- */
944 #ifndef RTI_CERT
945 /*ce \dref_DataWriter_set_listener
946  */
947 DDSCDllExport DDS_ReturnCode_t
949  DDS_DataWriter * self,
950  const struct DDS_DataWriterListener *l,
951  DDS_StatusMask mask);
952 #endif
953 
954 #ifndef RTI_CERT
955 /*ce \dref_DataWriter_get_listener
956  */
957 DDSCDllExport struct DDS_DataWriterListener
959 #endif
960 
961 /********************* Untyped Writer API ****************************/
962 /*e \dref_DataWriter_register_instance
963  */
964 DDSCDllExport DDS_InstanceHandle_t
966  DDS_DataWriter * self,
967  const void *instance_data);
968 
969 /*e \dref_DataWriter_register_instance_w_timestamp
970  */
971 DDSCDllExport DDS_InstanceHandle_t
973  DDS_DataWriter * self,
974  const void *instance_data,
975  const struct DDS_Time_t *source_timestamp);
976 
977 /*ce \dref_DataWriter_unregister_instance
978  */
979 DDSCDllExport DDS_ReturnCode_t
981  DDS_DataWriter *self,
982  const void *instance_data,
983  const DDS_InstanceHandle_t *handle);
984 
985 /*ce \dref_DataWriter_unregister_instance_w_timestamp
986  */
987 DDSCDllExport DDS_ReturnCode_t
989  DDS_DataWriter *self,
990  const void *instance_data,
991  const DDS_InstanceHandle_t *handle,
992  const struct DDS_Time_t *source_timestamp);
993 
994 /*ce \dref_DataWriter_dispose
995  */
996 DDSCDllExport DDS_ReturnCode_t
998  DDS_DataWriter *self,
999  const void *instance_data,
1000  const DDS_InstanceHandle_t *handle);
1001 
1002 /*ce \dref_DataWriter_dispose_w_timestamp
1003  */
1004 DDSCDllExport DDS_ReturnCode_t
1006  DDS_DataWriter *self,
1007  const void *instance_data,
1008  const DDS_InstanceHandle_t *handle,
1009  const struct DDS_Time_t *source_timestamp);
1010 
1011 /*ce \dref_DataWriter_write
1012  */
1013 DDSCDllExport DDS_ReturnCode_t
1015  DDS_DataWriter *self,
1016  const void *instance_data,
1017  const DDS_InstanceHandle_t * handle);
1018 
1019 /*ce \dref_DataWriter_write_w_timestamp
1020  */
1021 DDSCDllExport DDS_ReturnCode_t
1023  DDS_DataWriter *self,
1024  const void *instance_data,
1025  const DDS_InstanceHandle_t *handle,
1026  const struct DDS_Time_t *source_timestamp);
1027 
1028 /*ce \dref_DataWriter_write_w_params
1029  */
1030 DDSCDllExport DDS_ReturnCode_t
1032  DDS_DataWriter *self,
1033  const void *instance_data,
1034  struct DDS_WriteParams_t *params);
1035 
1036 /*i \dref_DataWriteR_get_liveliness_count
1037  */
1038 DDSCDllExport DDS_Long
1039 DDS_DataWriter_get_liveliness_count(DDS_DataWriter * self);
1040 
1041 /*i \dref_DataWriter_assert_key
1042  */
1043 DDSCDllExport DDS_ReturnCode_t
1044 DDS_DataWriter_assert_instance(DDS_DataWriter *datawriter,
1045  DDS_InstanceHandle_t *handle);
1046 
1047 /*i \dref_DataWriter_delete_key
1048  */
1049 DDSCDllExport DDS_ReturnCode_t
1050 DDS_DataWriter_remove_instance(DDS_DataWriter *datawriter,
1051  DDS_InstanceHandle_t *handle);
1052 
1053 /****************** Additional Internal APIs **************************/
1054 
1055 /*ci
1056  * \brief Increment the sequence number the datawriter is using for samples
1057  *
1058  * \details
1059  * An anonymous datawriter does not increment the sequence number on each
1060  * send. Instead the application using this datawriter must increment the
1061  * sequence number. When a datareader receives a sequence number it has
1062  * already seen it drops the samples. Thus, this function enables an
1063  * application to determine when the content of a sample has changed and
1064  * should be processed by a datareader by incrementing the sequence number.
1065  * This is typically used as part of participant discovery to prevent known
1066  * remote participants from processing known information, while sending the
1067  * same sample to newly discovered remote participants.
1068  *
1069  * \param[in] self Datawriter to increment the sequence number on
1070  *
1071  * \return DDS_RETCODE_OK on success, one the the standard return codes on
1072  * failure
1073  */
1074 MUST_CHECK_RETURN DDSCDllExport DDS_ReturnCode_t
1075 DDS_DataWriter_advance_sn(DDS_DataWriter *self);
1076 
1077 /*ci
1078  * \brief Add a new peer to a DDS participant
1079  *
1080  * \details
1081  * The peers for a participant is usually specified in the initial peer
1082  * list in the participant Qos policy. This function lets an application
1083  * add additional peers.
1084  *
1085  * \param[in] datawriter Datawriter to add the peer to
1086  * \param[in] dst_reader The peer datareader to send data to
1087  * \param[in] address The address of the peer datareader in NETIO address
1088  * string format
1089  *
1090  * \return DDS_BOOLEAN_TRUE on success, DDS_BOOLEAN_FALSE on failure
1091  */
1092 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1093 DDS_DataWriter_add_anonymous_peer(DDS_DataWriter *datawriter,
1094  struct NETIO_Address *dst_reader,
1095  const char *address);
1096 
1097 #ifndef RTI_CERT
1098 /*ci
1099  * \brief Remove a peer from a DDS participant
1100  *
1101  * \details
1102  * The peers for a participant is usually specified in the initial peer
1103  * list in the participant Qos policy. This function lets an application
1104  * remove a peer.
1105  *
1106  * \param[in] datawriter Datawriter to remote the peer from
1107  * \param[in] dst_reader The peer datareader to remove
1108  * \param[in] address The address of the peer datareader in NETIO address
1109  * string format
1110  *
1111  * \return DDS_BOOLEAN_TRUE on success, DDS_BOOLEAN_FALSE on failure
1112  */
1113 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1114 DDS_DataWriter_delete_anonymous_peer(DDS_DataWriter *datawriter,
1115  struct NETIO_Address *dst_reader,
1116  const char *address);
1117 #endif /* !RTI_CERT */
1118 /*
1119  * \brief Add an anonymous route to a DDS DataReader
1120  *
1121  * \details
1122  * This function adds an anonymous route to a DataWriter. An anonymous
1123  * route is a route with no state information and is typically used
1124  * by a DDS participant to send to discovery traffic to other
1125  * participants in a domain.
1126  *
1127  * \param[in] self The datawriter to add the route to
1128  * \param[in] dst_reader The peer reader to listen to
1129  * \param[in] via_address The address to send data on
1130  *
1131  * \return DDS_BOOLEAN_TRUE on success, DDS_BOOLEAN_FALSE on failure
1132  */
1133 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1134 DDS_DataWriter_add_anonymous_route(DDS_DataWriter *datawriter,
1135  struct NETIO_Address *dst_reader,
1136  struct NETIO_Address *via_address);
1137 
1138 #ifndef RTI_CERT
1139 /*ci
1140  * \brief Remove an anonymous route from a DDS DataWriter
1141  *
1142  * \details
1143  * This function removes an anonymous route from a DataWriter. An anonymous
1144  * route is a route with no state information and is typically used
1145  * by a DDS participant to send discovery traffic to other
1146  * participants in a domain. This function stops sending traffic
1147  * to a particular address.
1148  *
1149  * \param[in] self The datareader to remove the route from
1150  * \param[in] src_writer The peer writer to stop listening to
1151  * \param[in] from_address The address to stop listening on
1152  *
1153  * \return DDS_BOOLEAN_TRUE on success, DDS_BOOLEAN_FALSE on failure
1154  */
1155 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1156 DDS_DataWriter_delete_anonymous_route(DDS_DataWriter *datawriter,
1157  struct NETIO_Address *dst_reader,
1158  struct NETIO_Address *via_address);
1159 #endif
1160 
1161 /*ci
1162  * \brief Check if a route exists from a datawriter to a datareader
1163  *
1164  * \details
1165  * Check if a route exists from a datawriter to a datareader using any of
1166  * the locators passed in. Note that there is an implicit assumption that
1167  * the protocol stack is DDS<->RTPS<->"transport" where transport can be
1168  * any NETIO_Interface compliant layer.
1169  *
1170  * \param[in] src_writer Source data-writer
1171  * \param[in] dst_reader Destination data-reader
1172  * \param[in] loc_seq Sequence of addresses the data-reader is located at
1173  *
1174  * \return DDS_BOOLEAN_TRUE if a path exists, DDS_BOOLEAN is no
1175  */
1176 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1177 DDS_DataWriter_lookup_route(DDS_DataWriter *src_writer,
1178  struct NETIO_Address *dst_reader,
1179  const struct DDS_LocatorSeq *loc_seq);
1180 
1181 struct DDS_DataReaderQos;
1182 
1183 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1184 DDS_DataWriter_add_route(DDS_DataWriter *datawriter,
1185  const DDS_BuiltinTopicKey_t *key,
1186  const struct DDS_DataReaderQos *const qos,
1187  const struct DDS_LocatorSeq *uc_locator,
1188  const struct DDS_LocatorSeq *mc_locator,
1189  RTI_BOOL *route_existed);
1190 
1191 MUST_CHECK_RETURN DDSCDllExport DDS_Boolean
1192 DDS_DataWriter_delete_route(DDS_DataWriter *datawriter,
1193  const DDS_BuiltinTopicKey_t *key,
1194  const struct DDS_LocatorSeq *uc_locator,
1195  const struct DDS_LocatorSeq *mc_locator,
1196  RTI_BOOL *route_existed);
1197 
1198 /* ----------------------------------------------------------------- */
1199 
1200 #ifdef __cplusplus
1201 } /* extern "C" */
1202 #endif
1203 
1204 #ifndef dds_c_w_history_plugin_h
1205 #include "dds_c/dds_c_wh_plugin.h"
1206 #endif
1207 
1208 
1209 #endif /* dds_c_publication_h */

RTI Connext DDS Micro Version 2.4.10 Copyright © Fri Jun 30 2017 Real-Time Innovations, Inc