aboutsummaryrefslogtreecommitdiff
path: root/qt/employee.hxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-04-21 09:30:16 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-04-22 18:45:40 +0200
commit32dafbe8a2aaf2230b55dfd0840f70ff7909b5e1 (patch)
treeff6fe0d4ccbfedbddad4b8e4b5bc08c63c45d2cb /qt/employee.hxx
parent25c332e53064af13c9f119df6bcc2c3847d93695 (diff)
Add qt/container usage to Qt example
Diffstat (limited to 'qt/employee.hxx')
-rw-r--r--qt/employee.hxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/qt/employee.hxx b/qt/employee.hxx
index f921a97..37ad0c9 100644
--- a/qt/employee.hxx
+++ b/qt/employee.hxx
@@ -5,12 +5,12 @@
#ifndef EMPLOYEE_HXX
#define EMPLOYEE_HXX
-#include <vector>
-
#include <QString>
#include <QByteArray>
#include <QDateTime>
#include <QSharedPointer>
+#include <QList>
+#include <QSet>
#include <odb/core.hxx>
@@ -21,7 +21,8 @@
class employer;
class employee;
-typedef std::vector<QLazyWeakPointer<employee> > employees;
+typedef QSet<QString> emails;
+typedef QList<QLazyWeakPointer<employee> > employees;
#pragma db object
class employer
@@ -107,6 +108,22 @@ public:
return born_;
}
+ // Emails.
+ //
+ typedef ::emails emails_type;
+
+ const emails_type&
+ emails () const
+ {
+ return emails_;
+ }
+
+ emails_type&
+ emails ()
+ {
+ return emails_;
+ }
+
// Public key.
//
const QByteArray&
@@ -139,9 +156,8 @@ private:
QString first_;
QString last_;
-
QDate born_;
-
+ emails_type emails_;
QByteArray public_key_;
#pragma db not_null