diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-05 15:50:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-05 15:50:40 +0200 |
commit | e93dcc2ecabee46d31aedf9f4ddc8058956c78ad (patch) | |
tree | e4a40ef98f4534cd9f3090b2d69e07f04642dcfb /odb/qt/containers/list-iterator.hxx | |
parent | 5ddc3cc84883aef3fbb5ab8991ad36c0185404ac (diff) |
Add support for change-tracking containers
ODB now supports "smart" ordered containers. Such containers get extra
functions for updating and deleting individual elements. Based on this
functionality implement two change-tracking containers: odb::vector
(equivalent to std::vector) and QOdbList (equivalent to QList). New
tests: common/container/change-tracking and qt/common/container/change-
tracking.
Diffstat (limited to 'odb/qt/containers/list-iterator.hxx')
-rw-r--r-- | odb/qt/containers/list-iterator.hxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/odb/qt/containers/list-iterator.hxx b/odb/qt/containers/list-iterator.hxx new file mode 100644 index 0000000..d75491a --- /dev/null +++ b/odb/qt/containers/list-iterator.hxx @@ -0,0 +1,31 @@ +// file : odb/qt/containers/list-iterator.hxx +// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINERS_LIST_ITERATOR_HXX +#define ODB_QT_CONTAINERS_LIST_ITERATOR_HXX + +#include <odb/pre.hxx> + +#include <QtCore/QListIterator> + +#include <odb/qt/list.hxx> + +// Java-style QListIterator-like iterator. You can also use the +// QListIterator directly (but not QMutableListIterator). +// +template <typename T> +class QOdbListIterator: public QListIterator<T> +{ +public: + QOdbListIterator (const QOdbList<T>& c): QListIterator<T> (c) {} + QOdbListIterator& operator=(const QOdbList<T>& c) + { + static_cast<QListIterator<T>&> (*this) = c; + return *this; + } +}; + +#include <odb/post.hxx> + +#endif // ODB_QT_CONTAINERS_LIST_ITERATOR_HXX |