diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-08 13:20:09 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-08 13:20:09 +0200 |
commit | bebd8368d17b8bfe245cab04d6118f50933216d3 (patch) | |
tree | 3b25082333d7d615ee34f4ae4cc897dff187769c /odb/relational/source.hxx | |
parent | 8ea45e39522f7040048c28dbeae853eea6b03b71 (diff) |
Have separate table set for each schema generation pass
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r-- | odb/relational/source.hxx | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx index 8221ec2..3d82863 100644 --- a/odb/relational/source.hxx +++ b/odb/relational/source.hxx @@ -1780,7 +1780,7 @@ namespace relational init_id_image_member_ ("id_", "id"), init_id_value_member_ ("id"), schema_drop_ (schema_emitter_), - schema_create_ (schema_emitter_, pass_) + schema_create_ (schema_emitter_) { init (); } @@ -1794,7 +1794,7 @@ namespace relational init_id_image_member_ ("id_", "id"), init_id_value_member_ ("id"), schema_drop_ (schema_emitter_), - schema_create_ (schema_emitter_, pass_) + schema_create_ (schema_emitter_) { init (); } @@ -2629,24 +2629,19 @@ namespace relational // Pass 0. // - pass_ = 0; - schema_emitter_.pass (pass_); + schema_emitter_.pass (0); schema_drop_->traverse (c); close = close || !schema_emitter_.empty (); - // Pass 1. + // Pass 1 and 2. // - pass_ = 1; - schema_emitter_.pass (pass_); - schema_create_->traverse (c); - close = close || !schema_emitter_.empty (); - - // Pass 2. - // - pass_ = 2; - schema_emitter_.pass (pass_); - schema_create_->traverse (c); - close = close || !schema_emitter_.empty (); + for (unsigned short pass (1); pass < 3; ++pass) + { + schema_emitter_.pass (pass); + schema_create_->pass (pass); + schema_create_->traverse (c); + close = close || !schema_emitter_.empty (); + } if (close) // Close the last case and the switch block. os << "return false;" @@ -2776,7 +2771,6 @@ namespace relational traversal::names init_value_member_names_; instance<init_value_member> init_id_value_member_; - unsigned short pass_; schema_emitter schema_emitter_; instance<schema::class_drop> schema_drop_; instance<schema::class_create> schema_create_; |