diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-24 10:18:09 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-24 10:18:09 +0200 |
commit | e412109818a7e1b77c3cc955cadf56b34dde44a5 (patch) | |
tree | 87da489a11abce552585b8ce3bb25c157b03f79e | |
parent | 549e6c509d99b2366dabb94b46623940a6d96052 (diff) |
Add support for unordered storage of ordered containers
New pragma: unordered.
-rw-r--r-- | odb/container-traits.hxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/odb/container-traits.hxx b/odb/container-traits.hxx index 0d88731..ca20539 100644 --- a/odb/container-traits.hxx +++ b/odb/container-traits.hxx @@ -35,6 +35,16 @@ namespace odb typedef I index_type; typedef V value_type; + // Return true if the order is preserved in the database. If the + // order is not preserved, then the index argument in the functions + // below is not used. + // + bool + ordered () const + { + return ordered_; + } + void insert_one (I index, const V& value) const { @@ -68,8 +78,15 @@ namespace odb { } + void + ordered (bool v) + { + ordered_ = v; + } + private: void* data_; + bool ordered_; insert_one_type insert_one_; load_all_type load_all_; delete_all_type delete_all_; |