diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-10 10:04:20 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-21 15:39:59 +0200 |
commit | 51419aca9c4bcc056ee87d5aa26fe3076f4593ef (patch) | |
tree | 43cb3532098c3573a6b1d88717f72257aa77c8d6 /odb/context.hxx | |
parent | dcb7bcd541f77b280e5733da9ec1eb24574e0d9e (diff) |
Move to new "virtual functions in context" model
Diffstat (limited to 'odb/context.hxx')
-rw-r--r-- | odb/context.hxx | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/odb/context.hxx b/odb/context.hxx index d8c457b..23eb457 100644 --- a/odb/context.hxx +++ b/odb/context.hxx @@ -361,6 +361,8 @@ public: typedef std::map<string, db_type_type> type_map_type; + // Per-database customizable functionality. + // protected: typedef unsigned short column_type_flags; @@ -374,6 +376,28 @@ protected: // static column_type_flags const ctf_object_id_ref = 0x02; + // Return empty string if there is no mapping. The second argument + // is the custom type or empty string if it is not specified. + // + string + database_type (semantics::type& t, + string const& type, + semantics::context& c, + column_type_flags f) + { + return current ().database_type_impl (t, type, c, f); + } + + // The default implementation uses the type map (populated by the database- + // specific context implementation) to come up with a mapping. + // + virtual string + database_type_impl (semantics::type&, + string const& type, + semantics::context&, + column_type_flags); + +protected: struct data { virtual @@ -386,18 +410,6 @@ protected: semantics::class_* object_; - // Per-database customizable functionality. - // - public: - // Return empty string if there is no mapping. The second argument - // is the custom type or empty string if it is not specified. - // - virtual string - column_type_impl (semantics::type&, - string const& type, - semantics::context&, - column_type_flags) const; - keyword_set_type keyword_set_; type_map_type type_map_; }; |