1#include "state_representation/State.hpp"
2#include "state_representation/exceptions/NotImplementedException.hpp"
10 type_(type), name_(name), empty_(empty), timestamp_(std::chrono::steady_clock::now()) {}
13 std::enable_shared_from_this<
State>(state),
17 timestamp_(std::chrono::steady_clock::now()) {}
37 return this->timestamp_;
41 this->timestamp_ = timepoint;
45 this->timestamp_ = std::chrono::steady_clock::now();
57 bool compatible = (this->name_ == state.name_);
78 if (state.is_empty()) {
81 os <<
" State: " << state.get_name();
85State::operator bool() const noexcept {
Abstract class to represent a state.
void reset_timestamp()
Reset the timestamp attribute to now.
virtual void initialize()
Initialize the State to a zero value.
const std::string & get_name() const
Getter of the name as const reference.
virtual void set_name(const std::string &name)
Setter of the name.
void set_timestamp(const std::chrono::time_point< std::chrono::steady_clock > &timepoint)
Setter of the timestamp attribute.
State()
Empty constructor.
const StateType & get_type() const
Getter of the type attribute.
void set_filled()
Setter of the empty attribute to false and also reset the timestamp.
void set_type(const StateType &type)
Override the state type.
virtual bool is_compatible(const State &state) const
Check if the state is compatible for operations with the state given as argument.
const std::chrono::time_point< std::chrono::steady_clock > & get_timestamp() const
Getter of the timestamp attribute.
virtual void set_data(const Eigen::VectorXd &data)
Set the data of the state from a single Eigen vector.
bool is_empty() const
Getter of the empty attribute.
void set_empty(bool empty=true)
Setter of the empty attribute.
Core state variables and objects.
std::ostream & operator<<(std::ostream &os, const Ellipsoid &ellipsoid)
StateType
The class types inheriting from State.