Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-430

Data Tree: provide a cursor/stream modification API

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    Description

      There are a few situations where we want to apply a tree-based operation into a data tree, for example if I want to replicate a DataTreeCandidate to another data tree.

      Instead of performing global operations in the YangInstanceIdentifier+data sense, it would be nice if I could maintain a data-tree backed cursor, which I can navigate, such as this:

      YangInstanceIdentifer id; // root of the incoming DataTreeCandidate
      DataTree tree; // tree the operation needs to be applied to
      DataTreeModification tx = tree.takeSnapshot().newModification();

      DataTreeModificationCursor cursor = tx.cursor(id);
      cursor.write(pathArgument1, data1);
      cursor.enter(pathArgument2); // equivalent of 'cd'
      cursor.enter(pathArgument3);
      cursor.write(pathArgument4, data2);
      cursor.exit();
      cursor.exit();
      cursor.close();

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tony.tkacik@gmail.com Tony Tkacik
              rovarga Robert Varga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: