diff options
Diffstat (limited to 'diagnostics/containers-of-containers.hxx')
-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; +}; + +*/ |