aboutsummaryrefslogtreecommitdiff
path: root/qt/employee.hxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-04-19 09:26:51 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-04-22 18:45:40 +0200
commit25c332e53064af13c9f119df6bcc2c3847d93695 (patch)
tree8bed2caa49b4f0c3c3f02f777983b8ac2c19f49b /qt/employee.hxx
parent7ee76c54fca21bed2b94ebf1e71f723670f135fe (diff)
Add qt/smart-ptr usage to Qt example
Diffstat (limited to 'qt/employee.hxx')
-rw-r--r--qt/employee.hxx23
1 files changed, 7 insertions, 16 deletions
diff --git a/qt/employee.hxx b/qt/employee.hxx
index 60c6980..f921a97 100644
--- a/qt/employee.hxx
+++ b/qt/employee.hxx
@@ -10,27 +10,18 @@
#include <QString>
#include <QByteArray>
#include <QDateTime>
+#include <QSharedPointer>
#include <odb/core.hxx>
-// Include TR1 <memory> header in a compiler-specific fashion. Fall back
-// on the Boost implementation if the compiler does not support TR1.
-//
-#include <odb/tr1/memory.hxx>
-
-#include <odb/tr1/lazy-ptr.hxx>
-
-using std::tr1::shared_ptr;
-
-using odb::tr1::lazy_shared_ptr;
-using odb::tr1::lazy_weak_ptr;
+#include <odb/qt/lazy-ptr.hxx>
// Forward declarations.
//
class employer;
class employee;
-typedef std::vector<lazy_weak_ptr<employee> > employees;
+typedef std::vector<QLazyWeakPointer<employee> > employees;
#pragma db object
class employer
@@ -85,7 +76,7 @@ public:
const QString& last,
const QDate& born,
const QByteArray& public_key,
- shared_ptr<employer_type> employer)
+ QSharedPointer<employer_type> employer)
: first_ (first),
last_ (last),
born_ (born),
@@ -126,14 +117,14 @@ public:
// Employer.
//
- lazy_shared_ptr<employer_type>
+ QLazySharedPointer<employer_type>
employer () const
{
return employer_;
}
void
- employer (shared_ptr<employer_type> employer)
+ employer (QSharedPointer<employer_type> employer)
{
employer_ = employer;
}
@@ -154,7 +145,7 @@ private:
QByteArray public_key_;
#pragma db not_null
- lazy_shared_ptr<employer_type> employer_;
+ QLazySharedPointer<employer_type> employer_;
};
#endif // EMPLOYEE_HXX