diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-18 17:46:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-18 17:46:03 +0200 |
commit | bd536de7b694c0a631a9024d0f54bf25f374d253 (patch) | |
tree | cb173b1ffcf0e3a3cd7119bc14ab3d2f2ac3c795 | |
parent | b336e7a1671fdd504759f87bc5ed23fbc7bcf717 (diff) |
Detect container of containers via composite value2.5.0-a9
-rw-r--r-- | diagnostics/containers-of-containers.hxx | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/diagnostics/containers-of-containers.hxx b/diagnostics/containers-of-containers.hxx new file mode 100644 index 0000000..0b40d3b --- /dev/null +++ b/diagnostics/containers-of-containers.hxx @@ -0,0 +1,69 @@ +// file : common/id/auto/test.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include <map> +#include <vector> + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + +#pragma db value +struct value_cont +{ + int n; + std::vector<int> v; +}; + +#pragma db value +struct value_blob +{ + int n; + #pragma db type(BLOB_TYPE) + std::vector<char> v; +}; + +#pragma db object +struct object +{ + #pragma db id + int id; + + //std::vector<std::vector<int> > vv; + + std::vector<value_cont> vc; + std::map<int, value_cont> mc; + + std::vector<value_blob> vb; + std::map<int, value_blob> mb; +}; + +/* + +#include <array> +#include <vector> + +using float3 = std::array<float, 3>; + +#pragma db value(float3) transient +#pragma db member(float3::e1) virtual(float) get(this[0]) set(this[0]) +#pragma db member(float3::e2) virtual(float) get(this[1]) set(this[1]) +#pragma db member(float3::e3) virtual(float) get(this[2]) set(this[2]) + +#pragma db object +struct object +{ + #pragma db id + int id; + + std::vector<float3> vf3; +}; + +*/ |