Modulo 5.0.0
Loading...
Searching...
No Matches
concepts.hpp
1#pragma once
2
3#include "modulo_core/EncodedState.hpp"
4
5#include <state_representation/State.hpp>
6#include <std_msgs/msg/bool.hpp>
7#include <std_msgs/msg/float64.hpp>
8#include <std_msgs/msg/float64_multi_array.hpp>
9#include <std_msgs/msg/int32.hpp>
10#include <std_msgs/msg/string.hpp>
11
12namespace modulo_core::concepts {
13
14// Data type concepts
15
16template<typename T>
17concept PrimitiveDataT = std::same_as<T, bool> || std::same_as<T, double> || std::same_as<T, std::vector<double>>
18 || std::same_as<T, int> || std::same_as<T, std::string>;
19
20template<typename T>
21concept CoreDataT = std::derived_from<T, state_representation::State> || PrimitiveDataT<T>;
22
23// Message type concepts
24
25template<typename T>
26concept TranslatedMsgT = std::same_as<T, std_msgs::msg::Bool> || std::same_as<T, std_msgs::msg::Float64>
27 || std::same_as<T, std_msgs::msg::Float64MultiArray> || std::same_as<T, std_msgs::msg::Int32>
28 || std::same_as<T, std_msgs::msg::String> || std::same_as<T, modulo_core::EncodedState>;
29
30template<typename T>
31concept CustomT = !CoreDataT<T> && !std::same_as<T, modulo_core::EncodedState>;
32
33}// namespace modulo_core::concepts