CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TiXmlAttributeSet Class Reference

#include <tinyxml.h>

Public Member Functions

void Add (TiXmlAttribute *attribute)
 
const TiXmlAttributeFind (const char *_name) const
 
TiXmlAttributeFind (const char *_name)
 
const TiXmlAttributeFind (const std::string &_name) const
 
TiXmlAttributeFind (const std::string &_name)
 
const TiXmlAttributeFirst () const
 
TiXmlAttributeFirst ()
 
const TiXmlAttributeLast () const
 
TiXmlAttributeLast ()
 
void Remove (TiXmlAttribute *attribute)
 
 TiXmlAttributeSet ()
 
 ~TiXmlAttributeSet ()
 

Private Member Functions

TiXmlAttributeSetoperator= (const TiXmlAttributeSet &)
 
 TiXmlAttributeSet (const TiXmlAttributeSet &)
 

Private Attributes

TiXmlAttribute sentinel
 

Detailed Description

Definition at line 907 of file tinyxml.h.

Constructor & Destructor Documentation

TiXmlAttributeSet::TiXmlAttributeSet ( )

Definition at line 1520 of file tinyxml.cc.

References TiXmlAttribute::next, TiXmlAttribute::prev, and sentinel.

1521 {
1522  sentinel.next = &sentinel;
1523  sentinel.prev = &sentinel;
1524 }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
TiXmlAttribute * prev
Definition: tinyxml.h:890
TiXmlAttribute * next
Definition: tinyxml.h:891
TiXmlAttributeSet::~TiXmlAttributeSet ( )

Definition at line 1527 of file tinyxml.cc.

References TiXmlAttribute::next, TiXmlAttribute::prev, and sentinel.

1528 {
1529  assert( sentinel.next == &sentinel );
1530  assert( sentinel.prev == &sentinel );
1531 }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
TiXmlAttribute * prev
Definition: tinyxml.h:890
TiXmlAttribute * next
Definition: tinyxml.h:891
TiXmlAttributeSet::TiXmlAttributeSet ( const TiXmlAttributeSet )
private

Member Function Documentation

void TiXmlAttributeSet::Add ( TiXmlAttribute attribute)

Definition at line 1534 of file tinyxml.cc.

References Find(), TiXmlAttribute::Name(), TiXmlAttribute::next, TiXmlAttribute::prev, sentinel, and TIXML_STRING.

Referenced by TiXmlElement::Parse(), and TiXmlElement::SetAttribute().

1535 {
1536  #ifdef TIXML_USE_STL
1537  assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set.
1538  #else
1539  assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set.
1540  #endif
1541 
1542  addMe->next = &sentinel;
1543  addMe->prev = sentinel.prev;
1544 
1545  sentinel.prev->next = addMe;
1546  sentinel.prev = addMe;
1547 }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
TiXmlAttribute * prev
Definition: tinyxml.h:890
TiXmlAttribute * next
Definition: tinyxml.h:891
const TiXmlAttribute * Find(const char *_name) const
Definition: tinyxml.cc:1593
#define TIXML_STRING
Definition: tinyxml.h:57
const TiXmlAttribute * TiXmlAttributeSet::Find ( const char *  _name) const

Definition at line 1593 of file tinyxml.cc.

References mergeVDriftHistosByStation::name, TiXmlAttribute::next, python.Node::node, and sentinel.

Referenced by Add(), TiXmlElement::Attribute(), TiXmlElement::Parse(), TiXmlElement::QueryDoubleAttribute(), TiXmlElement::QueryIntAttribute(), TiXmlElement::QueryValueAttribute(), TiXmlElement::RemoveAttribute(), and TiXmlElement::SetAttribute().

1594 {
1595  for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
1596  {
1597  if ( strcmp( node->name.c_str(), name ) == 0 )
1598  return node;
1599  }
1600  return 0;
1601 }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
tuple node
Definition: Node.py:50
TiXmlAttribute * next
Definition: tinyxml.h:891
TiXmlAttribute* TiXmlAttributeSet::Find ( const char *  _name)
inline

Definition at line 922 of file tinyxml.h.

922  {
923  return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
924  }
const TiXmlAttribute * TiXmlAttributeSet::Find ( const std::string &  _name) const

Definition at line 1569 of file tinyxml.cc.

References TiXmlAttribute::next, python.Node::node, and sentinel.

1570 {
1571  for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
1572  {
1573  if ( node->name == name )
1574  return node;
1575  }
1576  return 0;
1577 }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
tuple node
Definition: Node.py:50
TiXmlAttribute * next
Definition: tinyxml.h:891
TiXmlAttribute* TiXmlAttributeSet::Find ( const std::string &  _name)
inline

Definition at line 927 of file tinyxml.h.

927  {
928  return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
929  }
const TiXmlAttribute* TiXmlAttributeSet::First ( ) const
inline

Definition at line 916 of file tinyxml.h.

References TiXmlAttribute::next, and sentinel.

Referenced by TiXmlElement::Accept(), TiXmlElement::ClearThis(), TiXmlElement::CopyTo(), TiXmlElement::FirstAttribute(), and TiXmlElement::Print().

916 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
TiXmlAttribute * next
Definition: tinyxml.h:891
TiXmlAttribute* TiXmlAttributeSet::First ( )
inline

Definition at line 917 of file tinyxml.h.

References TiXmlAttribute::next, and sentinel.

917 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
TiXmlAttribute * next
Definition: tinyxml.h:891
const TiXmlAttribute* TiXmlAttributeSet::Last ( ) const
inline

Definition at line 918 of file tinyxml.h.

References TiXmlAttribute::prev, and sentinel.

Referenced by TiXmlElement::LastAttribute().

918 { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
TiXmlAttribute * prev
Definition: tinyxml.h:890
TiXmlAttribute* TiXmlAttributeSet::Last ( )
inline

Definition at line 919 of file tinyxml.h.

References TiXmlAttribute::prev, and sentinel.

919 { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
TiXmlAttribute * prev
Definition: tinyxml.h:890
TiXmlAttributeSet& TiXmlAttributeSet::operator= ( const TiXmlAttributeSet )
private
void TiXmlAttributeSet::Remove ( TiXmlAttribute attribute)

Definition at line 1549 of file tinyxml.cc.

References TiXmlAttribute::next, python.Node::node, TiXmlAttribute::prev, and sentinel.

Referenced by TiXmlElement::ClearThis(), and TiXmlElement::RemoveAttribute().

1550 {
1552 
1553  for( node = sentinel.next; node != &sentinel; node = node->next )
1554  {
1555  if ( node == removeMe )
1556  {
1557  node->prev->next = node->next;
1558  node->next->prev = node->prev;
1559  node->next = 0;
1560  node->prev = 0;
1561  return;
1562  }
1563  }
1564  assert( 0 ); // we tried to remove a non-linked attribute.
1565 }
TiXmlAttribute sentinel
Definition: tinyxml.h:939
tuple node
Definition: Node.py:50
TiXmlAttribute * prev
Definition: tinyxml.h:890
TiXmlAttribute * next
Definition: tinyxml.h:891

Member Data Documentation

TiXmlAttribute TiXmlAttributeSet::sentinel
private

Definition at line 939 of file tinyxml.h.

Referenced by Add(), Find(), First(), Last(), Remove(), TiXmlAttributeSet(), and ~TiXmlAttributeSet().