cpp_delegate Package¶
cpp_delegate Package¶
address_of Module¶
context Module¶
-
class
cpp_delegate.context.RemoteContext(stream, cpp_ast_json, namespace='')[source]¶ Bases:
cpp_delegate.context.Context,cpp_delegate.dir_mixin.DirMixInThis class provides access to public variables and fields within a remote context (i.e., namespace).
Variables and fields are accessible as Python attributes, allowing, for example, tab completion in IPython.
Parameters: - stream (serial.Serial) – A serial connection to the remote device.
- cpp_ast_json (dict) – A JSON-serializable C++ abstract syntax tree, as parsed by clang_helpers.clang_ast.parse_cpp_ast(…, format=’json’).
- namespace (str, optional) –
A namespace specifier (e.g.,
"foo::bar") indicating the namespace to expose.A value of
""corresponds to the top-level namespace.
-
.<remote variable/field> An attribute corresponding to each public variable or field within the remote context
namespace.
-
_address_of(label)[source]¶ Parameters: label (str) – Name/label of variable or field in remote context. Returns: Address in memory of specified variable or field in remote context. Return type: int
-
_mem_read(address, size)[source]¶ Parameters: Returns: Array of data read from remote context.
Return type: np.array(dtype=’uint8’)
See also
-
_mem_write(address, data)[source]¶ Write data to specified address in remote context.
Parameters: - address (int) – Memory address in remote context.
- data (numpy.array-like) – Array or :module:`numpy` data type.
See also
-
_read_attribute(attr, *args)[source]¶ Parameters: Returns: Value of specified attribute in remote context.
If type is not supported (i.e., not a plain old data type),
defaultis returned (if specified).Return type: type of attr
-
_read_attributes()[source]¶ Returns: Value of each attribute in remote context. For each attribute, if type is not supported (i.e., not a plain old data type), value is set to
None.Return type: dict See also
-
cpp_delegate.context.operation_code(v)¶