mars_lib 0.1.0.2abe2576fe7f
Modular and Robust Sensor-Fusion
Loading...
Searching...
No Matches
buffer_entry_type.h
Go to the documentation of this file.
1// Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria.
2//
3// All rights reserved.
4//
5// This software is licensed under the terms of the BSD-2-Clause-License with
6// no commercial use allowed, the full terms of which are made available
7// in the LICENSE file. No license in patents is granted.
8//
9// You can contact the author at <christian.brommer@ieee.org>
10
11#ifndef BUFFERENTRYTYPE_H
12#define BUFFERENTRYTYPE_H
13
15#include <mars/time.h>
17#include <iostream>
18#include <set>
19
21{
34} // namespace BufferMetadataTypes
35
36namespace mars
37{
39
41{
42public:
45 std::shared_ptr<SensorAbsClass> sensor_handle_{ nullptr };
46 int metadata_{ BufferMetadataType::invalid };
47
48 BufferEntryType() = default;
49
50 BufferEntryType(const Time& timestamp, BufferDataType data, std::shared_ptr<SensorAbsClass> sensor,
51 const int& metadata = BufferMetadataType::none);
52
53 bool operator<(const BufferEntryType& rhs) const;
54 bool operator<=(const BufferEntryType& rhs) const;
55 bool operator>(const BufferEntryType& rhs) const;
56 bool operator>=(const BufferEntryType& rhs) const;
57 friend std::ostream& operator<<(std::ostream& out, const BufferEntryType& entry);
58
64 static std::string get_metadata_label(int label);
65
70 bool IsMeasurement() const;
71
78 bool IsValid() const;
79
84 bool IsAutoGenerated() const;
85
92 bool HasStates() const;
93
98
99private:
102};
103} // namespace mars
104#endif // BUFFERENTRYTYPE_H
The BufferDataType binds the core and sensor state in form of a shared void pointer.
Definition buffer_data_type.h:36
Definition buffer_entry_type.h:41
BufferEntryType()=default
Time timestamp_
Definition buffer_entry_type.h:43
bool operator<(const BufferEntryType &rhs) const
bool IsValid() const
IsValid Check if the entry is valid for usage.
bool operator<=(const BufferEntryType &rhs) const
std::set< int > metadata_valid_filter_
Definition buffer_entry_type.h:100
bool HasStates() const
HasState checks if the BufferDataType has a (core) state.
BufferDataType data_
Definition buffer_entry_type.h:44
BufferEntryType(const Time &timestamp, BufferDataType data, std::shared_ptr< SensorAbsClass > sensor, const int &metadata=BufferMetadataType::none)
int metadata_
Definition buffer_entry_type.h:46
bool IsAutoGenerated() const
IsAutoGenerated.
void ClearStates()
ClearStates resets states of the buffer entry.
bool operator>(const BufferEntryType &rhs) const
static std::string get_metadata_label(int label)
get_metadata_label decodes the 'BufferMetadataType' enum to strings
bool IsMeasurement() const
IsMeasurement.
std::shared_ptr< SensorAbsClass > sensor_handle_
Definition buffer_entry_type.h:45
bool operator>=(const BufferEntryType &rhs) const
std::set< int > metadata_auto_filter_
Definition buffer_entry_type.h:101
friend std::ostream & operator<<(std::ostream &out, const BufferEntryType &entry)
Definition time.h:20
Definition buffer_entry_type.h:21
BufferMetadataType
Possible metadata states.
Definition buffer_entry_type.h:27
@ none
Definition buffer_entry_type.h:28
@ out_of_order
Definition buffer_entry_type.h:31
@ invalid
Definition buffer_entry_type.h:29
@ init
Definition buffer_entry_type.h:30
@ auto_add
auto generated measurement e.g. introduced by interpolation
Definition buffer_entry_type.h:32
Definition buffer.h:27