IDictionary#
- class carb.dictionary.IDictionary#
Bases:
pybind11_objectDictionary interface for hierarchical key/value data.
Methods
__init__(*args, **kwargs)create_item(self, arg0, arg1, arg2)Creates or returns an item at the given path under the optional parent.
destroy_item(self, arg0)Destroys the given item.
get(self, base_item[, path])Gets a Python object representation for the item at path.
get_array_length(self, arg0)Gets the array length for an array-typed item.
get_as_bool(self, arg0)Returns the value as bool.
get_as_float(self, arg0)Returns the value as float.
get_as_int(self, arg0)Returns the value as int.
get_as_string(self, base_item[, path])Returns the string value for an item at path relative to base_item.
get_dict_copy(self, base_item[, path])Creates python object from the supplied dictionary at path (supplied item is unchanged).
get_item(self, base_item[, path])Gets a child item by path relative to a base item.
get_item_child_by_index(self, arg0, arg1)Gets a child by index (0-based).
get_item_child_by_index_mutable(self, arg0, arg1)Gets a mutable child by index (0-based).
get_item_child_count(self, arg0)Returns the number of children for an item.
get_item_mutable(self, base_item[, path])Gets a mutable child item by path relative to a base item.
get_item_name(self, base_item[, path])Gets the key name for an item at path relative to base_item.
get_item_parent(self, arg0)Gets the parent item.
get_item_parent_mutable(self, arg0)Gets the parent item (mutable).
get_item_type(self, arg0)Returns the ItemType for the given item.
get_preferred_array_type(self, arg0)Gets the preferred array element ItemType.
is_accessible_as(self, arg0, arg1)Checks if an item can be accessed as a type.
is_accessible_as_array_of(self, arg0, arg1)Checks if an item is accessible as an array of a type.
readLock(self, arg0)Acquires a shared read lock for the item.
set(self, item, path, value)Sets a value at path from a Python object.
set_bool(self, arg0, arg1)Sets the value as bool.
set_bool_array(self, arg0, arg1)Sets an array of booleans.
set_float(self, arg0, arg1)Sets the value as float.
set_float_array(self, arg0, arg1)Sets an array of floats.
set_int(self, arg0, arg1)Sets the value as int.
set_int_array(self, arg0, arg1)Sets an array of integers.
set_string(self, arg0, arg1)Sets the string value for an item.
set_string_array(self, arg0, arg1)Sets an array of strings.
unlock(self, arg0)Releases a previously acquired read/write lock.
update(self, arg0, arg1, arg2, arg3, arg4)Merges source subtree into destination.
writeLock(self, arg0)Acquires an exclusive write lock for the item.
- __init__(*args, **kwargs)#
- create_item(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: object,
- arg1: str,
- arg2: carb.dictionary._dictionary.ItemType,
Creates or returns an item at the given path under the optional parent.
- destroy_item( ) None#
Destroys the given item.
- get(
- self: carb.dictionary._dictionary.IDictionary,
- base_item: carb.dictionary._dictionary.Item,
- path: str = '',
Gets a Python object representation for the item at path.
- get_array_length( ) int#
Gets the array length for an array-typed item.
- get_as_bool( ) bool#
Returns the value as bool.
Zero/empty are False; non-zero/true-like strings are True; dictionaries are False.
- get_as_float( ) float#
Returns the value as float.
Converts from other numeric types or from a numeric string when possible.
- get_as_int( ) int#
Returns the value as int.
Converts from other numeric types or from a numeric string when possible. Strings outside int64 range may clamp.
- get_as_string(
- self: carb.dictionary._dictionary.IDictionary,
- base_item: carb.dictionary._dictionary.Item,
- path: str = '',
Returns the string value for an item at path relative to base_item.
- get_dict_copy(
- self: carb.dictionary._dictionary.IDictionary,
- base_item: carb.dictionary._dictionary.Item,
- path: str = '',
Creates python object from the supplied dictionary at path (supplied item is unchanged). Item is calculated via the path relative to the base item.
- Parameters:
base_item – The base item.
path – Path, relative to the base item - to the item
- Returns:
Python object with copies of the item data.
- get_item(
- self: carb.dictionary._dictionary.IDictionary,
- base_item: carb.dictionary._dictionary.Item,
- path: str = '',
Gets a child item by path relative to a base item.
- Parameters:
base_item – The base dictionary item.
path – Relative path to the desired child (’’ for base).
- Returns:
Item or None.
- get_item_child_by_index(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: int,
Gets a child by index (0-based). Returns Item or None.
- get_item_child_by_index_mutable(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: int,
Gets a mutable child by index (0-based). Returns Item or None.
- get_item_child_count( ) int#
Returns the number of children for an item.
- get_item_mutable(
- self: carb.dictionary._dictionary.IDictionary,
- base_item: carb.dictionary._dictionary.Item,
- path: str = '',
Gets a mutable child item by path relative to a base item.
- get_item_name(
- self: carb.dictionary._dictionary.IDictionary,
- base_item: carb.dictionary._dictionary.Item,
- path: str = '',
Gets the key name for an item at path relative to base_item.
- get_item_parent( ) carb.dictionary._dictionary.Item#
Gets the parent item. Returns Item or None.
- get_item_parent_mutable( ) carb.dictionary._dictionary.Item#
Gets the parent item (mutable). Returns Item or None.
- get_item_type( ) carb.dictionary._dictionary.ItemType#
Returns the ItemType for the given item.
- get_preferred_array_type( ) carb.dictionary._dictionary.ItemType#
Gets the preferred array element ItemType.
- is_accessible_as(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.ItemType,
- arg1: carb.dictionary._dictionary.Item,
Checks if an item can be accessed as a type.
- is_accessible_as_array_of(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.ItemType,
- arg1: carb.dictionary._dictionary.Item,
Checks if an item is accessible as an array of a type.
- readLock( ) None#
Acquires a shared read lock for the item.
When finished, unlock with unlock().
- set(
- self: carb.dictionary._dictionary.IDictionary,
- item: carb.dictionary._dictionary.Item,
- path: str = '',
- value: handle,
Sets a value at path from a Python object.
- set_bool(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: bool,
Sets the value as bool.
If an item exists, its type becomes BOOL; dictionary items lose their children.
- set_bool_array(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: List[bool],
Sets an array of booleans.
- set_float(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: float,
Sets the value as float.
If an item exists, its type becomes FLOAT; dictionary items lose their children.
- set_float_array(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: List[float],
Sets an array of floats.
- set_int(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: int,
Sets the value as int.
If an item exists, its type becomes INT; dictionary items lose their children.
- set_int_array(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: List[int],
Sets an array of integers.
- set_string(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: str,
Sets the string value for an item.
- set_string_array(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: List[str],
Sets an array of strings.
- unlock( ) None#
Releases a previously acquired read/write lock.
- update(
- self: carb.dictionary._dictionary.IDictionary,
- arg0: carb.dictionary._dictionary.Item,
- arg1: str,
- arg2: carb.dictionary._dictionary.Item,
- arg3: str,
- arg4: object,
Merges source subtree into destination.
- Parameters:
dst_item – Destination base item (or None for root).
dst_path – Relative path under dst_item.
src_item – Source base item.
src_path – Relative path under src_item.
update_policy – dictionary.UpdateAction or callable controlling merge behavior.
Notes
Destination-only items remain unchanged.
If the destination path doesn’t exist, it is created.
Merge behavior is decided per-item by the callback or action.
- writeLock( ) None#
Acquires an exclusive write lock for the item.
When finished, unlock with unlock().