33 #ifndef dds_c_wh_plugin_h
34 #define dds_c_wh_plugin_h
45 #ifndef dds_c_discovery_h
70 DDSHST_WRITEREVENT_KIND_DEADLINE_EXPIRED = 1,
75 DDSHST_WRITEREVENT_KIND_HISTORICAL_DATA_REQUESTED
76 } DDSHST_WriterEventKind_T;
81 struct DDSHST_WriterEvent
86 DDSHST_WriterEventKind_T kind;
94 struct RT_Component _parent;
97 typedef struct DDSHST_Writer DDSHST_Writer_T;
99 struct DDSHST_WriterSampleEntry;
105 typedef struct DDSHST_WriterSampleEntry* DDSHST_WriterSampleEntryRef_T;
110 typedef struct DDSHST_WriterSample
116 DDSHST_WriterSampleEntryRef_T _ref;
117 } DDSHST_WriterSample_T;
122 struct DDSHST_WriterState
127 struct REDA_SequenceNumber low_sn;
132 struct REDA_SequenceNumber high_sn;
137 struct REDA_SequenceNumber history_low_sn;
142 struct REDA_SequenceNumber history_high_sn;
148 struct DDSHST_WriterProperty
153 struct RT_ComponentProperty _parent;
165 #define DDSHST_WriterProperty_INITIALIZER \
167 RT_ComponentProperty_INITIALIZER,\
180 DDSHST_WRITER_SAMPLE_REMOVED_NORMAL,
186 DDSHST_WRITER_SAMPLE_REMOVED_UNACKED,
191 DDSHST_WRITER_SAMPLE_REMOVED_KEY_UNREGISTERED,
196 DDSHST_WRITER_SAMPLE_REMOVED_KEY_DISPOSED,
202 DDSHST_WRITER_SAMPLE_REMOVED_MAX_SAMPLES_PER_INSTANCE
203 } DDSHST_WriterSampleRemovedKind_T;
214 DDSHST_WRITER_KEY_REMOVED_NORMAL,
219 DDSHST_WRITER_KEY_REMOVED_UNREGISTERED,
224 DDSHST_WRITER_KEY_REMOVED_DISPOSED,
229 DDSHST_WRITER_KEY_REMOVED_DELETED
230 } DDSHST_WriterKeyRemovedKind_T;
240 DDSHST_WRITER_ENTRY_NONE,
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;
266 struct DDSHST_InstanceState
270 RTI_INT32 sample_count;
274 DDSHST_WriterEntryKind_T last_sample_kind;
282 #define DDSHST_WRITER_ACKCOUNT_ANY (0)
299 (*DDSHST_WriterListener_OnSampleRemovedFunc)(
302 struct DDSHST_WriterSample *sample,
303 struct REDA_SequenceNumber *sn,
304 DDSHST_WriterSampleRemovedKind_T kind,
317 (*DDSHST_WriterListener_OnDeadlineMissedFunc)(
void *listener_data,
332 (*DDSHST_WriterListener_OnKeyRemovedFunc)(
void *listener_data,
334 DDSHST_WriterKeyRemovedKind_T kind);
339 struct DDSHST_WriterListener
344 struct RT_ComponentListener _parent;
349 DDSHST_WriterListener_OnSampleRemovedFunc on_sample_removed;
354 DDSHST_WriterListener_OnKeyRemovedFunc on_key_removed;
359 DDSHST_WriterListener_OnDeadlineMissedFunc on_deadline_missed;
370 #define DDSHST_WriterListener_INITIALIZE {\
371 RT_ComponentListener_INITIALIZER,\
387 (*DDSHST_Writer_deleteFunc)(
struct DDSHST_Writer *
self);
399 FUNCTION_MUST_TYPEDEF(
400 struct DDSHST_Writer*
401 (*DDSHST_Writer_createFunc) (
const struct DDSHST_WriterProperty*
const property,
402 const struct DDSHST_WriterListener*
const listener)
420 FUNCTION_MUST_TYPEDEF(
421 DDSHST_WriterSampleEntryRef_T
422 (*DDSHST_Writer_get_entryFunc)(
struct DDSHST_Writer *
self,
424 DDSHST_WriterEntryKind_T kind, RTI_BOOL assert_key,
440 (*DDSHST_Writer_return_entryFunc)(
struct DDSHST_Writer *
self,
441 DDSHST_WriterSampleEntryRef_T
const entry);
460 FUNCTION_MUST_TYPEDEF(
462 (*DDSHST_Writer_commit_entryFunc)(
struct DDSHST_Writer *
self,
463 DDSHST_WriterSampleEntryRef_T entry,
464 DDSHST_WriterSample_T *
const sample,
465 const struct REDA_SequenceNumber *
const sn,
486 FUNCTION_MUST_TYPEDEF(
488 (*DDSHST_Writer_request_sampleFunc)(
struct DDSHST_Writer *
self,
489 struct DDSHST_WriterSample **sample,
490 const struct REDA_SequenceNumber *
const req_sn,
491 struct REDA_SequenceNumber *
const sn_ge,
511 FUNCTION_MUST_TYPEDEF(
513 (*DDSHST_Writer_acknack_sampleFunc)(
struct DDSHST_Writer *
self,
514 const struct REDA_SequenceNumber *
const sn,
532 FUNCTION_MUST_TYPEDEF(
534 (*DDSHST_Writer_register_keyFunc)(
struct DDSHST_Writer *
self,
551 FUNCTION_MUST_TYPEDEF(
552 struct DDSHST_WriterState*
553 (*DDSHST_Writer_get_stateFunc)(
struct DDSHST_Writer *
self)
569 (*DDSHST_Writer_post_eventFunc)(struct DDSHST_Writer *self,
570 struct DDSHST_WriterEvent *event,
586 typedef DDSHST_ReturnCode_T
587 (*DDSHST_Writer_get_instance_stateFunc)(struct DDSHST_Writer *self,
589 struct DDSHST_InstanceState *state);
605 typedef DDSHST_ReturnCode_T
606 (*DDSHST_Writer_unregister_keyFunc)(struct DDSHST_Writer *self,
613 struct DDSHST_WriterI
618 struct RT_ComponentI _parent;
623 DDSHST_Writer_get_entryFunc get_entry;
628 DDSHST_Writer_return_entryFunc return_entry;
633 DDSHST_Writer_commit_entryFunc commit_entry;
638 DDSHST_Writer_request_sampleFunc request_sample;
643 DDSHST_Writer_acknack_sampleFunc acknack_sample;
648 DDSHST_Writer_register_keyFunc register_key;
653 DDSHST_Writer_get_stateFunc get_state;
658 DDSHST_Writer_post_eventFunc post_event;
663 DDSHST_Writer_get_instance_stateFunc get_instance_state;
668 DDSHST_Writer_unregister_keyFunc unregister_key;
680 #define DDSHST_WriterFactory_create_component(f_,p_,l_) \
681 (struct DDSHST_Writer*)((f_)->intf)->create_component(f_,p_,l_)
689 #define DDSHST_WriterFactory_delete_component(f_,c_) \
690 ((f_)->intf)->delete_component(f_,(RT_Component_T*)(c_))
704 #define DDSHST_Writer_get_entry(self_,key_,kind_,assert_key_,ts_) \
705 ((struct DDSHST_WriterI*)(\
706 (self_)->_parent._intf))->get_entry(self_,key_,kind_,assert_key_,ts_)
717 #define DDSHST_Writer_return_entry(self_,entry_) \
718 ((struct DDSHST_WriterI*)(\
719 (self_)->_parent._intf))->return_entry(self_,entry_)
739 #define DDSHST_Writer_commit_entry(self_,entry_,sample_,sn_,ack_count_) \
740 ((struct DDSHST_WriterI*)(\
741 (self_)->_parent._intf))->commit_entry(self_,entry_,\
742 sample_,sn_,ack_count_)
768 #define DDSHST_Writer_request_sample(self_,sample_,sn_,sn_ge_,h_) \
769 ((struct DDSHST_WriterI*)(\
770 (self_)->_parent._intf))->request_sample(self_,sample_,sn_,sn_ge_,h_)
804 #define DDSHST_Writer_acknack_sample(self_,sn_,nack_) \
805 ((struct DDSHST_WriterI*)(\
806 (self_)->_parent._intf))->acknack_sample(self_,sn_,nack_)
821 #define DDSHST_Writer_register_key(self_,key_,ts_) \
822 ((struct DDSHST_WriterI*)(\
823 (self_)->_parent._intf))->register_key(self_,key_,ts_)
837 #define DDSHST_Writer_get_state(self_) \
838 ((struct DDSHST_WriterI*)(\
839 (self_)->_parent._intf))->get_state(self_)
854 #define DDSHST_Writer_post_event(self_,event_,time_) \
855 ((struct DDSHST_WriterI*)(\
856 (self_)->_parent._intf))->post_event(self_,event_,time_)
871 #define DDSHST_Writer_get_instance_state(self_,key_,state_) \
872 ((struct DDSHST_WriterI*)(\
873 (self_)->_parent._intf))->get_instance_state(self_,key_,state_)
889 #define DDSHST_Writer_unregister_key(self_,key_) \
890 ((struct DDSHST_WriterI*)(\
891 (self_)->_parent._intf))->unregister_key(self_,key_)