aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
TiXmlAttributeSet Class Reference

#include <tinyxml.h>

Collaboration diagram for TiXmlAttributeSet:

Public Member Functions

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

Private Member Functions

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

Private Attributes

TiXmlAttribute sentinel

Detailed Description

Definition at line 1046 of file tinyxml.h.

Constructor & Destructor Documentation

◆ TiXmlAttributeSet() [1/2]

TiXmlAttributeSet::TiXmlAttributeSet ( )

Definition at line 1417 of file tinyxml.cpp.

1417 {
1418 sentinel.next = &sentinel;
1419 sentinel.prev = &sentinel;
1420}
TiXmlAttribute sentinel
Definition tinyxml.h:1088

References sentinel.

Referenced by TiXmlAttributeSet(), Find(), Find(), and operator=().

Here is the caller graph for this function:

◆ ~TiXmlAttributeSet()

TiXmlAttributeSet::~TiXmlAttributeSet ( )

Definition at line 1422 of file tinyxml.cpp.

1422 {
1423 assert(sentinel.next == &sentinel);
1424 assert(sentinel.prev == &sentinel);
1425}

References sentinel.

◆ TiXmlAttributeSet() [2/2]

TiXmlAttributeSet::TiXmlAttributeSet ( const TiXmlAttributeSet & )
private

References TiXmlAttributeSet().

Here is the call graph for this function:

Member Function Documentation

◆ Add()

void TiXmlAttributeSet::Add ( TiXmlAttribute * attribute)

Definition at line 1427 of file tinyxml.cpp.

1427 {
1428#ifdef TIXML_USE_STL
1429 assert(!Find(
1430 TIXML_STRING(addMe->Name()))); // Shouldn't be multiply adding to the set.
1431#else
1432 assert(!Find(addMe->Name())); // Shouldn't be multiply adding to the set.
1433#endif
1434
1435 addMe->next = &sentinel;
1436 addMe->prev = sentinel.prev;
1437
1438 sentinel.prev->next = addMe;
1439 sentinel.prev = addMe;
1440}
const TiXmlAttribute * Find(const char *_name) const
Definition tinyxml.cpp:1482
#define TIXML_STRING
Definition tinyxml.h:60

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

Here is the call graph for this function:

◆ Find() [1/4]

TiXmlAttribute * TiXmlAttributeSet::Find ( const char * _name)
inline

Definition at line 1068 of file tinyxml.h.

1068 {
1069 return const_cast< TiXmlAttribute* >(
1070 (const_cast< const TiXmlAttributeSet* >(this))->Find(_name));
1071 }

References TiXmlAttributeSet().

Here is the call graph for this function:

◆ Find() [2/4]

const TiXmlAttribute * TiXmlAttributeSet::Find ( const char * _name) const

Definition at line 1482 of file tinyxml.cpp.

1482 {
1483 for (const TiXmlAttribute* node = sentinel.next; node != &sentinel;
1484 node = node->next) {
1485 if (strcmp(node->name.c_str(), name) == 0) return node;
1486 }
1487
1488 return 0;
1489}

References sentinel.

Referenced by Add().

Here is the caller graph for this function:

◆ Find() [3/4]

TiXmlAttribute * TiXmlAttributeSet::Find ( const std::string & _name)
inline

Definition at line 1074 of file tinyxml.h.

1074 {
1075 return const_cast< TiXmlAttribute* >(
1076 (const_cast< const TiXmlAttributeSet* >(this))->Find(_name));
1077 }

References TiXmlAttributeSet().

Here is the call graph for this function:

◆ Find() [4/4]

const TiXmlAttribute * TiXmlAttributeSet::Find ( const std::string & _name) const

Definition at line 1459 of file tinyxml.cpp.

1459 {
1460 for (const TiXmlAttribute* node = sentinel.next; node != &sentinel;
1461 node = node->next) {
1462 if (node->name == name) return node;
1463 }
1464
1465 return 0;
1466}

References sentinel.

◆ First() [1/2]

TiXmlAttribute * TiXmlAttributeSet::First ( )
inline

Definition at line 1057 of file tinyxml.h.

1057 {
1058 return (sentinel.next == &sentinel) ? 0 : sentinel.next;
1059 }

References sentinel.

◆ First() [2/2]

const TiXmlAttribute * TiXmlAttributeSet::First ( ) const
inline

Definition at line 1054 of file tinyxml.h.

1054 {
1055 return (sentinel.next == &sentinel) ? 0 : sentinel.next;
1056 }

References sentinel.

◆ Last() [1/2]

TiXmlAttribute * TiXmlAttributeSet::Last ( )
inline

Definition at line 1063 of file tinyxml.h.

1063 {
1064 return (sentinel.prev == &sentinel) ? 0 : sentinel.prev;
1065 }

References sentinel.

◆ Last() [2/2]

const TiXmlAttribute * TiXmlAttributeSet::Last ( ) const
inline

Definition at line 1060 of file tinyxml.h.

1060 {
1061 return (sentinel.prev == &sentinel) ? 0 : sentinel.prev;
1062 }

References sentinel.

◆ operator=()

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

References TiXmlAttributeSet().

Here is the call graph for this function:

◆ Remove()

void TiXmlAttributeSet::Remove ( TiXmlAttribute * attribute)

Definition at line 1442 of file tinyxml.cpp.

1442 {
1443 TiXmlAttribute* node;
1444
1445 for (node = sentinel.next; node != &sentinel; node = node->next) {
1446 if (node == removeMe) {
1447 node->prev->next = node->next;
1448 node->next->prev = node->prev;
1449 node->next = 0;
1450 node->prev = 0;
1451 return;
1452 }
1453 }
1454
1455 assert(0); // we tried to remove a non-linked attribute.
1456}
TiXmlAttribute * prev
Definition tinyxml.h:1030
TiXmlAttribute * next
Definition tinyxml.h:1031

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

Member Data Documentation

◆ sentinel

TiXmlAttribute TiXmlAttributeSet::sentinel
private

Definition at line 1088 of file tinyxml.h.

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


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