32 #ifndef dds_c_wh_plugin_h
33 #define dds_c_wh_plugin_h
44 #ifndef dds_c_discovery_h
64 DDSHST_WRITEREVENT_KIND_DEADLINE_EXPIRED = 1,
69 DDSHST_WRITEREVENT_KIND_HISTORICAL_DATA_REQUESTED
70 } DDSHST_WriterEventKind_T;
75 struct DDSHST_WriterEvent
80 DDSHST_WriterEventKind_T kind;
88 struct RT_Component _parent;
91 typedef struct DDSHST_Writer DDSHST_Writer_T;
93 struct DDSHST_WriterSampleEntry;
99 typedef struct DDSHST_WriterSampleEntry* DDSHST_WriterSampleEntryRef_T;
104 typedef struct DDSHST_WriterSample
109 struct REDA_Buffer _user_data;
114 struct REDA_Buffer _inline_data;
125 DDSHST_WriterSampleEntryRef_T _ref;
126 } DDSHST_WriterSample_T;
131 struct DDSHST_WriterState
136 struct REDA_SequenceNumber low_sn;
141 struct REDA_SequenceNumber high_sn;
146 struct REDA_SequenceNumber history_low_sn;
151 struct REDA_SequenceNumber history_high_sn;
157 struct DDSHST_WriterProperty
162 struct RT_ComponentProperty _parent;
175 #define DDSHST_WriterProperty_INITIALIZER \
177 RT_ComponentProperty_INITIALIZER,\
190 DDSHST_WRITER_SAMPLE_REMOVED_NORMAL,
196 DDSHST_WRITER_SAMPLE_REMOVED_UNACKED,
201 DDSHST_WRITER_SAMPLE_REMOVED_KEY_UNREGISTERED,
206 DDSHST_WRITER_SAMPLE_REMOVED_KEY_DISPOSED,
212 DDSHST_WRITER_SAMPLE_REMOVED_MAX_SAMPLES_PER_INSTANCE
213 } DDSHST_WriterSampleRemovedKind_T;
224 DDSHST_WRITER_KEY_REMOVED_NORMAL,
229 DDSHST_WRITER_KEY_REMOVED_UNREGISTERED,
234 DDSHST_WRITER_KEY_REMOVED_DISPOSED
235 } DDSHST_WriterKeyRemovedKind_T;
245 DDSHST_WRITER_ENTRY_NORMAL,
250 DDSHST_WRITER_ENTRY_UNREGISTER,
255 DDSHST_WRITER_ENTRY_DISPOSE,
260 DDSHST_WRITER_ENTRY_UNREGISTER_DISPOSE
261 } DDSHST_WriterEntryKind_T;
268 #define DDSHST_WRITER_ACKCOUNT_ANY (0)
285 (*DDSHST_WriterListener_OnSampleRemovedFunc)(
288 struct DDSHST_WriterSample *sample,
289 struct REDA_SequenceNumber *sn,
290 DDSHST_WriterSampleRemovedKind_T kind,
303 (*DDSHST_WriterListener_OnDeadlineMissedFunc)(
void *listener_data,
318 (*DDSHST_WriterListener_OnKeyRemovedFunc)(
void *listener_data,
320 DDSHST_WriterKeyRemovedKind_T kind);
325 struct DDSHST_WriterListener
330 struct RT_ComponentListener _parent;
335 DDSHST_WriterListener_OnSampleRemovedFunc on_sample_removed;
340 DDSHST_WriterListener_OnKeyRemovedFunc on_key_removed;
345 DDSHST_WriterListener_OnDeadlineMissedFunc on_deadline_missed;
356 #define DDSHST_WriterListener_INITIALIZE {\
357 RT_ComponentListener_INITIALIZER,\
373 (*DDSHST_Writer_deleteFunc)(
struct DDSHST_Writer *
self);
385 FUNCTION_MUST_TYPEDEF(
386 struct DDSHST_Writer*
387 (*DDSHST_Writer_createFunc) (
388 const struct DDSHST_WriterProperty*
const property,
389 const struct DDSHST_WriterListener*
const listener)
404 FUNCTION_MUST_TYPEDEF(
405 DDSHST_WriterSampleEntryRef_T
406 (*DDSHST_Writer_get_entryFunc)(
407 struct DDSHST_Writer *
self,
409 DDSHST_WriterEntryKind_T kind);
424 (*DDSHST_Writer_return_entryFunc)(
425 struct DDSHST_Writer *
self,
426 DDSHST_WriterSampleEntryRef_T
const entry);
445 FUNCTION_MUST_TYPEDEF(
447 (*DDSHST_Writer_commit_entryFunc)(
448 struct DDSHST_Writer *
self,
449 DDSHST_WriterSampleEntryRef_T entry,
450 DDSHST_WriterSample_T *
const sample,
451 const struct REDA_SequenceNumber *
const sn,
472 FUNCTION_MUST_TYPEDEF(
474 (*DDSHST_Writer_request_sampleFunc)(
475 struct DDSHST_Writer *
self,
476 struct DDSHST_WriterSample **sample,
477 const struct REDA_SequenceNumber *
const req_sn,
478 struct REDA_SequenceNumber *
const sn_ge,
498 FUNCTION_MUST_TYPEDEF(
500 (*DDSHST_Writer_acknack_sampleFunc)(
501 struct DDSHST_Writer *
self,
502 const struct REDA_SequenceNumber *
const sn,
520 FUNCTION_MUST_TYPEDEF(
522 (*DDSHST_Writer_register_keyFunc)(
523 struct DDSHST_Writer *
self,
539 FUNCTION_MUST_TYPEDEF(
540 struct DDSHST_WriterState*
541 (*DDSHST_Writer_get_stateFunc)(
struct DDSHST_Writer *
self)
557 (*DDSHST_Writer_post_eventFunc)(struct DDSHST_Writer *self,
558 struct DDSHST_WriterEvent *event,
564 struct DDSHST_WriterI
569 struct RT_ComponentI _parent;
574 DDSHST_Writer_get_entryFunc get_entry;
579 DDSHST_Writer_return_entryFunc return_entry;
584 DDSHST_Writer_commit_entryFunc commit_entry;
589 DDSHST_Writer_request_sampleFunc request_sample;
594 DDSHST_Writer_acknack_sampleFunc acknack_sample;
599 DDSHST_Writer_register_keyFunc register_key;
604 DDSHST_Writer_get_stateFunc get_state;
609 DDSHST_Writer_post_eventFunc post_event;
621 #define DDSHST_WriterFactory_create_component(f_,p_,l_) \
622 (struct DDSHST_Writer*)((f_)->intf)->create_component(f_,p_,l_)
630 #define DDSHST_WriterFactory_delete_component(f_,c_) \
631 ((f_)->intf)->delete_component(f_,(RT_Component_T*)(c_))
642 #define DDSHST_Writer_get_entry(self_,key_,kind_) \
643 ((struct DDSHST_WriterI*)(\
644 (self_)->_parent._intf))->get_entry(self_,key_,kind_)
655 #define DDSHST_Writer_return_entry(self_,entry_) \
656 ((struct DDSHST_WriterI*)(\
657 (self_)->_parent._intf))->return_entry(self_,entry_)
677 #define DDSHST_Writer_commit_entry(self_,entry_,sample_,sn_,ack_count_) \
678 ((struct DDSHST_WriterI*)(\
679 (self_)->_parent._intf))->commit_entry(self_,entry_,\
680 sample_,sn_,ack_count_)
706 #define DDSHST_Writer_request_sample(self_,sample_,sn_,sn_ge_,h_) \
707 ((struct DDSHST_WriterI*)(\
708 (self_)->_parent._intf))->request_sample(self_,sample_,sn_,sn_ge_,h_)
742 #define DDSHST_Writer_acknack_sample(self_,sn_,nack_) \
743 ((struct DDSHST_WriterI*)(\
744 (self_)->_parent._intf))->acknack_sample(self_,sn_,nack_)
758 #define DDSHST_Writer_register_key(self_,key_) \
759 ((struct DDSHST_WriterI*)(\
760 (self_)->_parent._intf))->register_key(self_,key_)
774 #define DDSHST_Writer_get_state(self_) \
775 ((struct DDSHST_WriterI*)(\
776 (self_)->_parent._intf))->get_state(self_)
791 #define DDSHST_Writer_post_event(self_,event_,time_) \
792 ((struct DDSHST_WriterI*)(\
793 (self_)->_parent._intf))->post_event(self_,event_,time_)