rdkit.VLib.Node module — The RDKit 2016.09.1 documentation

# rdkit.VLib.Node module

class `rdkit.VLib.Node.` `VLibNode`(*args, **kwargs)

  Bases: `object`

  base class for all virtual library nodes, defines minimal required interface

  `AddChild`(child, notify=1)

        >>> p1 = VLibNode()
        >>> p2 = VLibNode()
        >>> c1 = VLibNode()
        >>> p1.AddChild(c1)
        >>> len(c1.GetParents())
        1
        >>> len(p1.GetChildren())
        1
        >>> p2.AddChild(c1,notify=0)
        >>> len(c1.GetParents())
        1
        >>> len(p2.GetChildren())
        1
        >>> c1.AddParent(p2,notify=0)
        >>> len(c1.GetParents())
        2
        >>> len(p2.GetChildren())
        1

  `AddParent`(parent, notify=True)

        >>> p1 = VLibNode()
        >>> p2 = VLibNode()
        >>> c1 = VLibNode()
        >>> c1.AddParent(p1)
        >>> len(c1.GetParents())
        1
        >>> len(p1.GetChildren())
        1
        >>> c1.AddParent(p2,notify=0)
        >>> len(c1.GetParents())
        2
        >>> len(p2.GetChildren())
        0
        >>> p2.AddChild(c1,notify=0)
        >>> len(c1.GetParents())
        2
        >>> len(p2.GetChildren())
        1

  `Destroy`(notify=True, propagateDown=False, propagateUp=False)

        >>> p1 = VLibNode()
        >>> p2 = VLibNode()
        >>> c1 = VLibNode()
        >>> c2 = VLibNode()
        >>> p1.AddChild(c1)
        >>> p2.AddChild(c1)
        >>> p2.AddChild(c2)
        >>> len(c1.GetParents())
        2
        >>> len(c2.GetParents())
        1
        >>> len(p1.GetChildren())
        1
        >>> len(p2.GetChildren())
        2
        >>> c1.Destroy(propagateUp=True)
        >>> len(p2.GetChildren())
        0
        >>> len(c1.GetParents())
        0
        >>> len(c2.GetParents())
        0

  `GetChildren`()
  `GetParents`()
  `RemoveChild`(child, notify=1)

        >>> p1 = VLibNode()
        >>> c1 = VLibNode()
        >>> p1.AddChild(c1)
        >>> len(c1.GetParents())
        1
        >>> len(p1.GetChildren())
        1
        >>> p1.RemoveChild(c1)
        >>> len(c1.GetParents())
        0
        >>> len(p1.GetChildren())
        0

  `RemoveParent`(parent, notify=True)

        >>> p1 = VLibNode()
        >>> c1 = VLibNode()
        >>> p1.AddChild(c1)
        >>> len(c1.GetParents())
        1
        >>> len(p1.GetChildren())
        1
        >>> c1.RemoveParent(p1)
        >>> len(c1.GetParents())
        0
        >>> len(p1.GetChildren())
        0

  `next`()

    part of the iterator interface

    raises StopIteration on failure

  `reset`()

    resets our iteration state