summaryrefslogtreecommitdiff
path: root/lang/cxx/cxx_dbstream.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-02-17 17:25:57 +0000
committer <>2015-03-17 16:26:24 +0000
commit780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch)
tree598f8b9fa431b228d29897e798de4ac0c1d3d970 /lang/cxx/cxx_dbstream.cpp
parent7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff)
downloadberkeleydb-master.tar.gz
Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz.HEADdb-6.1.23master
Diffstat (limited to 'lang/cxx/cxx_dbstream.cpp')
-rw-r--r--lang/cxx/cxx_dbstream.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/lang/cxx/cxx_dbstream.cpp b/lang/cxx/cxx_dbstream.cpp
new file mode 100644
index 00000000..e158c384
--- /dev/null
+++ b/lang/cxx/cxx_dbstream.cpp
@@ -0,0 +1,55 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
+ *
+ * $Id$
+ */
+
+#include "db_config.h"
+
+#include "db_int.h"
+
+#include "db_cxx.h"
+#include "dbinc/cxx_int.h"
+
+#include "dbinc/db_page.h"
+#include "dbinc/db_am.h"
+#include "dbinc/blob.h"
+#include "dbinc/fop.h"
+#include "dbinc/mp.h"
+
+// Helper macro for simple methods that pass through to the
+// underlying C method. It may return an error or raise an exception.
+// Note this macro expects that input _argspec is an argument
+// list element (e.g., "char *arg") and that _arglist is the arguments
+// that should be passed through to the C method (e.g., "(db, arg)")
+//
+#define DBSTREAM_METHOD(_name, _argspec, _arglist) \
+int DbStream::_name _argspec \
+{ \
+ int ret; \
+ DB_STREAM *dbs = this; \
+ \
+ ret = dbs->_name _arglist; \
+ if (!DB_RETOK_STD(ret)) \
+ DB_ERROR(DbEnv::get_DbEnv(dbs->dbc->dbenv), \
+ "Dbstream::" # _name, ret, ON_ERROR_UNKNOWN); \
+ return (ret); \
+}
+
+// It's private, and should never be called, but VC4.0 needs it resolved
+//
+DbStream::~DbStream()
+{
+}
+
+DBSTREAM_METHOD(close, (u_int32_t _flags), (dbs, _flags));
+DBSTREAM_METHOD(read,
+ (Dbt *data, db_off_t offset, u_int32_t size, u_int32_t _flags),
+ (dbs, data, offset, size, _flags));
+DBSTREAM_METHOD(size, (db_off_t *size, u_int32_t _flags),
+ (dbs, size, _flags));
+DBSTREAM_METHOD(write, (Dbt *data, db_off_t offset, u_int32_t _flags),
+ (dbs, data, offset, _flags));
+