C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
supported_interface_serialization.hpp
Go to the documentation of this file.
1// Copyright (C) 2026 Maik Knof
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16#ifndef YASMIN_ROS__SUPPORTED_INTERFACE_SERIALIZATION_HPP_
17#define YASMIN_ROS__SUPPORTED_INTERFACE_SERIALIZATION_HPP_
18
19#include <functional>
20#include <string>
21#include <unordered_map>
22#include <vector>
23
24#include "yasmin/blackboard.hpp"
25
26namespace yasmin_ros {
27
33 std::function<std::vector<uint8_t>(yasmin::Blackboard::SharedPtr,
34 const std::string &)>
36 std::function<void(yasmin::Blackboard::SharedPtr, const std::string &,
37 const std::vector<uint8_t> &)>
39 std::string blackboard_type;
40};
41
48const std::unordered_map<std::string, InterfaceSerializationHandler> &
50
57bool is_supported_interface_type(const std::string &interface_type);
58
68get_interface_serialization_handler(const std::string &interface_type);
69
75std::vector<std::string> get_supported_interface_types();
76
77} // namespace yasmin_ros
78
79#endif // YASMIN_ROS__SUPPORTED_INTERFACE_SERIALIZATION_HPP_
std::shared_ptr< Blackboard > SharedPtr
Shared pointer type for Blackboard.
Definition blackboard.hpp:100
Definition action_state.hpp:37
bool is_supported_interface_type(const std::string &interface_type)
Check if a given interface type is supported for serialization.
Definition supported_interface_serialization.cpp:69
const InterfaceSerializationHandler & get_interface_serialization_handler(const std::string &interface_type)
Get the serialization handler for a specific interface type.
Definition supported_interface_serialization.cpp:74
const std::unordered_map< std::string, InterfaceSerializationHandler > & get_supported_interface_serialization_handlers()
Get the map of supported interface serialization handlers.
Definition supported_interface_serialization.cpp:65
std::vector< std::string > get_supported_interface_types()
Get a list of supported interface types for serialization.
Definition supported_interface_serialization.cpp:83
A structure to hold the serialization handlers for a specific interface type.
Definition supported_interface_serialization.hpp:32
std::string blackboard_type
Definition supported_interface_serialization.hpp:39
std::function< std::vector< uint8_t >(yasmin::Blackboard::SharedPtr, const std::string &)> serialize_from_blackboard
Definition supported_interface_serialization.hpp:35
std::function< void(yasmin::Blackboard::SharedPtr, const std::string &, const std::vector< uint8_t > &)> deserialize_to_blackboard
Definition supported_interface_serialization.hpp:38