aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-28 14:10:36 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-11-01 13:14:54 +0200
commit1cc4eb4d11c08f986408c9b671840b6e077b42ff (patch)
tree921edc4bc088281127327bb10581737d2517c399
parent02e8f9f8d3276433398bc04bf66ff8e55e8d3d31 (diff)
Implement lob_auto_descriptor
-rw-r--r--odb/oracle/auto-descriptor.hxx4
-rw-r--r--odb/oracle/oracle-types.hxx38
2 files changed, 37 insertions, 5 deletions
diff --git a/odb/oracle/auto-descriptor.hxx b/odb/oracle/auto-descriptor.hxx
index a6c82a3..cd537ef 100644
--- a/odb/oracle/auto-descriptor.hxx
+++ b/odb/oracle/auto-descriptor.hxx
@@ -85,11 +85,11 @@ namespace odb
d_ = d;
}
- private:
+ protected:
auto_descriptor (const auto_descriptor&);
auto_descriptor& operator= (const auto_descriptor&);
- private:
+ protected:
D* d_;
};
}
diff --git a/odb/oracle/oracle-types.hxx b/odb/oracle/oracle-types.hxx
index 7f2c46d..1e94894 100644
--- a/odb/oracle/oracle-types.hxx
+++ b/odb/oracle/oracle-types.hxx
@@ -98,8 +98,7 @@ 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 an
- // auto_descriptor<OCILobLocator>*.
+ // use, this is interpreted as an 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.
@@ -117,7 +116,7 @@ namespace odb
// An instance of this structure specifies the function to invoke and
// the context to pass just prior to the image associated with a query
- // is modified.
+ // being modified.
//
struct change_callback
{
@@ -126,6 +125,39 @@ namespace odb
void (*callback) (void*);
void* context;
};
+
+ // The LOB specialization of auto_descriptor allows for transparent
+ // transferal of LOB 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
+ : auto_descriptor<OCILobLocator>
+ {
+ public:
+ lob_auto_descriptor (OCILobLocator* l = 0)
+ : auto_descriptor<OCILobLocator> (l)
+ {
+ }
+
+ lob_auto_descriptor (lob_auto_descriptor& x)
+ : auto_descriptor<OCILobLocator> (0)
+ {
+ OCILobLocator* l (x.d_);
+ x.d_ = 0;
+ reset (l);
+ }
+
+ lob_auto_descriptor&
+ operator= (lob_auto_descriptor& x)
+ {
+ OCILobLocator* l (x.d_);
+ x.d_ = 0;
+ reset (l);
+
+ return *this;
+ }
+ };
}
}