33 #ifndef dds_c_rh_plugin_h
34 #define dds_c_rh_plugin_h
40 #ifndef dds_c_discovery_h
62 DDSHST_READEREVENT_KIND_LIVELINESS_LOST = 1,
67 DDSHST_READEREVENT_KIND_LIVELINESS_DETECTED,
72 DDSHST_READEREVENT_KIND_REMOTE_WRITER_DELETED,
77 DDSHST_READEREVENT_KIND_DEADLINE_EXPIRED
78 } DDSHST_ReaderEventKind_T;
83 struct DDSHST_ReaderEvent
88 DDSHST_ReaderEventKind_T kind;
132 struct RT_Component _parent;
135 typedef struct DDSHST_Reader DDSHST_Reader_T;
137 struct DDSHST_ReaderSampleEntry;
143 typedef struct DDSHST_ReaderSampleEntry* DDSHST_ReaderSampleEntryRef_T;
145 struct DDSHST_ReaderKeyEntry;
151 typedef struct DDSHST_ReaderKeyEntry* DDSHST_ReaderKeyEntryRef_T;
156 typedef struct DDSHST_ReaderSample
185 DDSHST_ReaderSampleEntryRef_T _ref;
186 } DDSHST_ReaderSample_T;
188 #define T DDSHST_ReaderSample_T
189 #define TSeq DDSHST_ReaderSample_TSeq
190 #include <reda/reda_sequence_decl.h>
195 struct DDSHST_ReaderProperty
200 struct RT_ComponentProperty _parent;
218 #define DDSHST_ReaderProperty_INITIALIZER \
220 RT_ComponentProperty_INITIALIZER,\
238 (*DDSHST_ReaderListener_OnSampleRemovedFunc)(
239 struct DDSHST_Reader *rh,
242 DDSHST_ReaderSample_T *sample);
256 (*DDSHST_ReaderListener_OnKeyRemovedFunc)(
257 struct DDSHST_Reader *rh,
273 (*DDSHST_ReaderListener_OnDeadlineMissedFunc)(
274 struct DDSHST_Reader *rh,
291 (*DDSHST_ReaderListener_OnDataAvailableFunc)(
292 struct DDSHST_Reader *rh,
295 DDSHST_ReaderSample_T *sample);
310 (*DDSHST_ReaderListener_OnSampleRejectedFunc)(
311 struct DDSHST_Reader *rh,
331 (*DDSHST_ReaderListener_OnSampleLostFunc)(
332 struct DDSHST_Reader *rh,
353 (*DDSHST_ReaderListener_OnInstanceReplacedFunc)(
354 struct DDSHST_Reader *rh,
364 struct DDSHST_ReaderListener
369 struct RT_ComponentListener _parent;
374 DDSHST_ReaderListener_OnSampleRemovedFunc on_sample_removed;
379 DDSHST_ReaderListener_OnKeyRemovedFunc on_key_removed;
384 DDSHST_ReaderListener_OnDataAvailableFunc on_data_available;
389 DDSHST_ReaderListener_OnDeadlineMissedFunc on_deadline_missed;
394 DDSHST_ReaderListener_OnSampleRejectedFunc on_sample_rejected;
399 DDSHST_ReaderListener_OnSampleLostFunc on_sample_lost;
404 DDSHST_ReaderListener_OnInstanceReplacedFunc on_instance_replaced;
415 #define DDSHST_ReaderListener_INITIALIZE {\
416 RT_ComponentListener_INITIALIZER,\
436 (*DDSHST_Reader_deleteFunc)(
struct DDSHST_Reader *
self);
448 FUNCTION_MUST_TYPEDEF(
449 struct DDSHST_Reader*
450 (*DDSHST_Reader_createFunc)(
const struct DDSHST_ReaderProperty *
const property,
451 const struct DDSHST_ReaderListener *
const listener)
472 FUNCTION_MUST_TYPEDEF(
473 DDSHST_ReaderSampleEntryRef_T
474 (*DDSHST_Reader_reserve_entryFunc)(
475 struct DDSHST_Reader *
self,
480 struct REDA_SequenceNumber *sample_sn,
493 (*DDSHST_Reader_return_entryFunc)(
struct DDSHST_Reader *
self,
494 DDSHST_ReaderSampleEntryRef_T entry);
509 FUNCTION_MUST_TYPEDEF(
511 (*DDSHST_Reader_commitFunc)(
struct DDSHST_Reader *
self,
513 struct REDA_SequenceNumber *sn,
527 FUNCTION_MUST_TYPEDEF(
529 (*DDSHST_Reader_add_and_commitFunc)(
struct DDSHST_Reader *rh,
530 DDSHST_ReaderSampleEntryRef_T entry,
531 DDSHST_ReaderSample_T *sample,
532 struct REDA_SequenceNumber *commit_sn)
545 (*DDSHST_Reader_post_eventFunc)(
struct DDSHST_Reader *
self,
546 struct DDSHST_ReaderEvent *event,
570 FUNCTION_MUST_TYPEDEF(
572 (*DDSHST_Reader_read_or_takeFunc)(
struct DDSHST_Reader *
self,
573 void ***sample_ptr_array,
598 FUNCTION_MUST_TYPEDEF(
600 (*DDSHST_Reader_finish_read_or_takeFunc)(
struct DDSHST_Reader *
self,
601 void ***sample_ptr_array,
617 FUNCTION_MUST_TYPEDEF(
618 DDSHST_ReaderKeyEntryRef_T
619 (*DDSHST_Reader_lookup_keyFunc)(
struct DDSHST_Reader*
self,
626 struct DDSHST_ReaderI
631 struct RT_ComponentI _parent;
636 DDSHST_Reader_return_entryFunc return_entry;
641 DDSHST_Reader_read_or_takeFunc read_or_take;
646 DDSHST_Reader_finish_read_or_takeFunc finish_read_or_take;
651 DDSHST_Reader_post_eventFunc post_event;
656 DDSHST_Reader_lookup_keyFunc lookup_key;
661 DDSHST_Reader_reserve_entryFunc reserve_entry;
667 DDSHST_Reader_add_and_commitFunc add_and_commit;
672 DDSHST_Reader_commitFunc commit;
678 #define DDSHST_ReaderFactory_create_component(f_,p_,l_) \
679 (struct DDSHST_Reader*)((f_)->intf)->create_component(f_,p_,l_)
684 #define DDSHST_ReaderFactory_delete_component(f_,c_) \
685 ((f_)->intf)->delete_component(f_,(RT_Component_T*)(c_))
709 #define DDSHST_Reader_reserve_entry(self_,rw_,key_,si_,strength_,\
710 sample_sn_,reject_reason_) \
711 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->reserve_entry(\
712 self_,rw_,key_,si_,strength_,\
713 sample_sn_,reject_reason_)
727 #define DDSHST_Reader_return_entry(self_,entry_) \
728 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->return_entry(\
748 #define DDSHST_Reader_add_and_commit(self_,entry_,sample_,sn_) \
749 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->add_and_commit(\
750 self_,entry_,sample_,sn_)
769 #define DDSHST_Reader_commit(self_,rw_,sn_,s_) \
770 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->commit(\
799 #define DDSHST_Reader_read_or_take(self_,\
800 sample_arr_,info_arr_,count_,handle_,max_samples_,sample_states_,view_states_,\
801 instance_states_,take_) \
802 ((struct DDSHST_ReaderI*)(\
803 (self_)->_parent._intf))->read_or_take(self_,\
804 sample_arr_,info_arr_,count_,handle_,max_samples_,\
805 sample_states_,view_states_,instance_states_,take_)
822 #define DDSHST_Reader_finish_read_or_take(self_,sample_seq_,info_seq_,count_,take_) \
823 ((struct DDSHST_ReaderI*)(\
824 (self_)->_parent._intf))->finish_read_or_take(self_,\
825 sample_seq_,info_seq_,count_,take_)
838 #define DDSHST_Reader_post_event(self_,event_,time_) \
839 ((struct DDSHST_ReaderI*)(\
840 (self_)->_parent._intf))->post_event(self_,event_,time_)
850 #define DDSHST_Reader_lookup_key(self_,key_) \
851 ((struct DDSHST_ReaderI*)(\
852 (self_)->_parent._intf))->lookup_key(self_,key_)