summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/ObjectStore.h
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2014-08-22 13:57:27 -0700
committerMark Spruiell <mes@zeroc.com>2014-08-22 13:57:27 -0700
commit72f8cc4a94b6ff77be9c8d08f28ed6b23d59568e (patch)
tree3c3a82331886bb85928b2edff98f36c147ca88f1 /cpp/src/Freeze/ObjectStore.h
parentremove convertssl.py from RPMs (diff)
downloadice-72f8cc4a94b6ff77be9c8d08f28ed6b23d59568e.tar.bz2
ice-72f8cc4a94b6ff77be9c8d08f28ed6b23d59568e.tar.xz
ice-72f8cc4a94b6ff77be9c8d08f28ed6b23d59568e.zip
ICE-5225 - Freeze changes
Diffstat (limited to 'cpp/src/Freeze/ObjectStore.h')
-rw-r--r--cpp/src/Freeze/ObjectStore.h35
1 files changed, 32 insertions, 3 deletions
diff --git a/cpp/src/Freeze/ObjectStore.h b/cpp/src/Freeze/ObjectStore.h
index 7c2cdea8e5b..8a73f68bbda 100644
--- a/cpp/src/Freeze/ObjectStore.h
+++ b/cpp/src/Freeze/ObjectStore.h
@@ -41,11 +41,40 @@ public:
const Ice::ObjectPtr& sampleServant() const;
bool dbHasObject(const Ice::Identity&, const TransactionIPtr&) const;
- void save(Key& key, Value& value, Ice::Byte status, DbTxn* tx);
+ void save(Dbt&, Dbt&, Ice::Byte, DbTxn*);
+
+ //
+ // This base class encapsulates a BasicStream, which allows us to avoid
+ // making any extra copies of marshaled data when updating the database.
+ //
+ class Marshaler
+ {
+ public:
+
+ Marshaler(const Ice::CommunicatorPtr&, const Ice::EncodingVersion&);
+
+ void getDbt(Dbt&) const;
+
+ protected:
+
+ IceInternal::BasicStream _os;
+ };
+
+ class KeyMarshaler : public Marshaler
+ {
+ public:
+
+ KeyMarshaler(const Ice::Identity&, const Ice::CommunicatorPtr&, const Ice::EncodingVersion&);
+ };
+
+ class ValueMarshaler : public Marshaler
+ {
+ public:
+
+ ValueMarshaler(const ObjectRecord&, const Ice::CommunicatorPtr&, const Ice::EncodingVersion&, bool);
+ };
- static void marshal(const Ice::Identity&, Key&, const Ice::CommunicatorPtr&, const Ice::EncodingVersion&);
static void unmarshal(Ice::Identity&, const Key&, const Ice::CommunicatorPtr&, const Ice::EncodingVersion&);
- static void marshal(const ObjectRecord&, Value&, const Ice::CommunicatorPtr&, const Ice::EncodingVersion&, bool);
static void unmarshal(ObjectRecord&, const Value&, const Ice::CommunicatorPtr&, const Ice::EncodingVersion&, bool);
bool load(const Ice::Identity&, const TransactionIPtr&, ObjectRecord&);