The Blackboard is the mechanism used by BehaviorTrees to exchange typed data. More...
#include <blackboard.h>
Classes | |
struct | Entry |
Public Types | |
typedef std::shared_ptr < Blackboard > | Ptr |
Public Member Functions | |
void | addSubtreeRemapping (std::string internal, std::string external) |
void | debugMessage () const |
template<typename T > | |
bool | get (const std::string &key, T &value) const |
template<typename T > | |
T | get (const std::string &key) const |
const Any * | getAny (const std::string &key) const |
The method getAny allow the user to access directly the type erased value. | |
Any * | getAny (const std::string &key) |
const PortInfo * | portInfo (const std::string &key) |
template<typename T > | |
void | set (const std::string &key, const T &value) |
Update the entry with the given key. | |
void | setPortInfo (std::string key, const PortInfo &info) |
virtual | ~Blackboard () |
Static Public Member Functions | |
static Blackboard::Ptr | create (Blackboard::Ptr parent={}) |
Protected Member Functions | |
Blackboard (Blackboard::Ptr parent) | |
Private Attributes | |
std::unordered_map < std::string, std::string > | internal_to_external_ |
std::mutex | mutex_ |
std::weak_ptr< Blackboard > | parent_bb_ |
std::unordered_map < std::string, Entry > | storage_ |
The Blackboard is the mechanism used by BehaviorTrees to exchange typed data.
Definition at line 23 of file blackboard.h.
typedef std::shared_ptr<Blackboard> BT::Blackboard::Ptr |
Definition at line 26 of file blackboard.h.
BT::Blackboard::Blackboard | ( | Blackboard::Ptr | parent | ) | [inline, protected] |
Definition at line 30 of file blackboard.h.
virtual BT::Blackboard::~Blackboard | ( | ) | [virtual] |
void BT::Blackboard::addSubtreeRemapping | ( | std::string | internal, |
std::string | external | ||
) |
Definition at line 45 of file blackboard.cpp.
static Blackboard::Ptr BT::Blackboard::create | ( | ) | [inline, static] |
Use this static method to create an instance of the BlackBoard to share among all your NodeTrees.
Definition at line 38 of file blackboard.h.
void BT::Blackboard::debugMessage | ( | ) | const |
Definition at line 50 of file blackboard.cpp.
bool BT::Blackboard::get | ( | const std::string & | key, |
T & | value | ||
) | const [inline] |
Return true if the entry with the given key was found. Note that this method may throw an exception if the cast to T failed.
Definition at line 87 of file blackboard.h.
T BT::Blackboard::get | ( | const std::string & | key | ) | const [inline] |
Version of get() that throws if it fails.
Definition at line 101 of file blackboard.h.
const Any* BT::Blackboard::getAny | ( | const std::string & | key | ) | const [inline] |
The method getAny allow the user to access directly the type erased value.
Definition at line 51 of file blackboard.h.
Any* BT::Blackboard::getAny | ( | const std::string & | key | ) | [inline] |
Definition at line 67 of file blackboard.h.
const PortInfo * BT::Blackboard::portInfo | ( | const std::string & | key | ) |
Definition at line 34 of file blackboard.cpp.
void BT::Blackboard::set | ( | const std::string & | key, |
const T & | value | ||
) | [inline] |
Update the entry with the given key.
Definition at line 117 of file blackboard.h.
void BT::Blackboard::setPortInfo | ( | std::string | key, |
const PortInfo & | info | ||
) |
Definition at line 5 of file blackboard.cpp.
std::unordered_map<std::string,std::string> BT::Blackboard::internal_to_external_ [private] |
Definition at line 209 of file blackboard.h.
std::mutex BT::Blackboard::mutex_ [mutable, private] |
Definition at line 206 of file blackboard.h.
std::weak_ptr<Blackboard> BT::Blackboard::parent_bb_ [private] |
Definition at line 208 of file blackboard.h.
std::unordered_map<std::string, Entry> BT::Blackboard::storage_ [private] |
Definition at line 207 of file blackboard.h.