From e93dcc2ecabee46d31aedf9f4ddc8058956c78ad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Feb 2013 15:50:07 +0200 Subject: 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. --- odb/qt/containers/list-iterator.hxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 odb/qt/containers/list-iterator.hxx (limited to 'odb/qt/containers/list-iterator.hxx') 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 + +#include + +#include + +// Java-style QListIterator-like iterator. You can also use the +// QListIterator directly (but not QMutableListIterator). +// +template +class QOdbListIterator: public QListIterator +{ +public: + QOdbListIterator (const QOdbList& c): QListIterator (c) {} + QOdbListIterator& operator=(const QOdbList& c) + { + static_cast&> (*this) = c; + return *this; + } +}; + +#include + +#endif // ODB_QT_CONTAINERS_LIST_ITERATOR_HXX -- cgit v1.1