diff options
Diffstat (limited to 'common/definition')
-rw-r--r-- | common/definition/.gitignore | 6 | ||||
-rw-r--r-- | common/definition/buildfile | 52 | ||||
-rw-r--r-- | common/definition/driver.cxx | 56 | ||||
-rw-r--r-- | common/definition/test.hxx | 26 | ||||
-rw-r--r-- | common/definition/testscript | 33 | ||||
-rw-r--r-- | common/definition/time-mapping.hxx | 17 |
6 files changed, 0 insertions, 190 deletions
diff --git a/common/definition/.gitignore b/common/definition/.gitignore deleted file mode 100644 index 5838670..0000000 --- a/common/definition/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# ODB-generated files. -# -time-mapping-odb.?xx -time-mapping-odb-*.?xx -time-mapping.sql -time-mapping-*.sql diff --git a/common/definition/buildfile b/common/definition/buildfile deleted file mode 100644 index 09ad1db..0000000 --- a/common/definition/buildfile +++ /dev/null @@ -1,52 +0,0 @@ -# file : common/definition/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -hs = test time-mapping - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -for h: $hs -{ - exe{driver}: {hxx ixx cxx}{$h-odb} - - <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} - - for db: $databases - { - exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi - <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} - } -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix definition_ \ - --generate-schema - -<{hxx ixx cxx}{time-mapping-odb}>: odb_options = - -for db: $databases - {hxx ixx cxx}{time-mapping-odb-$db}: odb_options = - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx deleted file mode 100644 index 223eeaf..0000000 --- a/common/definition/driver.cxx +++ /dev/null @@ -1,56 +0,0 @@ -// file : common/definition/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test overriding composite value definition point. This is primarily -// useful to make composite values out of third-party types. -// - -#include <memory> // std::unique_ptr -#include <iostream> - -#include <odb/database.hxx> -#include <odb/transaction.hxx> - -#include <libcommon/common.hxx> - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include <cassert> - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr<database> db (create_database (argc, argv)); - - object o; - o.time.tv_sec = 1; - o.time.tv_usec = 1000; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr<object> p (db->load<object> (o.id)); - t.commit (); - - assert (p->time.tv_sec == o.time.tv_sec && - p->time.tv_usec == o.time.tv_usec); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/definition/test.hxx b/common/definition/test.hxx deleted file mode 100644 index 38fc02a..0000000 --- a/common/definition/test.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : common/definition/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#ifdef _WIN32 -# include <winsock2.h> // timeval -#else -# include <sys/time.h> // timeval -#endif - -#include <odb/core.hxx> - -#include "time-mapping.hxx" - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id; - - timeval time; -}; - -#endif // TEST_HXX diff --git a/common/definition/testscript b/common/definition/testscript deleted file mode 100644 index c9dea6d..0000000 --- a/common/definition/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/definition/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx deleted file mode 100644 index 469cfb7..0000000 --- a/common/definition/time-mapping.hxx +++ /dev/null @@ -1,17 +0,0 @@ -// file : common/definition/time-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TIME_MAPPING_HXX -#define TIME_MAPPING_HXX - -#ifdef _WIN32 -# include <winsock2.h> // timeval -#else -# include <sys/time.h> // timeval -#endif - -#pragma db value(timeval) definition -#pragma db member(timeval::tv_sec) column("sec") -#pragma db member(timeval::tv_usec) column("usec") - -#endif // TIME_MAPPING_HXX |