From afd8e6dd307288b68c4ce6163f918198d92bf363 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 27 Sep 2011 17:13:09 +0200 Subject: Implement callbacks as non-inline functions --- odb/oracle/traits.cxx | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ odb/oracle/traits.hxx | 43 ++---------------------------------------- 2 files changed, 54 insertions(+), 41 deletions(-) diff --git a/odb/oracle/traits.cxx b/odb/oracle/traits.cxx index 6cf55c8..c934cc1 100644 --- a/odb/oracle/traits.cxx +++ b/odb/oracle/traits.cxx @@ -60,6 +60,31 @@ namespace odb // bool string_lob_value_traits:: + result_callback (void* c, void* b, ub4 s, chunk_position p) + { + string& v (*static_cast (c)); + + switch (p) + { + case one_chunk: + case first_chunk: + { + v.clear (); + + // Falling through. + } + case next_chunk: + case last_chunk: + { + v.append (static_cast (b), s); + break; + } + } + + return true; + } + + bool string_lob_value_traits:: param_callback (void* ctx, ub4* pos_ctx, void** b, @@ -131,6 +156,33 @@ namespace odb // default_value_traits, id_blob> // bool default_value_traits, id_blob>:: + result_callback (void* c, void* b, ub4 s, chunk_position p) + { + value_type& v (*static_cast (c)); + + switch (p) + { + case one_chunk: + case first_chunk: + { + v.clear (); + + // Falling through. + } + case next_chunk: + case last_chunk: + { + char* cb (static_cast (b)); + v.insert (v.end (), cb, cb + s); + + break; + } + } + + return true; + } + + bool default_value_traits, id_blob>:: param_callback (void* ctx, ub4* pos_ctx, void** b, diff --git a/odb/oracle/traits.hxx b/odb/oracle/traits.hxx index 30af2a3..687d28a 100644 --- a/odb/oracle/traits.hxx +++ b/odb/oracle/traits.hxx @@ -526,26 +526,7 @@ namespace odb } static bool - result_callback (void* context, void* buffer, ub4 size, chunk_position p) - { - std::string& v (*reinterpret_cast (context)); - - switch (p) - { - case one_chunk: - case first_chunk: - { - v.clear (); - } - case next_chunk: - case last_chunk: - { - v.append (reinterpret_cast (buffer), size); - } - } - - return true; - } + result_callback (void* context, void* buffer, ub4 size, chunk_position); static bool param_callback (void* context, @@ -675,27 +656,7 @@ namespace odb } static bool - result_callback (void* context, void* buffer, ub4 size, chunk_position p) - { - value_type& v (*reinterpret_cast (context)); - - switch (p) - { - case one_chunk: - case first_chunk: - { - v.clear (); - } - case next_chunk: - case last_chunk: - { - char* b (reinterpret_cast (buffer)); - v.insert (v.end (), b, b + size); - } - } - - return true; - } + result_callback (void* context, void* buffer, ub4 size, chunk_position); static bool param_callback (void* context, -- cgit v1.1