10 #ifndef HPP_RTI_RECORDING_STORAGE_SAMPLESELECTOR_HPP_
11 #define HPP_RTI_RECORDING_STORAGE_SAMPLESELECTOR_HPP_
13 #include "dds/dds.hpp"
14 #include "rti/core/NativeValueType.hpp"
15 #include "rti/core/constants.hpp"
17 #include "recordingservice/recordingservice_storagereader.h"
19 namespace rti {
namespace recording {
namespace storage {
29 typedef RTI_RecordingServiceSelectorState native_type;
31 static void initialize(native_type& native_value)
33 RTI_RecordingServiceSelectorState native_state =
34 RTI_RecordingServiceSelectorState_INITIALIZER;
35 memcpy(&native_value, &native_state,
sizeof(native_state));
38 static void finalize(native_type&)
42 static void copy(native_type& destination,
const native_type& source)
44 destination.sample_state = source.sample_state;
45 destination.time_range_start = source.time_range_start;
46 destination.time_range_end = source.time_range_end;
47 destination.max_samples = source.max_samples;
50 static bool equals(
const native_type& first,
const native_type& second)
52 if (first.sample_state != second.sample_state) {
55 if (first.max_samples != second.max_samples) {
58 if (!DDS_Time_t_equals(
59 first.time_range_start,
60 second.time_range_start)) {
63 return DDS_Time_t_equals(
65 second.time_range_end);
79 typedef RTI_RecordingServiceSelectorState native_type;
84 namespace recording {
namespace storage {
94 class SelectorState :
public rti::core::NativeValueType<SelectorState> {
96 RTI_NATIVE_VALUE_TYPE_DEFINE_DEFAULT_MOVE_OPERATIONS(
SelectorState)
98 typedef rti::core::NativeValueType<SelectorState> Base;
104 SelectorState(
const RTI_RecordingServiceSelectorState &native) :
126 return dds::sub::status::SampleState(native().
sample_state);
134 native().sample_state = state.to_ulong();
147 return dds::core::Time(
159 (int64_t) native().time_range_start.sec
160 * rti::core::nanosec_per_sec
161 + native().time_range_start.nanosec;
170 native().time_range_start.sec = (DDS_Long) time_range_start.sec();
171 native().time_range_start.nanosec =
172 (DDS_UnsignedLong) time_range_start.nanosec();
184 return dds::core::Time(
196 (int64_t) native().time_range_end.sec
197 * rti::core::nanosec_per_sec
198 + native().time_range_end.nanosec;
207 native().time_range_end.sec = (DDS_Long) time_range_end.sec();
208 native().time_range_end.nanosec =
209 (DDS_UnsignedLong) time_range_end.nanosec();
220 return native().max_samples;
229 native().max_samples = (int) max_samples;