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

void operator= (const TiXmlAttributeSet &)
 
 TiXmlAttributeSet (const TiXmlAttributeSet &)
 

Private Attributes

TiXmlAttribute sentinel
 

Detailed Description

Definition at line 905 of file tinyxml.h.

Constructor & Destructor Documentation

TiXmlAttributeSet::TiXmlAttributeSet ( )

Definition at line 1504 of file tinyxml.cc.

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

1505 {
1506  sentinel.next = &sentinel;
1507  sentinel.prev = &sentinel;
1508 }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
TiXmlAttribute * prev
Definition: tinyxml.h:888
TiXmlAttribute * next
Definition: tinyxml.h:889
TiXmlAttributeSet::~TiXmlAttributeSet ( )

Definition at line 1511 of file tinyxml.cc.

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

1512 {
1513  assert( sentinel.next == &sentinel );
1514  assert( sentinel.prev == &sentinel );
1515 }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
TiXmlAttribute * prev
Definition: tinyxml.h:888
TiXmlAttribute * next
Definition: tinyxml.h:889
TiXmlAttributeSet::TiXmlAttributeSet ( const TiXmlAttributeSet )
private

Member Function Documentation

void TiXmlAttributeSet::Add ( TiXmlAttribute attribute)

Definition at line 1518 of file tinyxml.cc.

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

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

1519 {
1520  #ifdef TIXML_USE_STL
1521  assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set.
1522  #else
1523  assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set.
1524  #endif
1525 
1526  addMe->next = &sentinel;
1527  addMe->prev = sentinel.prev;
1528 
1529  sentinel.prev->next = addMe;
1530  sentinel.prev = addMe;
1531 }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
TiXmlAttribute * prev
Definition: tinyxml.h:888
TiXmlAttribute * next
Definition: tinyxml.h:889
const TiXmlAttribute * Find(const char *_name) const
Definition: tinyxml.cc:1577
#define TIXML_STRING
Definition: tinyxml.h:51
const TiXmlAttribute * TiXmlAttributeSet::Find ( const char *  _name) const

Definition at line 1577 of file tinyxml.cc.

References AlCaRecoCosmics_cfg::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().

1578 {
1579  for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
1580  {
1581  if ( strcmp( node->name.c_str(), name ) == 0 )
1582  return node;
1583  }
1584  return 0;
1585 }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
tuple node
Definition: Node.py:50
TiXmlAttribute * next
Definition: tinyxml.h:889
TiXmlAttribute* TiXmlAttributeSet::Find ( const char *  _name)
inline

Definition at line 920 of file tinyxml.h.

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

Definition at line 1553 of file tinyxml.cc.

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

1554 {
1555  for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
1556  {
1557  if ( node->name == name )
1558  return node;
1559  }
1560  return 0;
1561 }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
tuple node
Definition: Node.py:50
TiXmlAttribute * next
Definition: tinyxml.h:889
TiXmlAttribute* TiXmlAttributeSet::Find ( const std::string &  _name)
inline

Definition at line 925 of file tinyxml.h.

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

Definition at line 914 of file tinyxml.h.

References TiXmlAttribute::next, and sentinel.

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

914 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
TiXmlAttribute * next
Definition: tinyxml.h:889
TiXmlAttribute* TiXmlAttributeSet::First ( )
inline

Definition at line 915 of file tinyxml.h.

References TiXmlAttribute::next, and sentinel.

915 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
TiXmlAttribute * next
Definition: tinyxml.h:889
const TiXmlAttribute* TiXmlAttributeSet::Last ( ) const
inline

Definition at line 916 of file tinyxml.h.

References TiXmlAttribute::prev, and sentinel.

Referenced by TiXmlElement::LastAttribute().

916 { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
TiXmlAttribute * prev
Definition: tinyxml.h:888
TiXmlAttribute* TiXmlAttributeSet::Last ( )
inline

Definition at line 917 of file tinyxml.h.

References TiXmlAttribute::prev, and sentinel.

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

Definition at line 1533 of file tinyxml.cc.

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

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

1534 {
1536 
1537  for( node = sentinel.next; node != &sentinel; node = node->next )
1538  {
1539  if ( node == removeMe )
1540  {
1541  node->prev->next = node->next;
1542  node->next->prev = node->prev;
1543  node->next = 0;
1544  node->prev = 0;
1545  return;
1546  }
1547  }
1548  assert( 0 ); // we tried to remove a non-linked attribute.
1549 }
TiXmlAttribute sentinel
Definition: tinyxml.h:937
tuple node
Definition: Node.py:50
TiXmlAttribute * prev
Definition: tinyxml.h:888
TiXmlAttribute * next
Definition: tinyxml.h:889

Member Data Documentation

TiXmlAttribute TiXmlAttributeSet::sentinel
private

Definition at line 937 of file tinyxml.h.

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