AutoAPMS
Streamlining behaviors in ROS 2
Loading...
Searching...
No Matches
TreeResourceIdentity Struct Reference

Struct that encapsulates the identity string for a registered behavior tree. More...

#include <auto_apms_behavior_tree_core/tree/tree_resource.hpp>

Inheritance diagram for TreeResourceIdentity:

Public Member Functions

 TreeResourceIdentity (const std::string &identity)
 Constructor of a tree resource identity object.
 
 TreeResourceIdentity (const char *identity)
 Constructor of a tree resource identity object.
 
 TreeResourceIdentity ()=default
 Constructor of an empty behavior tree resource identity object.
 
- Public Member Functions inherited from BehaviorResourceIdentity
 BehaviorResourceIdentity (const std::string &identity)
 Constructor of a behavior resource identity object.
 
 BehaviorResourceIdentity (const std::string &identity, const std::string &default_category)
 Constructor of a behavior resource identity object.
 
 BehaviorResourceIdentity (const char *identity)
 Constructor of a behavior resource identity object.
 
 BehaviorResourceIdentity ()=default
 Constructor of an empty behavior resource identity object.
 
std::string str () const
 Create the corresponding identity string.
 
bool empty () const
 Determine whether this behavior resource identity object is considered empty.
 

Public Attributes

std::string file_stem
 Name of the file (without extension) that contains the resource's tree document.
 
std::string tree_name
 Name of a specific tree inside the resource's tree document.
 
- Public Attributes inherited from BehaviorResourceIdentity
std::string category_name
 Name of the category this behavior resource belongs to.
 
std::string package_name
 Name of the package that registers the behavior resource.
 
std::string behavior_alias
 Alias for a single registered behavior.
 

Detailed Description

Struct that encapsulates the identity string for a registered behavior tree.

Its only purpose is to create the corresponding instance of TreeResource.

The identity string is formatted like <package_name>::<tree_file_stem>::<tree_name>. Since TreeResource uses the same identity resolution as BehaviorResource (where <behavior_alias> = <tree_file_stem>::<tree_name>), all short forms documented in BehaviorResourceIdentity apply. Both <tree_file_stem> and <tree_name> must always be provided.

Note
Because the behavior alias for tree resources contains ::, the bare alias form <tree_file_stem>::<tree_name> is ambiguous with the <package_name>::<behavior_alias> form of BehaviorResourceIdentity. You must use at least <package_name>::<tree_file_stem>::<tree_name> when constructing a TreeResourceIdentity from a string (<package_name> can be empty though). For partial lookups, use TreeResource::findByTreeName() or TreeResource::findByFileStem().

Definition at line 43 of file tree_resource.hpp.

Constructor & Destructor Documentation

◆ TreeResourceIdentity() [1/3]

TreeResourceIdentity ( const std::string & identity)

Constructor of a tree resource identity object.

identity must be formatted like <package_name>::<tree_file_stem>::<tree_name>.

Parameters
identityIdentity string for a specific behavior tree resource.
Exceptions
auto_apms_util::exceptions::ResourceIdentityFormatErrorif the identity string has wrong format.

Definition at line 31 of file tree_resource.cpp.

◆ TreeResourceIdentity() [2/3]

TreeResourceIdentity ( const char * identity)

Constructor of a tree resource identity object.

identity must be formatted like <package_name>::<tree_file_stem>::<tree_name>.

Parameters
identityC-style identity string for a specific behavior tree resource.
Exceptions
auto_apms_util::exceptions::ResourceIdentityFormatErrorif the identity string has wrong format.

Definition at line 52 of file tree_resource.cpp.

◆ TreeResourceIdentity() [3/3]

TreeResourceIdentity ( )
default

Constructor of an empty behavior tree resource identity object.

The user must manually populate the member fields.

Member Data Documentation

◆ file_stem

std::string file_stem

Name of the file (without extension) that contains the resource's tree document.

Definition at line 71 of file tree_resource.hpp.

◆ tree_name

std::string tree_name

Name of a specific tree inside the resource's tree document.

Definition at line 73 of file tree_resource.hpp.


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