Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
Arc::XMLNodeContainer Class Reference

Container for multiple XMLNode elements. More...

#include <XMLNode.h>

Collaboration diagram for Arc::XMLNodeContainer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XMLNodeContainer (void)
 Default constructor.
 XMLNodeContainer (const XMLNodeContainer &)
 Copy constructor.
 ~XMLNodeContainer (void)
XMLNodeContaineroperator= (const XMLNodeContainer &)
 Same as copy constructor with current nodes being deleted first.
void Add (const XMLNode &)
 Link XML subtree refered by node to container.
void Add (const std::list< XMLNode > &)
 Link multiple XML subtrees to container.
void AddNew (const XMLNode &)
 Copy XML subtree referenced by node to container.
void AddNew (const std::list< XMLNode > &)
 Copy multiple XML subtrees to container.
int Size (void) const
 Return number of refered/stored nodes.
XMLNode operator[] (int)
 Returns n-th node in a store.
std::list< XMLNodeNodes (void)
 Returns all stored nodes.

Private Attributes

std::vector< XMLNode * > nodes_

Detailed Description

Container for multiple XMLNode elements.

Definition at line 363 of file XMLNode.h.


Constructor & Destructor Documentation

Default constructor.

Definition at line 1088 of file XMLNode.cpp.

{}

Copy constructor.

Add nodes from argument. Nodes owning XML document are copied using AddNew(). Not owning nodes are linked using Add() method.

Definition at line 1090 of file XMLNode.cpp.

                                                                      {
    operator=(container);
  }

Here is the call graph for this function:

Definition at line 1094 of file XMLNode.cpp.

                                          {
    for (std::vector<XMLNode*>::iterator n = nodes_.begin();
         n != nodes_.end(); ++n)
      delete *n;
  }

Member Function Documentation

void Arc::XMLNodeContainer::Add ( const XMLNode node)

Link XML subtree refered by node to container.

XML tree must be available as long as this object is used.

Definition at line 1114 of file XMLNode.cpp.

                                                {
    XMLNode *new_node = new XMLNode(node);
    nodes_.push_back(new_node);
  }

Here is the caller graph for this function:

void Arc::XMLNodeContainer::Add ( const std::list< XMLNode > &  nodes)

Link multiple XML subtrees to container.

Definition at line 1119 of file XMLNode.cpp.

                                                          {
    for (std::list<XMLNode>::const_iterator n = nodes.begin();
         n != nodes.end(); ++n)
      Add(*n);
  }

Here is the call graph for this function:

void Arc::XMLNodeContainer::AddNew ( const XMLNode node)

Copy XML subtree referenced by node to container.

After this operation container refers to independent XML document. This document is deleted when container is destroyed.

Definition at line 1125 of file XMLNode.cpp.

                                                   {
    XMLNode *new_node = new XMLNode();
    node.New(*new_node);
    nodes_.push_back(new_node);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::XMLNodeContainer::AddNew ( const std::list< XMLNode > &  nodes)

Copy multiple XML subtrees to container.

Definition at line 1131 of file XMLNode.cpp.

                                                             {
    for (std::list<XMLNode>::const_iterator n = nodes.begin();
         n != nodes.end(); ++n)
      AddNew(*n);
  }

Here is the call graph for this function:

std::list< XMLNode > Arc::XMLNodeContainer::Nodes ( void  )

Returns all stored nodes.

Definition at line 1149 of file XMLNode.cpp.

                                               {
    std::list<XMLNode> r;
    for (std::vector<XMLNode*>::iterator n = nodes_.begin();
         n != nodes_.end(); ++n)
      r.push_back(**n);
    return r;
  }
XMLNodeContainer & Arc::XMLNodeContainer::operator= ( const XMLNodeContainer container)

Same as copy constructor with current nodes being deleted first.

Definition at line 1100 of file XMLNode.cpp.

                                                                                 {
    for (std::vector<XMLNode*>::iterator n = nodes_.begin();
         n != nodes_.end(); ++n)
      delete *n;
    for (std::vector<XMLNode*>::const_iterator n = container.nodes_.begin();
         n != container.nodes_.end(); ++n) {
      if ((*n)->is_owner_)
        AddNew(*(*n));
      else
        Add(*(*n));
    }
    return *this;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

XMLNode Arc::XMLNodeContainer::operator[] ( int  n)

Returns n-th node in a store.

Definition at line 1141 of file XMLNode.cpp.

                                            {
    if (n < 0)
      return XMLNode();
    if (n >= nodes_.size())
      return XMLNode();
    return *nodes_[n];
  }
int Arc::XMLNodeContainer::Size ( void  ) const

Return number of refered/stored nodes.

Definition at line 1137 of file XMLNode.cpp.

                                       {
    return nodes_.size();
  }

Here is the caller graph for this function:


Member Data Documentation

std::vector<XMLNode*> Arc::XMLNodeContainer::nodes_ [private]

Definition at line 365 of file XMLNode.h.


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