RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
gui.repository_model.TreeNode Class Reference

This represents a tree node in the repository tree model that also contains cached data. More...

Classes

class  _MetaData
 Internal helper class to hold mutable metadata fields for the tree node. More...
 
class  DataState
 The state a tree node's data item can be in. More...
 

Public Member Functions

 __init__ (self, DataPointPath path, bool is_leaf=False, bool mark_cached=False, bool mark_ready=False, bool mark_requested=False)
 
str short_name (self)
 Returns the last component of the datapoint path.
 
bool is_root (self)
 Returns True if this is the root node of the tree and False otherwise.
 
bool is_leaf (self)
 Returns True if this is a leaf node of the tree, i.e.
 
bool can_fetch_more (self)
 Returns True if any of the data items are stale and not yet requested, otherwise False is returned.
 
 set_value (self, Any value, bool mark_cached=False)
 Sets the datapoint value of the tree node and marks the value as ready, i.e.
 
 set_metadata (self, Any metadata, bool mark_cached=False)
 Sets the datapoint metadata of the tree node and marks the metadata as ready, i.e.
 
 add_child (self, TreeNode child)
 Adds a child tree node and marks this node as the parent.
 
 insert_child (self, int position, TreeNode child)
 Inserts a child tree node into a particular position and marks this node as the parent.
 
 remove_child (self, TreeNode child)
 Removes a child tree node from this node and resets the child's parent pointer.
 
Sequence[TreeNoderemove_children (self, int position, int count)
 Removes multiple child tree nodes from this node and resets the removed children's parent pointers.
 
str __str__ (self)
 

Public Attributes

 path = path
 
 old_path = None
 
 parent = None
 
list[TreeNodechildren = None if is_leaf else []
 
 value = None
 
 metadata = TreeNode._MetaData(None)
 
 children_state = TreeNode.DataState.READY
 
 value_state = TreeNode.DataState.CACHED
 
 metadata_state = TreeNode.DataState.CACHED
 

Detailed Description

This represents a tree node in the repository tree model that also contains cached data.

Leaf nodes represent datapoints in the repository, while non-leaf nodes represent folders in the datapoint hierarchy.

Constructor & Destructor Documentation

◆ __init__()

gui.repository_model.TreeNode.__init__ ( self,
DataPointPath path,
bool is_leaf = False,
bool mark_cached = False,
bool mark_ready = False,
bool mark_requested = False )

Member Function Documentation

◆ __str__()

str gui.repository_model.TreeNode.__str__ ( self)

◆ add_child()

gui.repository_model.TreeNode.add_child ( self,
TreeNode child )

Adds a child tree node and marks this node as the parent.

◆ can_fetch_more()

bool gui.repository_model.TreeNode.can_fetch_more ( self)

Returns True if any of the data items are stale and not yet requested, otherwise False is returned.

◆ insert_child()

gui.repository_model.TreeNode.insert_child ( self,
int position,
TreeNode child )

Inserts a child tree node into a particular position and marks this node as the parent.

◆ is_leaf()

bool gui.repository_model.TreeNode.is_leaf ( self)

Returns True if this is a leaf node of the tree, i.e.

corresponds to an actual datapoint value, and False otherwise.

◆ is_root()

bool gui.repository_model.TreeNode.is_root ( self)

Returns True if this is the root node of the tree and False otherwise.

◆ remove_child()

gui.repository_model.TreeNode.remove_child ( self,
TreeNode child )

Removes a child tree node from this node and resets the child's parent pointer.

◆ remove_children()

Sequence[TreeNode] gui.repository_model.TreeNode.remove_children ( self,
int position,
int count )

Removes multiple child tree nodes from this node and resets the removed children's parent pointers.

The removed nodes are returned.

◆ set_metadata()

gui.repository_model.TreeNode.set_metadata ( self,
Any metadata,
bool mark_cached = False )

Sets the datapoint metadata of the tree node and marks the metadata as ready, i.e.

not stale.

◆ set_value()

gui.repository_model.TreeNode.set_value ( self,
Any value,
bool mark_cached = False )

Sets the datapoint value of the tree node and marks the value as ready, i.e.

not stale.

◆ short_name()

str gui.repository_model.TreeNode.short_name ( self)

Returns the last component of the datapoint path.

Member Data Documentation

◆ children

list[TreeNode] gui.repository_model.TreeNode.children = None if is_leaf else []

◆ children_state

gui.repository_model.TreeNode.children_state = TreeNode.DataState.READY

◆ metadata

gui.repository_model.TreeNode.metadata = TreeNode._MetaData(None)

◆ metadata_state

gui.repository_model.TreeNode.metadata_state = TreeNode.DataState.CACHED

◆ old_path

gui.repository_model.TreeNode.old_path = None

◆ parent

gui.repository_model.TreeNode.parent = None

◆ path

gui.repository_model.TreeNode.path = path

◆ value

gui.repository_model.TreeNode.value = None

◆ value_state

gui.repository_model.TreeNode.value_state = TreeNode.DataState.CACHED

The documentation for this class was generated from the following file: