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 DDS_SEQUENCE(DDSHST_ReaderSample_TSeq, DDSHST_ReaderSample_T)
186 struct DDSHST_ReaderProperty
191 struct RT_ComponentProperty _parent;
209 #define DDSHST_ReaderProperty_INITIALIZER \
211 RT_ComponentProperty_INITIALIZER,\
229 (*DDSHST_ReaderListener_OnSampleRemovedFunc)(
230 struct DDSHST_Reader *rh,
233 DDSHST_ReaderSample_T *sample);
247 (*DDSHST_ReaderListener_OnKeyRemovedFunc)(
248 struct DDSHST_Reader *rh,
264 (*DDSHST_ReaderListener_OnDeadlineMissedFunc)(
265 struct DDSHST_Reader *rh,
282 (*DDSHST_ReaderListener_OnDataAvailableFunc)(
283 struct DDSHST_Reader *rh,
286 DDSHST_ReaderSample_T *sample);
301 (*DDSHST_ReaderListener_OnSampleRejectedFunc)(
302 struct DDSHST_Reader *rh,
318 (*DDSHST_ReaderListener_OnSampleLostFunc)(
319 struct DDSHST_Reader *rh,
340 (*DDSHST_ReaderListener_OnInstanceReplacedFunc)(
341 struct DDSHST_Reader *rh,
351 struct DDSHST_ReaderListener
356 struct RT_ComponentListener _parent;
361 DDSHST_ReaderListener_OnSampleRemovedFunc on_sample_removed;
366 DDSHST_ReaderListener_OnKeyRemovedFunc on_key_removed;
371 DDSHST_ReaderListener_OnDataAvailableFunc on_data_available;
376 DDSHST_ReaderListener_OnDeadlineMissedFunc on_deadline_missed;
381 DDSHST_ReaderListener_OnSampleRejectedFunc on_sample_rejected;
386 DDSHST_ReaderListener_OnSampleLostFunc on_sample_lost;
391 DDSHST_ReaderListener_OnInstanceReplacedFunc on_instance_replaced;
402 #define DDSHST_ReaderListener_INITIALIZE {\
403 RT_ComponentListener_INITIALIZER,\
423 (*DDSHST_Reader_deleteFunc)(
struct DDSHST_Reader *
self);
435 FUNCTION_MUST_TYPEDEF(
436 struct DDSHST_Reader*
437 (*DDSHST_Reader_createFunc)(
438 const struct DDSHST_ReaderProperty *
const property,
439 const struct DDSHST_ReaderListener *
const listener)
460 FUNCTION_MUST_TYPEDEF(
461 DDSHST_ReaderSampleEntryRef_T
462 (*DDSHST_Reader_reserve_entryFunc)(
463 struct DDSHST_Reader *
self,
468 struct REDA_SequenceNumber *sample_sn,
481 (*DDSHST_Reader_return_entryFunc)(
482 struct DDSHST_Reader *
self,
483 DDSHST_ReaderSampleEntryRef_T entry);
498 FUNCTION_MUST_TYPEDEF(
500 (*DDSHST_Reader_commitFunc)(
501 struct DDSHST_Reader *
self,
503 struct REDA_SequenceNumber *sn,
517 FUNCTION_MUST_TYPEDEF(
519 (*DDSHST_Reader_add_and_commitFunc)(
520 struct DDSHST_Reader *rh,
521 DDSHST_ReaderSampleEntryRef_T entry,
522 DDSHST_ReaderSample_T *sample,
523 struct REDA_SequenceNumber *commit_sn)
536 (*DDSHST_Reader_post_eventFunc)(
537 struct DDSHST_Reader *
self,
538 struct DDSHST_ReaderEvent *event,
562 FUNCTION_MUST_TYPEDEF(
564 (*DDSHST_Reader_read_or_takeFunc)(
565 struct DDSHST_Reader *
self,
566 void ***sample_ptr_array,
591 FUNCTION_MUST_TYPEDEF(
593 (*DDSHST_Reader_finish_read_or_takeFunc)(
594 struct DDSHST_Reader *
self,
595 void ***sample_ptr_array,
611 FUNCTION_MUST_TYPEDEF(
612 DDSHST_ReaderKeyEntryRef_T
613 (*DDSHST_Reader_lookup_keyFunc)(
struct DDSHST_Reader*
self,
620 struct DDSHST_ReaderI
625 struct RT_ComponentI _parent;
630 DDSHST_Reader_return_entryFunc return_entry;
635 DDSHST_Reader_read_or_takeFunc read_or_take;
640 DDSHST_Reader_finish_read_or_takeFunc finish_read_or_take;
645 DDSHST_Reader_post_eventFunc post_event;
650 DDSHST_Reader_lookup_keyFunc lookup_key;
655 DDSHST_Reader_reserve_entryFunc reserve_entry;
661 DDSHST_Reader_add_and_commitFunc add_and_commit;
666 DDSHST_Reader_commitFunc commit;
672 #define DDSHST_ReaderFactory_create_component(f_,p_,l_) \
673 (struct DDSHST_Reader*)((f_)->intf)->create_component(f_,p_,l_)
678 #define DDSHST_ReaderFactory_delete_component(f_,c_) \
679 ((f_)->intf)->delete_component(f_,(RT_Component_T*)(c_))
703 #define DDSHST_Reader_reserve_entry(self_,rw_,key_,si_,strength_,\
704 sample_sn_,reject_reason_) \
705 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->reserve_entry(\
706 self_,rw_,key_,si_,strength_,\
707 sample_sn_,reject_reason_)
721 #define DDSHST_Reader_return_entry(self_,entry_) \
722 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->return_entry(\
742 #define DDSHST_Reader_add_and_commit(self_,entry_,sample_,sn_) \
743 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->add_and_commit(\
744 self_,entry_,sample_,sn_)
764 #define DDSHST_Reader_commit(self_,rw_,sn_,s_) \
765 ((struct DDSHST_ReaderI*)((self_)->_parent._intf))->commit(\
794 #define DDSHST_Reader_read_or_take(self_,\
795 sample_arr_,info_arr_,count_,handle_,max_samples_,sample_states_,view_states_,\
796 instance_states_,take_) \
797 ((struct DDSHST_ReaderI*)(\
798 (self_)->_parent._intf))->read_or_take(self_,\
799 sample_arr_,info_arr_,count_,handle_,max_samples_,\
800 sample_states_,view_states_,instance_states_,take_)
816 #define DDSHST_Reader_finish_read_or_take(self_,sample_seq_,info_seq_,count_,take_) \
817 ((struct DDSHST_ReaderI*)(\
818 (self_)->_parent._intf))->finish_read_or_take(self_,\
819 sample_seq_,info_seq_,count_,take_)
832 #define DDSHST_Reader_post_event(self_,event_,time_) \
833 ((struct DDSHST_ReaderI*)(\
834 (self_)->_parent._intf))->post_event(self_,event_,time_)
844 #define DDSHST_Reader_lookup_key(self_,key_) \
845 ((struct DDSHST_ReaderI*)(\
846 (self_)->_parent._intf))->lookup_key(self_,key_)