diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-03-08 18:06:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-03-08 18:06:26 +0200 |
commit | df5e58e6e5eb2727a185bf9a98a462c18fa3a83d (patch) | |
tree | fb0cc76643865390ac3e45462d51ea02575a3175 /bdep/project.hxx | |
parent | f9ebe2d1e920df001be2dd543a63677f8728f53d (diff) |
Setup project database infrastructure
Diffstat (limited to 'bdep/project.hxx')
-rw-r--r-- | bdep/project.hxx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bdep/project.hxx b/bdep/project.hxx index 6a748d5..274455c 100644 --- a/bdep/project.hxx +++ b/bdep/project.hxx @@ -5,13 +5,50 @@ #ifndef BDEP_PROJECT_HXX #define BDEP_PROJECT_HXX +#include <odb/core.hxx> + #include <bdep/types.hxx> #include <bdep/utility.hxx> #include <bdep/project-options.hxx> +#pragma db model version(1, 1, open) + +// Prevent assert() macro expansion in get/set expressions. This should appear +// after all #include directives since the assert() macro is redefined in each +// <assert.h> inclusion. +// +#ifdef ODB_COMPILER +# undef assert +# define assert assert +void assert (int); +#endif + namespace bdep { + #pragma db map type(dir_path) as(string) \ + to((?).string ()) from(bdep::dir_path (?)) + + //@@ TODO: do we need session/shared_ptr? + + #pragma db object pointer(shared_ptr) session + class configuration + { + public: + + dir_path path; // @@ TODO: relative or absolute? + string name; + + // Database mapping. + // + #pragma db member(name) id + //#pragma db member(name) index + + private: + friend class odb::access; + configuration () = default; + }; + // Given project_options (and CWD) locate the packages and their project. // The result is the absolute and normalized project directory and a vector // of relative (to the project directory) package directories (which will be |