A wrapper around the C++ Blackboard that stores Python objects and native types.
More...
#include <blackboard_pywrapper.hpp>
|
| | BlackboardPyWrapper () |
| |
| | BlackboardPyWrapper (Blackboard &&other) |
| | Construct from an existing C++ Blackboard (move constructor)
|
| |
| | BlackboardPyWrapper (std::shared_ptr< Blackboard > bb_ptr) |
| | Construct by wrapping a shared_ptr to a C++ Blackboard.
|
| |
| void | set (const std::string &key, py::object value) |
| | Set a Python object in the blackboard.
|
| |
| py::object | get (const std::string &key) |
| | Get a Python object from the blackboard.
|
| |
| void | remove (const std::string &key) |
| | Remove a value from the blackboard.
|
| |
| bool | contains (const std::string &key) |
| | Check if a key exists in the blackboard.
|
| |
| int | size () |
| | Get the number of key-value pairs in the blackboard.
|
| |
| std::string | to_string () |
| | Convert the contents of the blackboard to a string.
|
| |
| void | set_remappings (const std::map< std::string, std::string > &remappings) |
| | Set the remappings of the blackboard.
|
| |
| std::map< std::string, std::string > | get_remappings () |
| | Get the remappings of the blackboard.
|
| |
| std::shared_ptr< Blackboard > | get_cpp_blackboard () |
| | Get a shared pointer to the underlying C++ Blackboard.
|
| |
A wrapper around the C++ Blackboard that stores Python objects and native types.
This wrapper provides a Python-friendly interface to the C++ Blackboard, automatically converting between C++ types (like std::string) and Python objects when accessing blackboard values.
◆ BlackboardPyWrapper() [1/3]
| yasmin::blackboard::BlackboardPyWrapper::BlackboardPyWrapper |
( |
| ) |
|
|
inline |
◆ BlackboardPyWrapper() [2/3]
| yasmin::blackboard::BlackboardPyWrapper::BlackboardPyWrapper |
( |
Blackboard && | other | ) |
|
|
inline |
Construct from an existing C++ Blackboard (move constructor)
◆ BlackboardPyWrapper() [3/3]
| yasmin::blackboard::BlackboardPyWrapper::BlackboardPyWrapper |
( |
std::shared_ptr< Blackboard > | bb_ptr | ) |
|
|
inlineexplicit |
Construct by wrapping a shared_ptr to a C++ Blackboard.
◆ contains()
| bool yasmin::blackboard::BlackboardPyWrapper::contains |
( |
const std::string & | key | ) |
|
|
inline |
Check if a key exists in the blackboard.
- Parameters
-
- Returns
- True if the key exists, false otherwise.
◆ get()
| py::object yasmin::blackboard::BlackboardPyWrapper::get |
( |
const std::string & | key | ) |
|
|
inline |
Get a Python object from the blackboard.
- Parameters
-
| key | The key associated with the value. |
- Returns
- The Python object.
- Exceptions
-
| std::runtime_error | if the key does not exist. |
◆ get_cpp_blackboard()
| std::shared_ptr< Blackboard > yasmin::blackboard::BlackboardPyWrapper::get_cpp_blackboard |
( |
| ) |
|
|
inline |
◆ get_remappings()
| std::map< std::string, std::string > yasmin::blackboard::BlackboardPyWrapper::get_remappings |
( |
| ) |
|
|
inline |
Get the remappings of the blackboard.
- Returns
- The remappings of the blackboard.
◆ remove()
| void yasmin::blackboard::BlackboardPyWrapper::remove |
( |
const std::string & | key | ) |
|
|
inline |
Remove a value from the blackboard.
- Parameters
-
| key | The key associated with the value to remove. |
◆ set()
| void yasmin::blackboard::BlackboardPyWrapper::set |
( |
const std::string & | key, |
|
|
py::object | value ) |
|
inline |
Set a Python object in the blackboard.
- Parameters
-
| key | The key to associate with the value. |
| value | The Python object to store. |
◆ set_remappings()
| void yasmin::blackboard::BlackboardPyWrapper::set_remappings |
( |
const std::map< std::string, std::string > & | remappings | ) |
|
|
inline |
Set the remappings of the blackboard.
- Parameters
-
| remappings | The remappings to set. |
◆ size()
| int yasmin::blackboard::BlackboardPyWrapper::size |
( |
| ) |
|
|
inline |
Get the number of key-value pairs in the blackboard.
- Returns
- The size of the blackboard.
◆ to_string()
| std::string yasmin::blackboard::BlackboardPyWrapper::to_string |
( |
| ) |
|
|
inline |
Convert the contents of the blackboard to a string.
- Returns
- A string representation of the blackboard.
◆ blackboard
| std::shared_ptr<Blackboard> yasmin::blackboard::BlackboardPyWrapper::blackboard |
|
private |
The documentation for this class was generated from the following file: