diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-10-14 14:07:39 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-10-14 14:33:16 +0200 |
commit | bbac9d4b7e9015811ad3dd3d49024981e7fce73d (patch) | |
tree | 04d92632e8e30315555412fb70d90f01245cdc29 /odb/oracle/oracle-types.hxx | |
parent | 4b140934ad3c685b35f17719417cf760b62ae1f0 (diff) |
Correct the LOB callback aspects of the bind mechanism
The parameter callback context must be const qualified. This is both sensible
and necessary to avoid unecessary casts in the generated code during image
manipulation. The result callback context must not be const qualified as the
result callback should be permitted to modify it.
Both the callback and context members of the bind structure must be pointers
to the relevant union types in order for the binding mechanism to work
correctly.
Diffstat (limited to 'odb/oracle/oracle-types.hxx')
-rw-r--r-- | odb/oracle/oracle-types.hxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/odb/oracle/oracle-types.hxx b/odb/oracle/oracle-types.hxx index 5864d0a..091a6d5 100644 --- a/odb/oracle/oracle-types.hxx +++ b/odb/oracle/oracle-types.hxx @@ -59,6 +59,12 @@ namespace odb result_callback_type result; }; + union lob_context + { + const void* param; + void* result; + }; + struct bind { // This enumeration identifies the possible buffer types that can be @@ -101,12 +107,12 @@ namespace odb // buffer. sb2* indicator; // Pointer to an OCI indicator variable. - lob_callback callback; + lob_callback* callback; // This pointer is provided to the user through the context argument // in both parameter and result callback functions. // - void* callback_context; + lob_context* context; }; } } |