CMS 3D CMS Logo

Public Member Functions | Private Attributes

TinyDomTest Class Reference

#include <TinyDomTest.h>

List of all members.

Public Member Functions

unsigned int allNodes (const NodeName &, std::vector< const AttList * > &)
 TinyDomTest (const TinyDom &)

Private Attributes

const TinyDomdom_

Detailed Description

some tests for TinyDom and TinyDomWalker

Definition at line 9 of file TinyDomTest.h.


Constructor & Destructor Documentation

TinyDomTest::TinyDomTest ( const TinyDom d) [explicit]

Definition at line 4 of file TinyDomTest.cc.

 : dom_(d) 
 { }

Member Function Documentation

unsigned int TinyDomTest::allNodes ( const NodeName tagName,
std::vector< const AttList * > &  result 
)

Definition at line 8 of file TinyDomTest.cc.

References graph< N, E >::begin(), dom_, graph< N, E >::edgeData(), graph< N, E >::end(), graph< N, E >::nodeData(), and TagName::sameName().

{
   result.clear();
   TinyDom::const_adj_iterator it = dom_.begin();  
   TinyDom::const_adj_iterator ed = dom_.end();  
   for (; it != ed; ++it) {
     const TinyDom::edge_list & el = *it;
     TinyDom::edge_list::const_iterator el_it = el.begin();
     TinyDom::edge_list::const_iterator el_ed = el.end();
     for (; el_it != el_ed; ++el_it) {
       if ( dom_.nodeData(el_it->first).sameName(tagName) ) {
         result.push_back(& dom_.edgeData(el_it->second));
       }
     }
   }
   return result.size();
}

Member Data Documentation

const TinyDom& TinyDomTest::dom_ [private]

Definition at line 17 of file TinyDomTest.h.

Referenced by allNodes().