AutoAPMS
Streamlining behaviors in ROS 2
Loading...
Searching...
No Matches
BehaviorResourceTemplate< T, typename > Class Template Reference

Helper temlpate class for creating behavior resource abstractions. More...

#include <auto_apms_behavior_tree_core/behavior.hpp>

Public Member Functions

 BehaviorResourceTemplate (const Identity &search_identity)
 Assemble a behavior resource using a BehaviorResourceIdentity.
 
 BehaviorResourceTemplate (const std::string &search_identity)
 Assemble a behavior resource identified by a string.
 
 BehaviorResourceTemplate (const char *search_identity)
 Assemble a behavior tree resource identified by a string.
 
const Identity & getIdentity () const
 Get the unique identity for this resource.
 
const std::string & getBuildRequest () const
 Get the behavior build request associated with this resource.
 
const std::string & getDefaultBuildHandlerName () const
 Get the fully qualified class name of the default build handler associated with this behavior resource.
 
const std::string & getEntrypoint () const
 Get the entrypoint of this behavior resource.
 
const NodeManifestgetNodeManifest () const
 Get the node manifest associated with this resource.
 

Static Public Member Functions

static BehaviorResourceTemplate find (const std::string &behavior_alias, const std::string &package_name="", const std::string &category_name="")
 Find an installed behavior resource using a specific behavior tree name.
 

Detailed Description

template<class T, typename = std::enable_if_t<std::is_base_of_v<BehaviorResourceIdentity, T>>>
class auto_apms_behavior_tree::core::BehaviorResourceTemplate< T, typename >

Helper temlpate class for creating behavior resource abstractions.

Template Parameters
TResource identity type.

Definition at line 119 of file behavior.hpp.

Constructor & Destructor Documentation

◆ BehaviorResourceTemplate() [1/3]

template<class T, typename U>
BehaviorResourceTemplate ( const Identity & search_identity)
inline

Assemble a behavior resource using a BehaviorResourceIdentity.

Parameters
search_identityBehavior resource identity object used for searching the corresponding resource.
Exceptions
auto_apms_util::exceptions::ResourceErrorif the resource cannot be found using the given identity.

Definition at line 287 of file behavior.hpp.

◆ BehaviorResourceTemplate() [2/3]

template<class T, typename U>
BehaviorResourceTemplate ( const std::string & search_identity)
inline

Assemble a behavior resource identified by a string.

search_identity must be formatted like <category_name>/<package_name>::<behavior_alias>.

Parameters
search_identityBehavior resource identity string used for searching the corresponding resource.
Exceptions
auto_apms_util::exceptions::ResourceIdentityFormatErrorif the identity string has wrong format.
auto_apms_util::exceptions::ResourceErrorif the resource cannot be found using the given identity string.

Definition at line 385 of file behavior.hpp.

◆ BehaviorResourceTemplate() [3/3]

template<class T, typename U>
BehaviorResourceTemplate ( const char * search_identity)
inline

Assemble a behavior tree resource identified by a string.

search_identity must be formatted like <category_name>/<package_name>::<behavior_alias>.

Parameters
search_identityC-style behavior resource identity string used for searching the corresponding resource.
Exceptions
auto_apms_util::exceptions::ResourceIdentityFormatErrorif the identity string has wrong format.
auto_apms_util::exceptions::ResourceErrorif the resource cannot be found using the given identity string.

Definition at line 391 of file behavior.hpp.

Member Function Documentation

◆ find()

template<class T, typename U>
BehaviorResourceTemplate< T, U > find ( const std::string & behavior_alias,
const std::string & package_name = "",
const std::string & category_name = "" )
inlinestatic

Find an installed behavior resource using a specific behavior tree name.

This method can be used as an alternative to passing an identity string to the constructor.

Parameters
behavior_aliasName of the desired resource. Is determined when registering the behavior with auto_apms_behavior_tree_register_behavior.
package_nameOptional package name provided to narrow down the search. If empty, search in all installed packages.
category_nameOptional category name provided to narrow down the search. If empty, search in all installed packages.
Returns
Corresponding behavior resource object.
Exceptions
auto_apms_util::exceptions::ResourceErrorif the corresponding behavior resource cannot be found using the given arguments.

Definition at line 397 of file behavior.hpp.

◆ getIdentity()

template<class T, typename U>
const T & getIdentity ( ) const
inline

Get the unique identity for this resource.

Returns
Identity object.

Definition at line 406 of file behavior.hpp.

◆ getBuildRequest()

template<class T, typename U>
const std::string & getBuildRequest ( ) const
inline

Get the behavior build request associated with this resource.

Returns
Build request as a string.

Definition at line 412 of file behavior.hpp.

◆ getDefaultBuildHandlerName()

template<class T, typename U>
const std::string & getDefaultBuildHandlerName ( ) const
inline

Get the fully qualified class name of the default build handler associated with this behavior resource.

Returns
Name of the default build handler.

Definition at line 418 of file behavior.hpp.

◆ getEntrypoint()

template<class T, typename U>
const std::string & getEntrypoint ( ) const
inline

Get the entrypoint of this behavior resource.

Returns
Entry point as a string.

Definition at line 424 of file behavior.hpp.

◆ getNodeManifest()

template<class T, typename U>
const NodeManifest & getNodeManifest ( ) const
inline

Get the node manifest associated with this resource.

Returns
Node manifest object.

Definition at line 430 of file behavior.hpp.


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