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;
48 destination.instance_history = source.instance_history;
51 static bool equals(
const native_type& first,
const native_type& second)
53 if (first.sample_state != second.sample_state) {
56 if (first.max_samples != second.max_samples) {
59 if (!DDS_Time_t_equals(
60 first.time_range_start,
61 second.time_range_start)) {
64 if (!DDS_Time_t_equals(
66 second.time_range_end)) {
69 return first.instance_history.depth == second.instance_history.depth;
83 typedef RTI_RecordingServiceSelectorState native_type;
88 namespace recording {
namespace storage {
98 class SelectorState :
public rti::core::NativeValueType<SelectorState> {
100 RTI_NATIVE_VALUE_TYPE_DEFINE_DEFAULT_MOVE_OPERATIONS(
SelectorState)
102 typedef rti::core::NativeValueType<SelectorState> Base;
108 SelectorState(
const RTI_RecordingServiceSelectorState &native) :
130 return dds::sub::status::SampleState(native().sample_state);
139 static_cast<RTI_RecordingServiceSampleStateMask
>(
153 return dds::core::Time(
154 native().time_range_start.sec,
155 native().time_range_start.nanosec);
165 (int64_t) native().time_range_start.sec
166 * rti::core::nanosec_per_sec
167 + native().time_range_start.nanosec;
177 native().time_range_start.nanosec =
178 (DDS_UnsignedLong) time_range_start.nanosec();
190 return dds::core::Time(
191 native().time_range_end.sec,
192 native().time_range_end.nanosec);
202 (int64_t) native().time_range_end.sec
203 * rti::core::nanosec_per_sec
204 + native().time_range_end.nanosec;
214 native().time_range_end.nanosec =
215 (DDS_UnsignedLong) time_range_end.nanosec();
226 return native().max_samples;
239 inline int32_t instance_history_depth()
const 241 return native().instance_history.depth;
246 native().instance_history.depth = (int) depth;
int64_t timestamp_range_start() const
Like the time_range_start() method, but returns the timestamp in long long (int-64) format...
Definition: SelectorState.hpp:162
Definition: SelectorState.hpp:27
int64_t timestamp_range_end() const
Like the time_range_end() method, but returns the timestamp in long long (int-64) format...
Definition: SelectorState.hpp:199
int32_t max_samples() const
Returns the maximum number of samples to be returned by a single read() call, when the value is posit...
Definition: SelectorState.hpp:224
SelectorState & max_samples(const int32_t max_samples)
Sets the maximum number of samples to be returned by a single call to read().
Definition: SelectorState.hpp:233
SelectorState & sample_state(const dds::sub::status::SampleState &state)
Sets the sample state.
Definition: SelectorState.hpp:136
The RTI namespace.
Definition: RecordingServiceImpl.hpp:22
SelectorState & time_range_start(const dds::core::Time &time_range_start)
Sets the lower limit of the time range.
Definition: SelectorState.hpp:174
dds::core::Time time_range_start() const
Returns the time that represents the lower limit (inclusive) of the time range the retrieved data sam...
Definition: SelectorState.hpp:151
SelectorState & time_range_end(const dds::core::Time &time_range_end)
Sets the upper limit of the time range.
Definition: SelectorState.hpp:211
This class is used by Replay Service or Converter when asking the storage plugin for data...
Definition: SelectorState.hpp:98
dds::sub::status::SampleState sample_state() const
Returns the sample state. This is used to represent the state of the samples asked for...
Definition: SelectorState.hpp:128
dds::core::Time time_range_end() const
Returns the time that represents the upper limit (inclusive) of the time range the retrieved samples ...
Definition: SelectorState.hpp:188