AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
NodeManifest Class Reference

#include <auto_apms_behavior_tree/node/node_manifest.hpp>

Public Types

using Params = NodeRegistrationParams
 
using ParamMap = std::map<std::string, NodeRegistrationParams>
 

Public Member Functions

 NodeManifest (const ParamMap &param_map={})
 
bool contains (const std::string &node_name) const
 
NodeRegistrationParamsoperator[] (const std::string &node_name)
 
const NodeRegistrationParamsoperator[] (const std::string &node_name) const
 
NodeManifestadd (const std::string &node_name, const NodeRegistrationParams &p)
 
NodeManifestremove (const std::string &node_name)
 
NodeManifestmerge (const NodeManifest &m)
 
NodeManifestautoComplete (NodePluginClassLoader &class_loader)
 
void toFile (const std::string &file_path) const
 
std::string toString () const
 
const ParamMapgetInternalMap () const
 

Static Public Member Functions

static NodeManifest fromFiles (const std::vector< std::string > &file_paths)
 
static NodeManifest fromFile (const std::string &file_path)
 
static NodeManifest fromString (const std::string &manifest_str)
 

Static Public Attributes

static const std::string PARAM_NAME_CLASS = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_CLASS
 
static const std::string PARAM_NAME_PACKAGE = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_PACKAGE
 
static const std::string PARAM_NAME_LIBRARY = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_LIBRARY
 
static const std::string PARAM_NAME_PORT = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_PORT
 
static const std::string PARAM_NAME_WAIT_TIMEOUT = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_WAIT_TIMEOUT
 
static const std::string PARAM_NAME_REQUEST_TIMEOUT = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_REQUEST_TIMEOUT
 

Detailed Description

Data structure for resource lookup data and configuration parameters required for loading and registering multiple behavior tree node plugins.

Definition at line 28 of file node_manifest.hpp.

Member Typedef Documentation

◆ Params

Definition at line 31 of file node_manifest.hpp.

◆ ParamMap

using ParamMap = std::map<std::string, NodeRegistrationParams>

Mapping of a node's name and its registration parameters.

Definition at line 34 of file node_manifest.hpp.

Constructor & Destructor Documentation

◆ NodeManifest()

NodeManifest ( const ParamMap & param_map = {})

Definition at line 123 of file node_manifest.cpp.

Member Function Documentation

◆ fromFiles()

NodeManifest fromFiles ( const std::vector< std::string > & file_paths)
static

Create a node plugin manifest from multiple files. They are loaded in the given order.

Parameters
file_pathsPaths to the manifest files.

Definition at line 127 of file node_manifest.cpp.

◆ fromFile()

NodeManifest fromFile ( const std::string & file_path)
static

Create a node plugin manifest from a file.

Parameters
file_pathPath to the manifest file.

Definition at line 140 of file node_manifest.cpp.

◆ fromString()

NodeManifest fromString ( const std::string & manifest_str)
static

Definition at line 145 of file node_manifest.cpp.

◆ contains()

bool contains ( const std::string & node_name) const

Definition at line 152 of file node_manifest.cpp.

◆ operator[]() [1/2]

NodeManifest::Params & operator[] ( const std::string & node_name)

Definition at line 157 of file node_manifest.cpp.

◆ operator[]() [2/2]

const NodeManifest::Params & operator[] ( const std::string & node_name) const

Definition at line 165 of file node_manifest.cpp.

◆ add()

NodeManifest & add ( const std::string & node_name,
const NodeRegistrationParams & p )

Definition at line 173 of file node_manifest.cpp.

◆ remove()

NodeManifest & remove ( const std::string & node_name)

Definition at line 184 of file node_manifest.cpp.

◆ merge()

NodeManifest & merge ( const NodeManifest & m)

Definition at line 195 of file node_manifest.cpp.

◆ autoComplete()

NodeManifest & autoComplete ( NodePluginClassLoader & class_loader)

Automatically fill node plugin resource information in manifest.

This function autocompletes the package and library fields of the manifest if possible. Depending on the value of the package field, the manifest will be updated:

  • Package undefined: The library path will be resolved by looking up the class name in class_loader.
  • Package defined: The library path will be resolved by looking up the class name in class_loader considering only resources registered by the given package.

The library parameter will be overwritten in any case. Other parameters remain the same and are simply copied.

This method is used internally. Mostly for introspection purposes.

Parameters
class_loaderpluginlib::ClassLoader object managing behavior tree node plugin resources.
Returns
Reference to the altered manifest object.
Exceptions
auto_apms_core::exceptions::ResourceNotFoundErrorif no unique resource for a node can be found, thus the library path cannot be filled automatically.

Definition at line 202 of file node_manifest.cpp.

◆ toFile()

void toFile ( const std::string & file_path) const

Definition at line 233 of file node_manifest.cpp.

◆ toString()

std::string toString ( ) const

Definition at line 249 of file node_manifest.cpp.

◆ getInternalMap()

const NodeManifest::ParamMap & getInternalMap ( ) const

Definition at line 258 of file node_manifest.cpp.

Member Data Documentation

◆ PARAM_NAME_CLASS

const std::string PARAM_NAME_CLASS = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_CLASS
static

Definition at line 36 of file node_manifest.hpp.

◆ PARAM_NAME_PACKAGE

const std::string PARAM_NAME_PACKAGE = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_PACKAGE
static

Definition at line 37 of file node_manifest.hpp.

◆ PARAM_NAME_LIBRARY

const std::string PARAM_NAME_LIBRARY = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_LIBRARY
static

Definition at line 38 of file node_manifest.hpp.

◆ PARAM_NAME_PORT

const std::string PARAM_NAME_PORT = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_PORT
static

Definition at line 39 of file node_manifest.hpp.

◆ PARAM_NAME_WAIT_TIMEOUT

const std::string PARAM_NAME_WAIT_TIMEOUT = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_WAIT_TIMEOUT
static

Definition at line 40 of file node_manifest.hpp.

◆ PARAM_NAME_REQUEST_TIMEOUT

const std::string PARAM_NAME_REQUEST_TIMEOUT = _AUTO_APMS_BEHAVIOR_TREE__NODE_MANIFEST_PARAM_REQUEST_TIMEOUT
static

Definition at line 41 of file node_manifest.hpp.


The documentation for this class was generated from the following files: