31 #ifndef dds_c_rh_plugin_h
32 #define dds_c_rh_plugin_h
38 #ifndef dds_c_discovery_h
55 DDSHST_READEREVENT_KIND_LIVELINESS_LOST = 1,
60 DDSHST_READEREVENT_KIND_LIVELINESS_DETECTED,
65 DDSHST_READEREVENT_KIND_REMOTE_WRITER_DELETED,
70 DDSHST_READEREVENT_KIND_DEADLINE_EXPIRED
71 } DDSHST_ReaderEventKind_T;
76 struct DDSHST_ReaderEvent
81 DDSHST_ReaderEventKind_T kind;
125 struct RT_Component _parent;
128 typedef struct DDSHST_Reader DDSHST_Reader_T;
130 struct DDSHST_ReaderSampleEntry;
136 typedef struct DDSHST_ReaderSampleEntry* DDSHST_ReaderSampleEntryRef_T;
138 struct DDSHST_ReaderKeyEntry;
144 typedef struct DDSHST_ReaderKeyEntry* DDSHST_ReaderKeyEntryRef_T;
149 typedef struct DDSHST_ReaderSample
178 DDSHST_ReaderSampleEntryRef_T _ref;
179 } DDSHST_ReaderSample_T;
181 #define T DDSHST_ReaderSample_T
182 #define TSeq DDSHST_ReaderSample_TSeq
183 #include <reda/reda_sequence_decl.h>
188 struct DDSHST_ReaderProperty
193 struct RT_ComponentProperty _parent;
211 #define DDSHST_ReaderProperty_INITIALIZER \
213 RT_ComponentProperty_INITIALIZER,\
231 (*DDSHST_ReaderListener_OnSampleRemovedFunc)(
232 struct DDSHST_Reader *rh,
235 DDSHST_ReaderSample_T *sample);
249 (*DDSHST_ReaderListener_OnKeyRemovedFunc)(
250 struct DDSHST_Reader *rh,
266 (*DDSHST_ReaderListener_OnDeadlineMissedFunc)(
267 struct DDSHST_Reader *rh,
284 (*DDSHST_ReaderListener_OnDataAvailableFunc)(
285 struct DDSHST_Reader *rh,
288 DDSHST_ReaderSample_T *sample);
303 (*DDSHST_ReaderListener_OnSampleRejectedFunc)(
304 struct DDSHST_Reader *rh,
320 (*DDSHST_ReaderListener_OnSampleLostFunc)(
321 struct DDSHST_Reader *rh,
342 (*DDSHST_ReaderListener_OnInstanceReplacedFunc)(
343 struct DDSHST_Reader *rh,
353 struct DDSHST_ReaderListener
358 struct RT_ComponentListener _parent;
363 DDSHST_ReaderListener_OnSampleRemovedFunc on_sample_removed;
368 DDSHST_ReaderListener_OnKeyRemovedFunc on_key_removed;
373 DDSHST_ReaderListener_OnDataAvailableFunc on_data_available;
378 DDSHST_ReaderListener_OnDeadlineMissedFunc on_deadline_missed;
383 DDSHST_ReaderListener_OnSampleRejectedFunc on_sample_rejected;
388 DDSHST_ReaderListener_OnSampleLostFunc on_sample_lost;
393 DDSHST_ReaderListener_OnInstanceReplacedFunc on_instance_replaced;
404 #define DDSHST_ReaderListener_INITIALIZE {\
405 RT_ComponentListener_INITIALIZER,\
425 (*DDSHST_Reader_deleteFunc)(
struct DDSHST_Reader *
self);
437 FUNCTION_MUST_TYPEDEF(
438 struct DDSHST_Reader*
439 (*DDSHST_Reader_createFunc)(
440 const struct DDSHST_ReaderProperty *
const property,
441 const struct DDSHST_ReaderListener *
const listener)
462 FUNCTION_MUST_TYPEDEF(
463 DDSHST_ReaderSampleEntryRef_T
464 (*DDSHST_Reader_reserve_entryFunc)(
465 struct DDSHST_Reader *
self,
470 struct REDA_SequenceNumber *sample_sn,
483 (*DDSHST_Reader_return_entryFunc)(
484 struct DDSHST_Reader *
self,
485 DDSHST_ReaderSampleEntryRef_T entry);
500 FUNCTION_MUST_TYPEDEF(
502 (*DDSHST_Reader_commitFunc)(
503 struct DDSHST_Reader *
self,
505 struct REDA_SequenceNumber *sn,
519 FUNCTION_MUST_TYPEDEF(
521 (*DDSHST_Reader_add_and_commitFunc)(
522 struct DDSHST_Reader *rh,
523 DDSHST_ReaderSampleEntryRef_T entry,
524 DDSHST_ReaderSample_T *sample,
525 struct REDA_SequenceNumber *commit_sn)
538 (*DDSHST_Reader_post_eventFunc)(
539 struct DDSHST_Reader *
self,
540 struct DDSHST_ReaderEvent *event,
564 FUNCTION_MUST_TYPEDEF(
566 (*DDSHST_Reader_read_or_takeFunc)(
567 struct DDSHST_Reader *
self,
568 void ***sample_ptr_array,
593 FUNCTION_MUST_TYPEDEF(
595 (*DDSHST_Reader_finish_read_or_takeFunc)(
596 struct DDSHST_Reader *
self,
597 void ***sample_ptr_array,
613 FUNCTION_MUST_TYPEDEF(
614 DDSHST_ReaderKeyEntryRef_T
615 (*DDSHST_Reader_lookup_keyFunc)(
struct DDSHST_Reader*
self,
622 struct DDSHST_ReaderI
627 struct RT_ComponentI _parent;
632 DDSHST_Reader_return_entryFunc return_entry;
637 DDSHST_Reader_read_or_takeFunc read_or_take;
642 DDSHST_Reader_finish_read_or_takeFunc finish_read_or_take;
647 DDSHST_Reader_post_eventFunc post_event;
652 DDSHST_Reader_lookup_keyFunc lookup_key;
657 DDSHST_Reader_reserve_entryFunc reserve_entry;
663 DDSHST_Reader_add_and_commitFunc add_and_commit;
668 DDSHST_Reader_commitFunc commit;
674 #define DDSHST_ReaderFactory_create_component(f_,p_,l_) \
675 (struct DDSHST_Reader*)((f_)->intf)->create_component(f_,p_,l_)
680 #define DDSHST_ReaderFactory_delete_component(f_,c_) \
681 ((f_)->intf)->delete_component(f_,(RT_Component_T*)(c_))
705 #define DDSHST_Reader_reserve_entry(self_,rw_,key_,si_,strength_,\
706 sample_sn_,reject_reason_) \
707 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->reserve_entry(\
708 self_,rw_,key_,si_,strength_,\
709 sample_sn_,reject_reason_)
723 #define DDSHST_Reader_return_entry(self_,entry_) \
724 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->return_entry(\
744 #define DDSHST_Reader_add_and_commit(self_,entry_,sample_,sn_) \
745 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->add_and_commit(\
746 self_,entry_,sample_,sn_)
766 #define DDSHST_Reader_commit(self_,rw_,sn_,s_) \
767 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->commit(\
796 #define DDSHST_Reader_read_or_take(self_,\
797 sample_arr_,info_arr_,count_,handle_,max_samples_,sample_states_,view_states_,\
798 instance_states_,take_) \
799 ((struct DDSHST_ReaderI*)(\
800 (self_)->_parent._intf))->read_or_take(self_,\
801 sample_arr_,info_arr_,count_,handle_,max_samples_,\
802 sample_states_,view_states_,instance_states_,take_)
818 #define DDSHST_Reader_finish_read_or_take(self_,sample_seq_,info_seq_,count_,take_) \
819 ((struct DDSHST_ReaderI*)(\
820 (self_)->_parent._intf))->finish_read_or_take(self_,\
821 sample_seq_,info_seq_,count_,take_)
834 #define DDSHST_Reader_post_event(self_,event_,time_) \
835 ((struct DDSHST_ReaderI*)(\
836 (self_)->_parent._intf))->post_event(self_,event_,time_)
846 #define DDSHST_Reader_lookup_key(self_,key_) \
847 ((struct DDSHST_ReaderI*)(\
848 (self_)->_parent._intf))->lookup_key(self_,key_)