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
225 } DDSHST_WriterKeyRemovedKind_T;
235 DDSHST_WRITER_ENTRY_NORMAL,
240 DDSHST_WRITER_ENTRY_UNREGISTER,
245 DDSHST_WRITER_ENTRY_DISPOSE,
250 DDSHST_WRITER_ENTRY_UNREGISTER_DISPOSE
251 } DDSHST_WriterEntryKind_T;
258 #define DDSHST_WRITER_ACKCOUNT_ANY (0)
275 (*DDSHST_WriterListener_OnSampleRemovedFunc)(
278 struct DDSHST_WriterSample *sample,
279 struct REDA_SequenceNumber *sn,
280 DDSHST_WriterSampleRemovedKind_T kind,
293 (*DDSHST_WriterListener_OnDeadlineMissedFunc)(
void *listener_data,
308 (*DDSHST_WriterListener_OnKeyRemovedFunc)(
void *listener_data,
310 DDSHST_WriterKeyRemovedKind_T kind);
315 struct DDSHST_WriterListener
320 struct RT_ComponentListener _parent;
325 DDSHST_WriterListener_OnSampleRemovedFunc on_sample_removed;
330 DDSHST_WriterListener_OnKeyRemovedFunc on_key_removed;
335 DDSHST_WriterListener_OnDeadlineMissedFunc on_deadline_missed;
346 #define DDSHST_WriterListener_INITIALIZE {\
347 RT_ComponentListener_INITIALIZER,\
363 (*DDSHST_Writer_deleteFunc)(
struct DDSHST_Writer *
self);
375 FUNCTION_MUST_TYPEDEF(
376 struct DDSHST_Writer*
377 (*DDSHST_Writer_createFunc) (
const struct DDSHST_WriterProperty*
const property,
378 const struct DDSHST_WriterListener*
const listener)
395 FUNCTION_MUST_TYPEDEF(
396 DDSHST_WriterSampleEntryRef_T
397 (*DDSHST_Writer_get_entryFunc)(
struct DDSHST_Writer *
self,
399 DDSHST_WriterEntryKind_T kind,
RTI_BOOL assert_key);
414 (*DDSHST_Writer_return_entryFunc)(
struct DDSHST_Writer *
self,
415 DDSHST_WriterSampleEntryRef_T
const entry);
434 FUNCTION_MUST_TYPEDEF(
436 (*DDSHST_Writer_commit_entryFunc)(
struct DDSHST_Writer *
self,
437 DDSHST_WriterSampleEntryRef_T entry,
438 DDSHST_WriterSample_T *
const sample,
439 const struct REDA_SequenceNumber *
const sn,
460 FUNCTION_MUST_TYPEDEF(
462 (*DDSHST_Writer_request_sampleFunc)(
struct DDSHST_Writer *
self,
463 struct DDSHST_WriterSample **sample,
464 const struct REDA_SequenceNumber *
const req_sn,
465 struct REDA_SequenceNumber *
const sn_ge,
485 FUNCTION_MUST_TYPEDEF(
487 (*DDSHST_Writer_acknack_sampleFunc)(
struct DDSHST_Writer *
self,
488 const struct REDA_SequenceNumber *
const sn,
506 FUNCTION_MUST_TYPEDEF(
508 (*DDSHST_Writer_register_keyFunc)(
struct DDSHST_Writer *
self,
524 FUNCTION_MUST_TYPEDEF(
525 struct DDSHST_WriterState*
526 (*DDSHST_Writer_get_stateFunc)(
struct DDSHST_Writer *
self)
542 (*DDSHST_Writer_post_eventFunc)(struct DDSHST_Writer *self,
543 struct DDSHST_WriterEvent *event,
549 struct DDSHST_WriterI
554 struct RT_ComponentI _parent;
559 DDSHST_Writer_get_entryFunc get_entry;
564 DDSHST_Writer_return_entryFunc return_entry;
569 DDSHST_Writer_commit_entryFunc commit_entry;
574 DDSHST_Writer_request_sampleFunc request_sample;
579 DDSHST_Writer_acknack_sampleFunc acknack_sample;
584 DDSHST_Writer_register_keyFunc register_key;
589 DDSHST_Writer_get_stateFunc get_state;
594 DDSHST_Writer_post_eventFunc post_event;
606 #define DDSHST_WriterFactory_create_component(f_,p_,l_) \
607 (struct DDSHST_Writer*)((f_)->intf)->create_component(f_,p_,l_)
615 #define DDSHST_WriterFactory_delete_component(f_,c_) \
616 ((f_)->intf)->delete_component(f_,(RT_Component_T*)(c_))
629 #define DDSHST_Writer_get_entry(self_,key_,kind_,assert_key_) \
630 ((struct DDSHST_WriterI*)(\
631 (self_)->_parent._intf))->get_entry(self_,key_,kind_,assert_key_)
642 #define DDSHST_Writer_return_entry(self_,entry_) \
643 ((struct DDSHST_WriterI*)(\
644 (self_)->_parent._intf))->return_entry(self_,entry_)
664 #define DDSHST_Writer_commit_entry(self_,entry_,sample_,sn_,ack_count_) \
665 ((struct DDSHST_WriterI*)(\
666 (self_)->_parent._intf))->commit_entry(self_,entry_,\
667 sample_,sn_,ack_count_)
693 #define DDSHST_Writer_request_sample(self_,sample_,sn_,sn_ge_,h_) \
694 ((struct DDSHST_WriterI*)(\
695 (self_)->_parent._intf))->request_sample(self_,sample_,sn_,sn_ge_,h_)
729 #define DDSHST_Writer_acknack_sample(self_,sn_,nack_) \
730 ((struct DDSHST_WriterI*)(\
731 (self_)->_parent._intf))->acknack_sample(self_,sn_,nack_)
745 #define DDSHST_Writer_register_key(self_,key_) \
746 ((struct DDSHST_WriterI*)(\
747 (self_)->_parent._intf))->register_key(self_,key_)
761 #define DDSHST_Writer_get_state(self_) \
762 ((struct DDSHST_WriterI*)(\
763 (self_)->_parent._intf))->get_state(self_)
778 #define DDSHST_Writer_post_event(self_,event_,time_) \
779 ((struct DDSHST_WriterI*)(\
780 (self_)->_parent._intf))->post_event(self_,event_,time_)