mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
add extra fields to Field datatype
Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
This commit is contained in:
@ -8,6 +8,8 @@ class Field:
|
|||||||
|
|
||||||
name: str
|
name: str
|
||||||
type: type
|
type: type
|
||||||
|
containing_type: Optional[Any]
|
||||||
|
type_size: Optional[int]
|
||||||
value: Any = None
|
value: Any = None
|
||||||
ready: bool = False
|
ready: bool = False
|
||||||
|
|
||||||
@ -75,11 +77,18 @@ class DependencyNode:
|
|||||||
name: str,
|
name: str,
|
||||||
field_type: type,
|
field_type: type,
|
||||||
initial_value: Any = None,
|
initial_value: Any = None,
|
||||||
|
containing_type: Optional[Any] = None,
|
||||||
|
type_size: Optional[int] = None,
|
||||||
ready: bool = False,
|
ready: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Add a field to the node with an optional initial value and readiness state."""
|
"""Add a field to the node with an optional initial value and readiness state."""
|
||||||
self.fields[name] = Field(
|
self.fields[name] = Field(
|
||||||
name=name, type=field_type, value=initial_value, ready=ready
|
name=name,
|
||||||
|
type=field_type,
|
||||||
|
value=initial_value,
|
||||||
|
ready=ready,
|
||||||
|
containing_type=containing_type,
|
||||||
|
type_size=type_size,
|
||||||
)
|
)
|
||||||
# Invalidate readiness cache
|
# Invalidate readiness cache
|
||||||
self._ready_cache = None
|
self._ready_cache = None
|
||||||
|
|||||||
Reference in New Issue
Block a user