Qt 4.8
Public Functions | Public Variables | List of all members
QConnectionDict Class Reference
Inheritance diagram for QConnectionDict:
QHash< QString, QSqlDatabase >

Public Functions

bool contains_ts (const QString &key)
 
QStringList keys_ts () const
 
- Public Functions inherited from QHash< QString, QSqlDatabase >
iterator begin ()
 Returns an STL-style iterator pointing to the first item in the hash. More...
 
const_iterator begin () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
int capacity () const
 Returns the number of buckets in the QHash's internal hash table. More...
 
void clear ()
 Removes all items from the hash. More...
 
const_iterator constBegin () const
 Returns a const STL-style iterator pointing to the first item in the hash. More...
 
const_iterator constEnd () const
 Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash. More...
 
const_iterator constFind (const QString &key) const
 Returns an iterator pointing to the item with the key in the hash. More...
 
bool contains (const QString &key) const
 Returns true if the hash contains an item with the key; otherwise returns false. More...
 
int count (const QString &key) const
 Returns the number of items associated with the key. More...
 
int count () const
 Same as size(). More...
 
void detach ()
 Detaches this hash from any other hashes with which it may share data. More...
 
bool empty () const
 This function is provided for STL compatibility. More...
 
iterator end ()
 Returns an STL-style iterator pointing to the imaginary item after the last item in the hash. More...
 
const_iterator end () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
iterator erase (iterator it)
 Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator to the next item in the hash. More...
 
iterator find (const QString &key)
 Returns an iterator pointing to the item with the key in the hash. More...
 
const_iterator find (const QString &key) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
iterator insert (const QString &key, const QSqlDatabase &value)
 Inserts a new item with the key and a value of value. More...
 
iterator insertMulti (const QString &key, const QSqlDatabase &value)
 Inserts a new item with the key and a value of value. More...
 
bool isDetached () const
 Returns true if the hash's internal data isn't shared with any other hash object; otherwise returns false. More...
 
bool isEmpty () const
 Returns true if the hash contains no items; otherwise returns false. More...
 
bool isSharedWith (const QHash< QString, QSqlDatabase > &other) const
 
const QString key (const QSqlDatabase &value) const
 Returns the first key mapped to value. More...
 
const QString key (const QSqlDatabase &value, const QString &defaultKey) const
 Returns the first key mapped to value, or defaultKey if the hash contains no item mapped to value. More...
 
QList< QStringkeys () const
 Returns a list containing all the keys in the hash, in an arbitrary order. More...
 
QList< QStringkeys (const QSqlDatabase &value) const
 Returns a list containing all the keys associated with value value, in an arbitrary order. More...
 
bool operator!= (const QHash< QString, QSqlDatabase > &other) const
 Returns true if other is not equal to this hash; otherwise returns false. More...
 
QHash< QString, QSqlDatabase > & operator= (const QHash< QString, QSqlDatabase > &other)
 Assigns other to this hash and returns a reference to this hash. More...
 
bool operator== (const QHash< QString, QSqlDatabase > &other) const
 Returns true if other is equal to this hash; otherwise returns false. More...
 
QSqlDatabaseoperator[] (const QString &key)
 Returns the value associated with the key as a modifiable reference. More...
 
const QSqlDatabase operator[] (const QString &key) const
 Same as value(). More...
 
 QHash ()
 Constructs an empty hash. More...
 
 QHash (const QHash< QString, QSqlDatabase > &other)
 Constructs a copy of other. More...
 
int remove (const QString &key)
 Removes all the items that have the key from the hash. More...
 
void reserve (int size)
 Ensures that the QHash's internal hash table consists of at least size buckets. More...
 
void setSharable (bool sharable)
 
int size () const
 Returns the number of items in the hash. More...
 
void squeeze ()
 Reduces the size of the QHash's internal hash table to save memory. More...
 
void swap (QHash< QString, QSqlDatabase > &other)
 Swaps hash other with this hash. More...
 
QSqlDatabase take (const QString &key)
 Removes the item with the key from the hash and returns the value associated with it. More...
 
QList< QStringuniqueKeys () const
 Returns a list containing all the keys in the map. More...
 
QHash< QString, QSqlDatabase > & unite (const QHash< QString, QSqlDatabase > &other)
 Inserts all the items in the other hash into this hash. More...
 
const QSqlDatabase value (const QString &key) const
 Returns the value associated with the key. More...
 
const QSqlDatabase value (const QString &key, const QSqlDatabase &defaultValue) const
 If the hash contains no item with the given key, the function returns defaultValue. More...
 
QList< QSqlDatabasevalues () const
 Returns a list containing all the values in the hash, in an arbitrary order. More...
 
QList< QSqlDatabasevalues (const QString &key) const
 Returns a list of all the values associated with the key, from the most recently inserted to the least recently inserted. More...
 
 ~QHash ()
 Destroys the hash. More...
 

Public Variables

QReadWriteLock lock
 
- Public Variables inherited from QHash< QString, QSqlDatabase >
QHashDatad
 
QHashNode< QString, QSqlDatabase > * e
 

Additional Inherited Members

- Public Types inherited from QHash< QString, QSqlDatabase >
typedef const_iterator ConstIterator
 Qt-style synonym for QHash::const_iterator. More...
 
typedef qptrdiff difference_type
 Typedef for ptrdiff_t. More...
 
typedef iterator Iterator
 Qt-style synonym for QHash::iterator. More...
 
typedef QString key_type
 Typedef for Key. More...
 
typedef QSqlDatabase mapped_type
 Typedef for T. More...
 
typedef int size_type
 Typedef for int. More...
 

Detailed Description

Definition at line 114 of file qsqldatabase.cpp.

Functions

◆ contains_ts()

bool QConnectionDict::contains_ts ( const QString key)
inline

Definition at line 117 of file qsqldatabase.cpp.

118  {
119  QReadLocker locker(&lock);
120  return contains(key);
121  }
QReadWriteLock lock
bool contains(const QString &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
Definition: qhash.h:872
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...

◆ keys_ts()

QStringList QConnectionDict::keys_ts ( ) const
inline

Definition at line 122 of file qsqldatabase.cpp.

123  {
124  QReadLocker locker(&lock);
125  return keys();
126  }
QReadWriteLock lock
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QList< QString > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
Definition: qhash.h:648

Properties

◆ lock

QReadWriteLock QConnectionDict::lock
mutable

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