84 return static_cast<int>(
data_.size());
172 std::vector<const BufferEntryType*>* entries)
const;
Definition: buffer_entry_type.h:41
BufferClass that holds mars::BufferEntryType elements and provides access methods.
Definition: buffer.h:35
void set_keep_last_sensor_handle(const bool &value)
set_keep_last_sensor_handle
int get_max_buffer_size() const
get_max_buffer_size
bool get_latest_sensor_handle_measurement(const std::shared_ptr< SensorAbsClass > &sensor_handle, BufferEntryType *entry) const
get_latest_sensor_handle_measurement
int max_buffer_size_
defines the max size at wich the oldest entry is removed
Definition: buffer.h:275
bool keep_last_sensor_handle_
If true, the last entry of a sensor state entry will be keept in the buffer.
Definition: buffer.h:281
Buffer()
Buffer default constructor max buffer size is set to 400 by default.
bool get_latest_sensor_handle_state(const std::shared_ptr< SensorAbsClass > &sensor_handle, BufferEntryType *entry) const
get_latest_sensor_handle_state
bool get_latest_sensor_handle_state(const std::shared_ptr< SensorAbsClass > &sensor_handle, BufferEntryType *entry, int *index) const
get_latest_sensor_handle_state
bool RemoveSensorFromBuffer(const std::shared_ptr< SensorAbsClass > &sensor_handle)
RemoveSensorFromBuffer Removes all entrys that are associated with the given sensor handle.
int FindClosestTimestamp(const Time ×tamp) const
FindClosestTimestamp Returns the index of the entry which is the closest to the specified 'timestamp'...
bool get_intermediate_entry_pair(const std::shared_ptr< SensorAbsClass > &sensor_handle, BufferEntryType *imu_state, BufferEntryType *sensor_state) const
get_latest_interm_entrie Get last state pair of imu prop and sensor update
bool get_closest_state(const Time ×tamp, BufferEntryType *entry) const
get_closest_state
bool get_sensor_handle_measurements(const std::shared_ptr< SensorAbsClass > &sensor_handle, std::vector< const BufferEntryType * > *entries) const
get_sensor_handle_measurements
int RemoveOverflowEntrys()
RemoveOverflowEntrys Removes the oldest entries if max buffer size is reached.
bool get_latest_entry(BufferEntryType *entry) const
get_latest_entry Returns the last buffer entry
bool get_latest_state(BufferEntryType *entry) const
get_latest_state returns the most recent state entry
bool get_oldest_sensor_handle_state(const std::shared_ptr< SensorAbsClass > &sensor_handle, BufferEntryType *entry) const
get_oldest_sensor_handle_state
bool CheckForLastSensorHandleWithState(const std::shared_ptr< SensorAbsClass > &sensor_handle) const
CheckForLastSensorHandleWithState Checks if the given sensor handle only exists once in the buffer an...
bool IsSorted() const
Checks if all buffer entrys are correctly sorted by time.
Buffer(const int &size)
Buffer constructor.
bool get_entry_at_idx(const int &index, BufferEntryType *entry) const
get_entry_at_idx
bool get_oldest_core_state(BufferEntryType *entry) const
get_oldest_core_state Gets the oldest entry with metadata_ core_state
std::deque< BufferEntryType > data_
deque container that holds the buffer entries
Definition: buffer.h:270
bool IsEmpty() const
IsEmpty.
bool OverwriteDataAtIndex(const BufferEntryType &new_entry, const int &index)
InsertDataAtIndex Adds 'entry' at buffer position 'index'.
int get_length() const
get_length
Definition: buffer.h:82
void set_max_buffer_size(const int &size)
set_max_buffer_size
bool get_latest_init_state(BufferEntryType *entry) const
Gets the latest entry with init_state as metadata.
int AddEntrySorted(const BufferEntryType &new_entry, const bool &after=true)
AddEntrySorted Adds a new entry to the buffer and ensures the buffer is sorted.
void PrintBufferEntries() const
PrintBufferEntries prints all buffer entries in a formatted way.
bool verbose_
Increased cmd output.
Definition: buffer.h:283
bool ClearStatesStartingAtIdx(const int &idx)
Deletes all states after, and including the given index This also deletes all auto generated states.
bool get_closest_state(const Time ×tamp, BufferEntryType *entry, int *index) const
void ResetBufferData()
Removes all entrys from the buffer.
bool get_oldest_state(BufferEntryType *entry) const
get_oldest_state Gets the oldest entry with metadata in the state group