Qt 4.8
Public Types | Public Functions | Properties | List of all members
QPatternist::XsdIdCache Class Reference

Helper class for keeping track of all existing IDs in a schema. More...

#include <qxsdidcache_p.h>

Inheritance diagram for QPatternist::XsdIdCache:
QSharedData

Public Types

typedef QExplicitlySharedDataPointer< XsdIdCachePtr
 

Public Functions

void addId (const QString &id)
 
bool hasId (const QString &id) const
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 

Properties

QSet< QStringm_ids
 
QReadWriteLock m_lock
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Helper class for keeping track of all existing IDs in a schema.

Author
Tobias Koenig tobia.nosp@m.s.ko.nosp@m.enig@.nosp@m.noki.nosp@m.a.com

Definition at line 74 of file qxsdidcache_p.h.

Typedefs

◆ Ptr

Definition at line 77 of file qxsdidcache_p.h.

Functions

◆ addId()

void XsdIdCache::addId ( const QString id)

Adds an id to the id cache.

Definition at line 51 of file qxsdidcache.cpp.

Referenced by QPatternist::XsdSchemaParser::validateIdAttribute().

52 {
53  const QWriteLocker locker(&m_lock);
54  Q_ASSERT(!m_ids.contains(id));
55 
56  m_ids.insert(id);
57 }
QReadWriteLock m_lock
Definition: qxsdidcache_p.h:91
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool contains(const T &value) const
Definition: qset.h:91
const_iterator insert(const T &value)
Definition: qset.h:179
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
QSet< QString > m_ids
Definition: qxsdidcache_p.h:90

◆ hasId()

bool XsdIdCache::hasId ( const QString id) const

Returns whether the id cache contains the given id already.

Definition at line 59 of file qxsdidcache.cpp.

Referenced by QPatternist::XsdSchemaParser::validateIdAttribute().

60 {
61  const QReadLocker locker(&m_lock);
62 
63  return m_ids.contains(id);
64 }
QReadWriteLock m_lock
Definition: qxsdidcache_p.h:91
bool contains(const T &value) const
Definition: qset.h:91
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QSet< QString > m_ids
Definition: qxsdidcache_p.h:90

Properties

◆ m_ids

QSet<QString> QPatternist::XsdIdCache::m_ids
private

Definition at line 90 of file qxsdidcache_p.h.

Referenced by addId(), and hasId().

◆ m_lock

QReadWriteLock QPatternist::XsdIdCache::m_lock
mutableprivate

Definition at line 91 of file qxsdidcache_p.h.

Referenced by addId(), and hasId().


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