aboutsummaryrefslogtreecommitdiff
path: root/libbrep/build-package.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-12-09 15:47:34 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-12-09 15:47:34 +0300
commitd259750511b3c2aaeace49f8ccb1d7f3ad561452 (patch)
tree9a98e1a2a66fc8a25dc1b58efd2e7e0e77201914 /libbrep/build-package.hxx
parent4bc9390c48cee736917ead5d20aa216fe10bae47 (diff)
Prepare for supporting multiple ids in requirement alternative
Diffstat (limited to 'libbrep/build-package.hxx')
-rw-r--r--libbrep/build-package.hxx28
1 files changed, 26 insertions, 2 deletions
diff --git a/libbrep/build-package.hxx b/libbrep/build-package.hxx
index 77520d1..c46119d 100644
--- a/libbrep/build-package.hxx
+++ b/libbrep/build-package.hxx
@@ -135,17 +135,41 @@ namespace brep
// requirements
//
- #pragma db member(requirement_key::outer) column("requirement_index")
- #pragma db member(requirement_key::inner) column("index")
+ // Note that this is a 2-level nested container (see package.hxx for
+ // details).
+ //
+ // Container of the requirement_alternatives values.
+ //
#pragma db member(requirements) id_column("") value_column("")
+
+ // Container of the requirement_alternative values.
+ //
+ #pragma db member(requirement_alternative_key::outer) column("requirement_index")
+ #pragma db member(requirement_alternative_key::inner) column("index")
+
#pragma db member(requirement_alternatives) \
virtual(requirement_alternatives_map) \
after(requirements) \
get(odb::nested_get (this.requirements)) \
set(odb::nested_set (this.requirements, std::move (?))) \
+ id_column("") key_column("") value_column("")
+
+ // Container of the requirement (string) values.
+ //
+ #pragma db member(requirement_key::outer) column("requirement_index")
+ #pragma db member(requirement_key::middle) column("alternative_index")
+ #pragma db member(requirement_key::inner) column("index")
+
+ #pragma db member(requirement_alternative_requirements) \
+ virtual(requirement_alternative_requirements_map) \
+ after(requirement_alternatives) \
+ get(odb::nested2_get (this.requirements)) \
+ set(odb::nested2_set (this.requirements, std::move (?))) \
id_column("") key_column("") value_column("id")
+ // tests, builds, and constraints
+ //
#pragma db member(tests) id_column("") value_column("test_")
#pragma db member(builds) id_column("") value_column("")
#pragma db member(constraints) id_column("") value_column("")