ValueXArray¶
- class dsviper.ValueXArray¶
Bases:
objectA class used to represent a value of type xarray<element_type>. Seamless with a Python seq[object].
Or use Value.create(type_xarray [, initial_value]).
- END = 00000000-0000-0000-0000-000000000000¶
- at(position: ValueUUId, *, encoded: bool = True) _OutputValues | None¶
Return the element at the position or None.
- static cast(value: Value) ValueXArray¶
Return a xarray<element_type> or raise.
- copy() ValueXArray¶
Return a deep copy.
- extend(values: Sequence | ValueVector) ValueUUId¶
Extend by appending the values.
- hash() int¶
Return the hash value.
- insert(before_position: ValueUUId, value: _InputValues, new_position: ValueUUId | None = None) ValueUUId¶
Insert the value before_position and return the new position. Use new_position if specified, else a new position is created.
- insert_position(before_position: ValueUUId, new_position: ValueUUId) None¶
Insert before_position a new_position.
- items(*, encoded: bool = True) list[tuple[ValueUUId, Value]]¶
Return the list of (position, value) pairs. With encoded=True (default) a scalar value is a Python native; with encoded=False it is a typed Value.
- rebuild_from(source: ValueXArray, elements: Sequence[tuple[ValueUUId, _InputValues]]) None¶
Rebuild self ATOMICALLY from another XArray’s position layout (positions and deleted positions, copied opaquely from source) together with elements — a sequence of (position, value) pairs. The whole target state is installed in a single step, so self never passes through a partial state (no foreign-typed values, no positions without values). This is the trans-definitions (de)serialization of an XArray: source’s layout verbatim, elements provided already re-mapped to self’s domain.
- representation() str¶
Return the representation.
- to_vector() ValueVector¶
Convert to a vector<element_type>.
- type_code() str¶
Return the type code.
- type_xarray() TypeXArray¶
Return the type xarray<element_type>.