AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
node_manifest.hpp
Go to the documentation of this file.
1// Copyright 2024 Robin Müller
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
19
21{
22
29{
30public:
32
34 using ParamMap = std::map<std::string, NodeRegistrationParams>;
35
36 static const std::string PARAM_NAME_CLASS;
37 static const std::string PARAM_NAME_PACKAGE;
38 static const std::string PARAM_NAME_LIBRARY;
39 static const std::string PARAM_NAME_PORT;
40 static const std::string PARAM_NAME_WAIT_TIMEOUT;
41 static const std::string PARAM_NAME_REQUEST_TIMEOUT;
42
43 NodeManifest(const ParamMap& param_map = {});
44
49 static NodeManifest fromFiles(const std::vector<std::string>& file_paths);
50
55 static NodeManifest fromFile(const std::string& file_path);
56
57 static NodeManifest fromString(const std::string& manifest_str);
58
59 bool contains(const std::string& node_name) const;
60
61 NodeRegistrationParams& operator[](const std::string& node_name);
62 const NodeRegistrationParams& operator[](const std::string& node_name) const;
63
64 NodeManifest& add(const std::string& node_name, const NodeRegistrationParams& p);
65
66 NodeManifest& remove(const std::string& node_name);
67
69
92
93 void toFile(const std::string& file_path) const;
94
95 std::string toString() const;
96
97 const ParamMap& getInternalMap() const;
98
99private:
100 ParamMap param_map_;
101};
102
103} // namespace auto_apms_behavior_tree
Data structure for resource lookup data and configuration parameters required for loading and registe...
static const std::string PARAM_NAME_REQUEST_TIMEOUT
static NodeManifest fromFile(const std::string &file_path)
Create a node plugin manifest from a file.
const ParamMap & getInternalMap() const
NodeManifest & merge(const NodeManifest &m)
static const std::string PARAM_NAME_CLASS
static const std::string PARAM_NAME_PACKAGE
bool contains(const std::string &node_name) const
static const std::string PARAM_NAME_LIBRARY
std::map< std::string, NodeRegistrationParams > ParamMap
Mapping of a node's name and its registration parameters.
static NodeManifest fromString(const std::string &manifest_str)
static const std::string PARAM_NAME_WAIT_TIMEOUT
static NodeManifest fromFiles(const std::vector< std::string > &file_paths)
Create a node plugin manifest from multiple files. They are loaded in the given order.
void toFile(const std::string &file_path) const
static const std::string PARAM_NAME_PORT
NodeManifest & add(const std::string &node_name, const NodeRegistrationParams &p)
NodeManifest(const ParamMap &param_map={})
NodeManifest & autoComplete(NodePluginClassLoader &class_loader)
Automatically fill node plugin resource information in manifest.
NodeManifest & remove(const std::string &node_name)
NodeRegistrationParams & operator[](const std::string &node_name)
Version of pluginlib::ClassLoader specifically for loading installed behavior tree node plugins.
Behavior tree node registration parameters.