title: Getting boost property_tree parent node
body: <p>I am using boost property_tree in my program. I've set up the tree for using custom path type. What I'm looking for is getting a specific node's parent node id. </p>
  
  <p>Here is an example:</p>
  
  <pre><code>MetaStorageTree tree;
  
  typedef boost::property_tree::basic_ptree&lt;Framework::CommonClientServer::InterfacePathChain_t, MetaStorageTreeNode*&gt;
      MetaStorageTreeNode_t;
  class MetaStorageTree : public MetaStorageTreeNode_t;
  
  MetaStorageTreeNode* node = new MetaStorageTreeNode(1);
  MetaStorageTreeNode* node1 = new MetaStorageTreeNode(2);
  tree.put(InterfacePathChain_t{0}, node);
  tree.put(InterfacePathChain_t{0, 0}, node1);
  tree.put(InterfacePathChain_t{0, 1}, node1);
  tree.put(InterfacePathChain_t{0, 0, 0}, node);
  tree.put(InterfacePathChain_t{0, 1, 0}, node1);
  tree.put(InterfacePathChain_t{0, 1, 1}, node);
  
  //InterfacePathChain_t is basically a vector&lt;int&gt;
  </code></pre>
  
  <p>And the result goes as expected:</p>
  
  <pre><code>{0}: 1
      {0}: 2
          {0}: 1
      {1}: 2
          {0}: 2
          {1}: 1
  </code></pre>
  
  <p>What I need is a way of getting full id of a node without permanently storing it. What I am thinking of is a way of simply getting its parent node id and pushing it to the front of the path and so on to the top level. But I didn't seem to be able to find a way to do this in property_tree. Is this possible? If no, are there any other ways of calculating full path for this case?</p>
  
  <p>For example as for node with path {0, 1, 0}:</p>
  
  <ol>
  <li>id == 0 => path = {0}</li>
  <li>parent != NULL => parent.id == 1 => path = {1, 0}</li>
  <li>parent != NULL => parent.id == 0 => path = {0, 1, 0}</li>
  <li>parent == NULL => end</li>
  </ol>