40 #ifndef CLOE_UTILITY_ACTUATION_LEVEL_HPP_ 41 #define CLOE_UTILITY_ACTUATION_LEVEL_HPP_ 71 Enum get_raw()
const {
return enum_; }
72 void set_raw(Enum e) {
74 assert(this->is_valid());
77 bool is_valid()
const {
89 bool has_lat()
const {
return (enum_ & Lat) != 0; }
90 bool has_long()
const {
return (enum_ & Long) != 0; }
91 bool has_both()
const {
return enum_ == LatLong; }
92 bool has_control()
const {
return (enum_ & LatLong) != 0; }
93 bool is_standby()
const {
return enum_ == Standby; }
94 bool is_none()
const {
return enum_ == None; }
96 void set_none() { enum_ = None; }
97 void set_standby() { enum_ = Standby; }
98 void set_latlong() { enum_ = LatLong; }
99 void set_lat() { enum_ =
static_cast<Enum
>((enum_ & Long) | Lat); }
100 void set_long() { enum_ =
static_cast<Enum
>((enum_ & Lat) | Long); }
102 bool operator==(
const ActuationLevel& other)
const {
return enum_ == other.enum_; }
103 bool operator!=(
const ActuationLevel& other)
const {
return !operator==(other); }
105 const char* to_human_cstr()
const {
110 return "longitudinal";
114 return "longitudinal and lateral";
122 const char* to_symbol_cstr()
const {
139 const char* to_loud_cstr()
const {
156 const char* to_unicode_cstr()
const {
173 const char* to_cstr()
const {
return this->to_human_cstr(); }
182 inline std::string to_string(
const ActuationLevel::Enum level) {
189 #endif // CLOE_UTILITY_ACTUATION_LEVEL_HPP_
nlohmann::json Json
Definition: json.hpp:62
Definition: coordinator.hpp:36
Definition: actuation_level.hpp:50