diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-11-15 16:23:39 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-11-16 12:48:18 +0200 |
commit | 65b89ab22d0d2fe3cff2f3c071b3628b786afeb5 (patch) | |
tree | 73266e783901646ec1bdc8e5fc68f4b48ebf293d /odb/oracle/oracle-types.hxx | |
parent | f8d8de4ef1ec010cb81c75b00d8229204e7b1788 (diff) |
Refactor LOB descriptor, callback context, and temporary buffer handling
Due to image sharing amongst container statements, LOB binding placeholders
cannot be shared between parameter and result versions of a bind.
Diffstat (limited to 'odb/oracle/oracle-types.hxx')
-rw-r--r-- | odb/oracle/oracle-types.hxx | 49 |
1 files changed, 16 insertions, 33 deletions
diff --git a/odb/oracle/oracle-types.hxx b/odb/oracle/oracle-types.hxx index 5e08a87..01e5956 100644 --- a/odb/oracle/oracle-types.hxx +++ b/odb/oracle/oracle-types.hxx @@ -8,6 +8,8 @@ #include <odb/pre.hxx> +#include <odb/details/buffer.hxx> + #include <odb/oracle/version.hxx> #include <odb/oracle/oracle-fwd.hxx> #include <odb/oracle/auto-descriptor.hxx> @@ -103,11 +105,9 @@ namespace odb }; buffer_type type; // The type stored by buffer. - void* buffer; // Data buffer pointer. When result callbacks are in - // use, this is interpreted as a lob_auto_descriptor*. - ub2* size; // The number of bytes in buffer. When parameter - // callbacks are in use, this is interpreted as a ub4* - // indicating the current position. For LOB result + void* buffer; // Data buffer pointer. For LOB type bindings, this is + // interpreted as an oracle::lob*. + ub2* size; // The number of bytes in buffer. For LOB result // bindings, this is interpreted as the OCIDefine // handle associated with the LOB result parameter. ub4 capacity; // The maximum number of bytes that can be stored in @@ -134,39 +134,22 @@ namespace odb void* context; }; + // The lob structure wraps data required for both parameter and result + // LOB type bindings. // - // These specialized auto_descriptor classes allows for transparent - // transferal of descriptors between auto_descriptor instances. This - // simplifies the implementation of a private copy of the shared image - // associated with queries. - // - - class LIBODB_ORACLE_EXPORT lob_auto_descriptor: - public auto_descriptor<OCILobLocator> + struct LIBODB_ORACLE_EXPORT lob { - typedef auto_descriptor <OCILobLocator> base; - - public: - lob_auto_descriptor (OCILobLocator* l = 0) - : base (l) - { - } + lob (): locator (0), buffer (0), position_context (0) {} - lob_auto_descriptor (lob_auto_descriptor& x) - : base (x.d_) - { - x.d_ = 0; - } + lob (lob&); + lob& operator= (lob&); - lob_auto_descriptor& - operator= (lob_auto_descriptor& x) - { - OCILobLocator* l (x.d_); - x.d_ = 0; - reset (l); + ~lob (); - return *this; - } + public: + OCILobLocator* locator; + details::buffer* buffer; + ub4* position_context; }; // |