summaryrefslogtreecommitdiff
path: root/cpp/include/Freeze
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include/Freeze')
-rw-r--r--cpp/include/Freeze/Index.h64
-rw-r--r--cpp/include/Freeze/Initialize.h5
2 files changed, 68 insertions, 1 deletions
diff --git a/cpp/include/Freeze/Index.h b/cpp/include/Freeze/Index.h
new file mode 100644
index 00000000000..4a8ce94ac65
--- /dev/null
+++ b/cpp/include/Freeze/Index.h
@@ -0,0 +1,64 @@
+// **********************************************************************
+//
+// Copyright (c) 2003
+// ZeroC, Inc.
+// Billerica, MA, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#ifndef FREEZE_INDEX_H
+#define FREEZE_INDEX_H
+
+#include <Ice/Ice.h>
+#include <Freeze/DB.h>
+#include <vector>
+
+namespace Freeze
+{
+
+class IndexI;
+class EvictorI;
+
+class FREEZE_API Index : public IceUtil::Shared
+{
+public:
+
+ virtual ~Index();
+
+protected:
+
+ Index(const std::string&);
+
+ virtual bool
+ marshalKey(const Ice::ObjectPtr&, Freeze::Key&) const = 0;
+
+ std::vector<Ice::Identity>
+ untypedFindFirst(const Freeze::Key&, Ice::Int) const;
+
+ std::vector<Ice::Identity>
+ untypedFind(const Freeze::Key&) const;
+
+ Ice::Int
+ untypedCount(const Freeze::Key&) const;
+
+ friend class IndexI;
+
+ Ice::CommunicatorPtr _communicator;
+
+private:
+
+ friend class EvictorI;
+ IndexI* _impl;
+};
+
+typedef IceUtil::Handle<Index> IndexPtr;
+}
+
+#endif
+
diff --git a/cpp/include/Freeze/Initialize.h b/cpp/include/Freeze/Initialize.h
index 878effa39e4..3db454da69b 100644
--- a/cpp/include/Freeze/Initialize.h
+++ b/cpp/include/Freeze/Initialize.h
@@ -18,6 +18,7 @@
#include <Ice/Ice.h>
#include <Freeze/EvictorF.h>
#include <Freeze/ConnectionF.h>
+#include <Freeze/Index.h>
//
// Berkeley DB's DbEnv
@@ -29,13 +30,15 @@ namespace Freeze
FREEZE_API EvictorPtr createEvictor(const Ice::CommunicatorPtr& communicator,
const std::string& envName,
- const std::string& dbName,
+ const std::string& dbName,
+ const std::vector<Freeze::IndexPtr>& indices = std::vector<Freeze::IndexPtr>(),
bool createDb = true);
FREEZE_API EvictorPtr createEvictor(const Ice::CommunicatorPtr& communicator,
const std::string& envName,
DbEnv& dbEnv,
const std::string& dbName,
+ const std::vector<Freeze::IndexPtr>& indices = std::vector<Freeze::IndexPtr>(),
bool createDb = true);