| IOLink Python 1.11.0

Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
iolink.iolink.MetadataNode Class Reference
Inheritance diagram for iolink.iolink.MetadataNode:

## Public Member Functions
| __init__ (self, *args)
| clone (self)
| get_key (self)
| get_value (self)
| get_child_count (self)
| has_child (self, key)
| child (self, *args)
| add_child (self, child)
| remove_child (self, key)
| to_string (self)
| __iter__ (self)
| __repr__ (self)

## Properties
| thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
| key = property(get_key, doc=get_key.__doc__)
| value = property(get_value, doc=get_value.__doc__)
| child_count = property(get_child_count, doc=get_child_count.__doc__)

## Detailed Description

    Class which represents one node from a metadata tree. Each node contains
    a key and also an associated value (optional). It also contains a list of nodes which
    represents its children in the tree.
    Children can be parsed using '(Const)MetadataNodeIterator' objects provided by
    '(c)begin' and '(c)end' methods, or directly can be retrieved thanks to 'child' accessor method.

## Member Function Documentation

## ◆ add_child()

iolink.iolink.MetadataNode.add_child | ( |  | self,
|  |  | child
| ) |  |

        Add a node as child. If the given child key already exists in the current node,
        existing child is replaced by new one
        :type child: :py:class:`MetadataNode`
        :param child: node to add as child to the current node

## ◆ child()

iolink.iolink.MetadataNode.child | ( |  | self,
|  | * | args
| ) |  |

        *Overload 1:*

        Return the child node with the given key.

        :type key: string
        :param key: the key corresponding to one of the children of current node
        :rtype: :py:class:`MetadataNode`
        :return: the child corresponding to given key
        :raises: Error If the key is not found in the children of the current node

        |

        *Overload 2:*

        Return the child node with the given key.

        :type key: string
        :param key: the key corresponding to one of the children of current node
        :rtype: :py:class:`MetadataNode`
        :return: the child corresponding to given key
        :raises: Error If the key is not found in the children of the current node

## ◆ clone()

iolink.iolink.MetadataNode.clone | ( |  | self | ) |

        Method to clone the current node
        :rtype: :py:class:`MetadataNode`
        :return: the new node

## ◆ get_child_count()

iolink.iolink.MetadataNode.get_child_count | ( |  | self | ) |

    Return the children's count of this node.

## ◆ get_key()

iolink.iolink.MetadataNode.get_key | ( |  | self | ) |

        Accessor to the key of the current node
        :rtype: string
        :return: the current node key

## ◆ get_value()

iolink.iolink.MetadataNode.get_value | ( |  | self | ) |

        Accessor to the value of the current node
        :rtype: :py:class:`VariantDataValue`
        :return: the current node value

## ◆ has_child()

iolink.iolink.MetadataNode.has_child | ( |  | self,
|  |  | key
| ) |  |

        Indicate if a child identified by its key is present or not.

        :type key: string
        :param key: the key corresponding to a child or not of current node
        :rtype: boolean
        :return: If the node has a child with given key

## ◆ remove_child()

iolink.iolink.MetadataNode.remove_child | ( |  | self,
|  |  | key
| ) |  |

        Remove child identified by its key
        :type key: string
        :param key: Key whose node must be removed

## ◆ to_string()

iolink.iolink.MetadataNode.to_string | ( |  | self | ) |

    Return a string representation

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

- Release/python/iolink/iolink.py