From 5a16b0511ae3ac491ac23bba07f7259f6c255472 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 5 Sep 2012 11:59:28 +0200 Subject: Support for Boost uuid persistence New Boost sub-profile: uuid. New test: boost/common/uuid. Updated the boost example to use uuid as an object id. --- boost/common/uuid/test.hxx | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 boost/common/uuid/test.hxx (limited to 'boost/common/uuid/test.hxx') diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx new file mode 100644 index 0000000..d0138e4 --- /dev/null +++ b/boost/common/uuid/test.hxx @@ -0,0 +1,38 @@ +// file : boost/common/uuid/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + typedef boost::uuids::uuid uuid; + + uuid uuid_; + uuid null_; + + #pragma db not_null + uuid zero_; + + bool operator== (const object& x) const + { + return id_ == x.id_ && + uuid_ == x.uuid_ && + null_ == x.null_ && + zero_ == x.zero_; + } +}; + +#endif // TEST_HXX -- cgit v1.1