|
| | BlackboardPyWrapper () |
| | Construct a wrapper with a newly created native Blackboard.
|
| | BlackboardPyWrapper (Blackboard &&other) |
| | Construct a wrapper by moving an existing native Blackboard.
|
| | BlackboardPyWrapper (Blackboard::SharedPtr bb_ptr) |
| | Construct a wrapper from an existing shared native Blackboard.
|
| void | set (const std::string &key, py::object value) |
| | Store a Python object in the blackboard.
|
| py::object | get (const std::string &key) const |
| | Retrieve a Python object from the blackboard.
|
| void | remove (const std::string &key) |
| | Remove a value from the blackboard.
|
| bool | contains (const std::string &key) const |
| | Check whether a key exists in the blackboard.
|
| int | size () const |
| | Get the number of entries in the blackboard.
|
| std::vector< std::string > | keys () const |
| | Get the keys visible in the current remapping scope.
|
| py::list | values () const |
| | Get the values visible in the current remapping scope.
|
| py::list | items () const |
| | Get the key-value pairs visible in the current remapping scope.
|
| std::string | to_string () const |
| | Get a string representation of the blackboard contents.
|
| void | set_remappings (const Remappings &remappings) |
| | Set key remappings on the underlying blackboard.
|
| const Remappings & | get_remappings () const |
| | Get the current key remappings.
|
| Blackboard::SharedPtr | get_cpp_blackboard () const |
| | Access the underlying native blackboard.
|
|
| using | StringVector = std::vector<std::string> |
| | Alias for a typed vector of strings.
|
| using | IntVector = std::vector<std::int64_t> |
| | Alias for a typed vector of integers.
|
| using | FloatVector = std::vector<double> |
| | Alias for a typed vector of floating point values.
|
| using | BoolVector = std::vector<bool> |
| | Alias for a typed vector of booleans.
|
| using | StringDict = std::unordered_map<std::string, std::string> |
| | Alias for a typed dictionary with string values.
|
| using | IntDict = std::unordered_map<std::string, std::int64_t> |
| | Alias for a typed dictionary with integer values.
|
| using | FloatDict = std::unordered_map<std::string, double> |
| | Alias for a typed dictionary with floating point values.
|
| using | BoolDict = std::unordered_map<std::string, bool> |
| | Alias for a typed dictionary with boolean values.
|
|
| static std::vector< uint8_t > | py_buffer_to_vector (const py::handle &value) |
| | Convert a Python bytes-like object into a byte vector.
|
| template<typename ByteT> |
| static py::bytes | byte_vector_to_py_bytes (const std::vector< ByteT > &value) |
| | Convert a C++ byte-like vector into Python bytes.
|
| static bool | is_python_bytes_like (const py::handle &value) |
| | Check whether a Python object is bytes-like.
|
| static bool | is_python_int_like (const py::handle &value) |
| | Check whether a Python object is an integer but not a boolean.
|
| static bool | is_python_float_like (const py::handle &value) |
| | Check whether a Python object is a floating point value.
|
| static bool | is_python_number_like (const py::handle &value) |
| | Check whether a Python object is a numeric value.
|
| static bool | is_python_sequence_like (const py::handle &value) |
| | Check whether a Python object should be treated as a sequence.
|
| template<typename Predicate> |
| static bool | sequence_matches (const py::sequence &seq, Predicate pred) |
| | Check whether all elements of a Python sequence satisfy a predicate.
|
| template<typename T> |
| static std::vector< T > | sequence_to_vector (const py::sequence &seq) |
| | Convert a Python sequence into a typed C++ vector.
|
| static bool | dict_has_only_string_keys (const py::dict &dict) |
| | Check whether all keys in a Python dict are strings.
|
| template<typename Predicate> |
| static bool | dict_values_match (const py::dict &dict, Predicate pred) |
| | Check whether all values of a Python dict satisfy a predicate.
|
| template<typename T> |
| static std::unordered_map< std::string, T > | dict_to_unordered_map (const py::dict &dict) |
| | Convert a Python dict with string keys into a typed unordered_map.
|
| template<typename T> |
| static bool | is_exact_cpp_type (const std::string &type) |
| | Compare a stored type string against an exact C++ type.
|
Python-facing wrapper around the native Blackboard.
The underlying Blackboard stores strongly typed C++ values. This wrapper translates common Python types into matching C++ types on write and converts them back into Python objects on read.
Supported scalar mappings:
- bool <-> bool
- int <-> std::int64_t
- float <-> double
- str <-> std::string
- bytes / bytearray <-> std::vector<uint8_t>
Supported homogeneous container mappings:
- list[str] / tuple[str, ...] <-> std::vector<std::string>
- list[int] / tuple[int, ...] <-> std::vector<std::int64_t>
- list[float] / tuple[float, ...] <-> std::vector<double>
- list[bool] / tuple[bool, ...] <-> std::vector<bool>
- dict[str, str] <-> std::unordered_map<std::string, std::string>
- dict[str, int] <-> std::unordered_map<std::string, std::int64_t>
- dict[str, float] <-> std::unordered_map<std::string, double>
- dict[str, bool] <-> std::unordered_map<std::string, bool>
Mixed containers, nested containers, and empty containers are stored as py::object because no unique native C++ element type can be inferred safely.