summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/CHANGES10
-rw-r--r--cpp/demo/Freeze/phonebook/.depend16
-rw-r--r--cpp/demo/Freeze/phonebook/Collocated.cpp22
-rw-r--r--cpp/demo/Freeze/phonebook/ContactFactory.cpp14
-rw-r--r--cpp/demo/Freeze/phonebook/ContactFactory.h11
-rw-r--r--cpp/demo/Freeze/phonebook/Makefile12
-rw-r--r--cpp/demo/Freeze/phonebook/PhoneBook.ice21
-rw-r--r--cpp/demo/Freeze/phonebook/PhoneBookI.cpp303
-rw-r--r--cpp/demo/Freeze/phonebook/PhoneBookI.h24
-rw-r--r--cpp/demo/Freeze/phonebook/Server.cpp17
-rw-r--r--cpp/demo/Freeze/phonebook/config1
-rw-r--r--cpp/include/Freeze/Index.h64
-rw-r--r--cpp/include/Freeze/Initialize.h5
-rw-r--r--cpp/src/Freeze/EvictorI.cpp656
-rw-r--r--cpp/src/Freeze/EvictorI.h80
-rw-r--r--cpp/src/Freeze/EvictorIteratorI.cpp231
-rw-r--r--cpp/src/Freeze/EvictorIteratorI.h55
-rw-r--r--cpp/src/Freeze/Index.cpp48
-rw-r--r--cpp/src/Freeze/IndexI.cpp352
-rw-r--r--cpp/src/Freeze/IndexI.h61
-rw-r--r--cpp/src/Freeze/Makefile4
-rw-r--r--cpp/src/Freeze/MapI.cpp29
-rw-r--r--cpp/src/Freeze/SharedDb.cpp8
-rw-r--r--cpp/src/Freeze/SharedDbEnv.cpp11
-rw-r--r--cpp/src/Freeze/Util.cpp77
-rw-r--r--cpp/src/Freeze/Util.h66
-rw-r--r--cpp/src/slice2freeze/Main.cpp365
-rw-r--r--cpp/test/Ice/gc/.depend0
28 files changed, 1681 insertions, 882 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index b0b60bbdce6..35902bc3465 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -213,14 +213,17 @@ Changes since version 1.1.1
C++: Freeze::EvictorPtr
Freeze::createEvictor(const Ice::CommunicatorPtr& communicator,
const std::string& envName,
- const std::string& dbName,
+ const std::string& dbName,
+ const std::vector<IndexPtr> indices =
+ std::vector<IndexPtr>(),
bool createDb = true);
Java (in class Freeze.Util):
public static Evictor
createEvictor(Ice.Communicator communicator,
String envName,
- String dbName,
+ String dbName,
+ Index[] indices,
boolean createDb);
The persistence strategies have been removed.
@@ -269,6 +272,9 @@ Changes since version 1.1.1
EvictorIterator getIterator(int batchSize, bool loadServants);
+ You can also define Evictor indices for fast secondary key
+ lookups: see the Freeze/phonebook demo.
+
- Freeze now requires Berkeley DB 4.1. It no longer compiles with older
Berkeley DB releases.
diff --git a/cpp/demo/Freeze/phonebook/.depend b/cpp/demo/Freeze/phonebook/.depend
index ad199369674..049d0a3b519 100644
--- a/cpp/demo/Freeze/phonebook/.depend
+++ b/cpp/demo/Freeze/phonebook/.depend
@@ -4,16 +4,16 @@ Scanner.o: Scanner.cpp ../../../include/IceUtil/Config.h ../../../include/Ice/Ic
Parser.o: Parser.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h Parser.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
RunParser.o: RunParser.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h Parser.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
Client.o: Client.cpp ../../../include/Ice/Application.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h Parser.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
-PhoneBookI.o: PhoneBookI.cpp PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Ice/Config.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/GCF.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/DB.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIdentitiesDict.h
-NameIdentitiesDict.o: NameIdentitiesDict.cpp ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ObjectF.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/Buffer.h NameIdentitiesDict.h ../../../include/Freeze/Map.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/DB.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
-ContactFactory.o: ContactFactory.cpp ContactFactory.h PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Ice/Config.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/GCF.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/DB.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIdentitiesDict.h
-Server.o: Server.cpp ../../../include/Ice/Application.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ContactFactory.h PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/DB.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIdentitiesDict.h
+PhoneBookI.o: PhoneBookI.cpp PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Ice/Config.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/GCF.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Index.h ../../../include/Freeze/DB.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIndex.h
+ContactFactory.o: ContactFactory.cpp ContactFactory.h PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Ice/Config.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/GCF.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Index.h ../../../include/Freeze/DB.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIndex.h
+NameIndex.o: NameIndex.cpp ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ObjectF.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/Buffer.h NameIndex.h ../../../include/Freeze/Index.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/DB.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
+Server.o: Server.cpp ../../../include/Ice/Application.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ContactFactory.h PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Index.h ../../../include/Freeze/DB.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIndex.h
Grammar.o: Grammar.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h Parser.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
Scanner.o: Scanner.cpp ../../../include/IceUtil/Config.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h Parser.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h Grammar.h
Parser.o: Parser.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h Parser.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
RunParser.o: RunParser.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h Parser.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
-PhoneBookI.o: PhoneBookI.cpp PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Ice/Config.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/GCF.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/DB.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIdentitiesDict.h
-NameIdentitiesDict.o: NameIdentitiesDict.cpp ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ObjectF.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/Buffer.h NameIdentitiesDict.h ../../../include/Freeze/Map.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/DB.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
-ContactFactory.o: ContactFactory.cpp ContactFactory.h PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Ice/Config.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/GCF.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/DB.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIdentitiesDict.h
-Collocated.o: Collocated.cpp ../../../include/Ice/Application.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ContactFactory.h PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/DB.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIdentitiesDict.h Parser.h
+PhoneBookI.o: PhoneBookI.cpp PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Ice/Config.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/GCF.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Index.h ../../../include/Freeze/DB.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIndex.h
+ContactFactory.o: ContactFactory.cpp ContactFactory.h PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Ice/Config.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/GCF.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Index.h ../../../include/Freeze/DB.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIndex.h
+NameIndex.o: NameIndex.cpp ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ObjectF.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/Buffer.h NameIndex.h ../../../include/Freeze/Index.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Application.h ../../../include/Freeze/DB.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h
+Collocated.o: Collocated.cpp ../../../include/Ice/Application.h ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/IceUtil/GCF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/IceUtil/ObjectBase.h ../../../include/IceUtil/StaticRecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/StatsF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/IncomingAsync.h ContactFactory.h PhoneBookI.h ../../../include/IceUtil/IceUtil.h ../../../include/IceUtil/Functional.h ../../../include/IceUtil/Unicode.h ../../../include/IceUtil/UUID.h ../../../include/IceUtil/AbstractMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/RWRecMutex.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/StaticMutex.h ../../../include/IceUtil/Base64.h ../../../include/IceUtil/InputUtil.h ../../../include/IceUtil/OutputUtil.h ../../../include/IceUtil/GC.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/ConnectionF.h ../../../include/Freeze/Index.h ../../../include/Freeze/DB.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Exception.h ../../../include/Freeze/Map.h ../../../include/Freeze/Connection.h ../../../include/Freeze/Transaction.h ../../../include/Freeze/TransactionHolder.h PhoneBook.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/Ice/UserExceptionFactoryF.h NameIndex.h Parser.h
PhoneBook.cpp: PhoneBook.ice ../../../slice/Ice/Identity.ice
diff --git a/cpp/demo/Freeze/phonebook/Collocated.cpp b/cpp/demo/Freeze/phonebook/Collocated.cpp
index 2fc4da0e356..c7bb8a6a411 100644
--- a/cpp/demo/Freeze/phonebook/Collocated.cpp
+++ b/cpp/demo/Freeze/phonebook/Collocated.cpp
@@ -46,12 +46,18 @@ int
PhoneBookCollocated::run(int argc, char* argv[])
{
PropertiesPtr properties = communicator()->getProperties();
- string value;
-
+
+ //
+ // Create the name index.
+ //
+ NameIndexPtr index = new NameIndex("name");
+ vector<Freeze::IndexPtr> indices;
+ indices.push_back(index);
+
//
// Create an Evictor for contacts.
//
- Freeze::EvictorPtr evictor = Freeze::createEvictor(communicator(), _envName, "contacts");
+ Freeze::EvictorPtr evictor = Freeze::createEvictor(communicator(), _envName, "contacts", indices);
Int evictorSize = properties->getPropertyAsInt("PhoneBook.EvictorSize");
if(evictorSize > 0)
@@ -68,18 +74,14 @@ PhoneBookCollocated::run(int argc, char* argv[])
//
// Create the phonebook, and add it to the Object Adapter.
//
- PhoneBookIPtr phoneBook = new PhoneBookI(communicator(),
- _envName, "phonebook",
- evictor);
+ PhoneBookIPtr phoneBook = new PhoneBookI(evictor, index);
adapter->add(phoneBook, stringToIdentity("phonebook"));
//
- // Create and install a factory and initializer for contacts.
+ // Create and install a factory for contacts.
//
- ObjectFactoryPtr contactFactory = new ContactFactory(phoneBook, evictor);
- ServantInitializerPtr contactInitializer = ServantInitializerPtr::dynamicCast(contactFactory);
+ ObjectFactoryPtr contactFactory = new ContactFactory(evictor);
communicator()->addObjectFactory(contactFactory, "::Contact");
- evictor->installServantInitializer(contactInitializer);
//
// Everything ok, let's go.
diff --git a/cpp/demo/Freeze/phonebook/ContactFactory.cpp b/cpp/demo/Freeze/phonebook/ContactFactory.cpp
index 95388f6531a..cda6adc5df6 100644
--- a/cpp/demo/Freeze/phonebook/ContactFactory.cpp
+++ b/cpp/demo/Freeze/phonebook/ContactFactory.cpp
@@ -18,8 +18,7 @@ using namespace std;
using namespace Ice;
using namespace Freeze;
-ContactFactory::ContactFactory(const PhoneBookIPtr& phoneBook, const Freeze::EvictorPtr& evictor) :
- _phoneBook(phoneBook),
+ContactFactory::ContactFactory(const Freeze::EvictorPtr& evictor) :
_evictor(evictor)
{
}
@@ -28,7 +27,7 @@ ObjectPtr
ContactFactory::create(const string& type)
{
assert(type == "::Contact");
- return new ContactI(_phoneBook, _evictor);
+ return new ContactI(_evictor);
}
void
@@ -37,14 +36,5 @@ ContactFactory::destroy()
//
// Break cyclic object dependencies
//
- _phoneBook = 0;
_evictor = 0;
}
-
-void
-ContactFactory::initialize(const ObjectAdapterPtr&, const Identity& ident, const ObjectPtr& servant)
-{
- ContactIPtr contact = ContactIPtr::dynamicCast(servant);
- assert(contact);
- contact->setIdentity(ident);
-}
diff --git a/cpp/demo/Freeze/phonebook/ContactFactory.h b/cpp/demo/Freeze/phonebook/ContactFactory.h
index 525af1d3f8d..0c783e0844f 100644
--- a/cpp/demo/Freeze/phonebook/ContactFactory.h
+++ b/cpp/demo/Freeze/phonebook/ContactFactory.h
@@ -16,12 +16,13 @@
#define CONTACT_FACTORY_H
#include <PhoneBookI.h>
+#include <NameIndex.h>
-class ContactFactory : virtual public Ice::ObjectFactory, virtual public Freeze::ServantInitializer
+class ContactFactory : virtual public Ice::ObjectFactory
{
public:
- ContactFactory(const PhoneBookIPtr&, const Freeze::EvictorPtr&);
+ ContactFactory(const Freeze::EvictorPtr&);
//
// Operations from ObjectFactory
@@ -29,14 +30,8 @@ public:
virtual Ice::ObjectPtr create(const std::string&);
virtual void destroy();
- //
- // Operations from ServantInitializer
- //
- virtual void initialize(const Ice::ObjectAdapterPtr&, const Ice::Identity&, const Ice::ObjectPtr&);
-
private:
- PhoneBookIPtr _phoneBook;
Freeze::EvictorPtr _evictor;
};
diff --git a/cpp/demo/Freeze/phonebook/Makefile b/cpp/demo/Freeze/phonebook/Makefile
index dce2e3659cd..31783057523 100644
--- a/cpp/demo/Freeze/phonebook/Makefile
+++ b/cpp/demo/Freeze/phonebook/Makefile
@@ -30,8 +30,8 @@ COBJS = Grammar.o \
Client.o \
SOBJS = PhoneBookI.o \
- NameIdentitiesDict.o \
ContactFactory.o \
+ NameIndex.o \
Server.o
COLOBJS = Grammar.o \
@@ -39,8 +39,8 @@ COLOBJS = Grammar.o \
Parser.o \
RunParser.o \
PhoneBookI.o \
- NameIdentitiesDict.o \
ContactFactory.o \
+ NameIndex.o \
Collocated.o
SRCS = $(OBJS:.o=.cpp) \
@@ -66,12 +66,12 @@ $(COLLOCATED): $(OBJS) $(COLOBJS)
rm -f $@
$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COLOBJS) -lFreeze $(LIBS) $(DB_LIBS) $(READLINE_LIBS)
-NameIdentitiesDict.h NameIdentitiesDict.cpp: PhoneBook.ice $(SLICE2FREEZE)
- rm -f NameIdentitiesDict.h NameIdentitiesDict.cpp
- $(SLICE2FREEZE) $(ICECPPFLAGS) --dict NameIdentitiesDict,string,Identities NameIdentitiesDict PhoneBook.ice
+NameIndex.h NameIndex.cpp: PhoneBook.ice $(SLICE2FREEZE)
+ rm -f NameIndex.h NameIndex.cpp
+ $(SLICE2FREEZE) $(ICECPPFLAGS) --index NameIndex,Contact,name,case-insensitive NameIndex PhoneBook.ice
clean::
- rm -f NameIdentitiesDict.h NameIdentitiesDict.cpp
+ rm -f NameIndex.h NameIndex.cpp
clean::
rm -f Grammar.cpp Grammar.h
diff --git a/cpp/demo/Freeze/phonebook/PhoneBook.ice b/cpp/demo/Freeze/phonebook/PhoneBook.ice
index 7a06120b03a..2dedc1b90a0 100644
--- a/cpp/demo/Freeze/phonebook/PhoneBook.ice
+++ b/cpp/demo/Freeze/phonebook/PhoneBook.ice
@@ -25,17 +25,15 @@ exception DatabaseException
class Contact
{
nonmutating string getName();
- idempotent void setName(string name)
- throws DatabaseException;
+ void setName(string name) throws DatabaseException;
nonmutating string getAddress();
- idempotent void setAddress(string address);
+ void setAddress(string address);
nonmutating string getPhone();
- idempotent void setPhone(string phone);
+ void setPhone(string phone);
- void destroy()
- throws DatabaseException;
+ void destroy() throws DatabaseException;
string name;
string address;
@@ -43,17 +41,12 @@ class Contact
};
sequence<Contact*> Contacts;
-sequence<Ice::Identity> Identities; // Needed for slice2freeze
interface PhoneBook
{
- Contact* createContact()
- throws DatabaseException;
- nonmutating Contacts findContacts(string name)
- throws DatabaseException;
-
- idempotent void setEvictorSize(int size)
- throws DatabaseException;
+ Contact* createContact() throws DatabaseException;
+ nonmutating Contacts findContacts(string name) throws DatabaseException;
+ void setEvictorSize(int size) throws DatabaseException;
nonmutating void shutdown();
};
diff --git a/cpp/demo/Freeze/phonebook/PhoneBookI.cpp b/cpp/demo/Freeze/phonebook/PhoneBookI.cpp
index a9eb4732de5..9e3ddae0d9e 100644
--- a/cpp/demo/Freeze/phonebook/PhoneBookI.cpp
+++ b/cpp/demo/Freeze/phonebook/PhoneBookI.cpp
@@ -13,33 +13,20 @@
// **********************************************************************
#include <PhoneBookI.h>
+#include <IceUtil/UUID.h>
using namespace std;
using namespace Ice;
-ContactI::ContactI(const PhoneBookIPtr& phoneBook, const Freeze::EvictorPtr& evictor) :
- _phoneBook(phoneBook),
- _evictor(evictor),
- _destroyed(false)
-{
-}
-
-void
-ContactI::setIdentity(const Identity& ident)
+ContactI::ContactI(const Freeze::EvictorPtr& evictor) :
+ _evictor(evictor)
{
- _identity = ident;
}
string
ContactI::getName(const Ice::Current&) const
{
IceUtil::RWRecMutex::RLock sync(*this);
-
- if(_destroyed)
- {
- throw Ice::ObjectNotExistException(__FILE__, __LINE__);
- }
-
return name;
}
@@ -47,14 +34,6 @@ void
ContactI::setName(const string& newName, const Ice::Current&)
{
IceUtil::RWRecMutex::WLock sync(*this);
-
- if(_destroyed)
- {
- throw Ice::ObjectNotExistException(__FILE__, __LINE__);
- }
-
- assert(!_identity.name.empty());
- _phoneBook->move(_identity, name, newName);
name = newName;
}
@@ -62,12 +41,6 @@ string
ContactI::getAddress(const Ice::Current&) const
{
IceUtil::RWRecMutex::RLock sync(*this);
-
- if(_destroyed)
- {
- throw Ice::ObjectNotExistException(__FILE__, __LINE__);
- }
-
return address;
}
@@ -75,12 +48,6 @@ void
ContactI::setAddress(const string& newAddress, const Ice::Current&)
{
IceUtil::RWRecMutex::WLock sync(*this);
-
- if(_destroyed)
- {
- throw Ice::ObjectNotExistException(__FILE__, __LINE__);
- }
-
address = newAddress;
}
@@ -88,12 +55,6 @@ string
ContactI::getPhone(const Ice::Current&) const
{
IceUtil::RWRecMutex::RLock sync(*this);
-
- if(_destroyed)
- {
- throw Ice::ObjectNotExistException(__FILE__, __LINE__);
- }
-
return phone;
}
@@ -101,43 +62,16 @@ void
ContactI::setPhone(const string& newPhone, const Ice::Current&)
{
IceUtil::RWRecMutex::WLock sync(*this);
-
- if(_destroyed)
- {
- throw Ice::ObjectNotExistException(__FILE__, __LINE__);
- }
-
phone = newPhone;
}
void
-ContactI::destroy(const Ice::Current&)
+ContactI::destroy(const Ice::Current& c)
{
IceUtil::RWRecMutex::RLock sync(*this);
-
- if(_destroyed)
- {
- throw Ice::ObjectNotExistException(__FILE__, __LINE__);
- }
-
- _destroyed = true;
-
try
{
- assert(!_identity.name.empty());
- _phoneBook->remove(_identity, name);
-
- //
- // This can throw EvictorDeactivatedException (which indicates
- // an internal error). The exception is currently ignored.
- //
- _evictor->destroyObject(_identity);
- }
- catch(const Freeze::NotFoundException&)
- {
- //
- // Raised by remove. Ignore.
- //
+ _evictor->destroyObject(c.id);
}
catch(const Freeze::DatabaseException& ex)
{
@@ -147,12 +81,9 @@ ContactI::destroy(const Ice::Current&)
}
}
-PhoneBookI::PhoneBookI(const Ice::CommunicatorPtr& communicator,
- const std::string& envName, const std::string& dbName,
- const Freeze::EvictorPtr& evictor) :
+PhoneBookI::PhoneBookI(const Freeze::EvictorPtr& evictor, const NameIndexPtr& index) :
_evictor(evictor),
- _connection(Freeze::createConnection(communicator, envName)),
- _nameIdentitiesDict(_connection, dbName)
+ _index(index)
{
}
@@ -178,78 +109,39 @@ private:
ContactPrx
PhoneBookI::createContact(const Ice::Current& c)
{
- IceUtil::RWRecMutex::WLock sync(*this);
-
//
// Get a new unique identity.
//
- Identity ident = getNewIdentity();
+ Identity ident;
+ ident.name = IceUtil::generateUUID();
+ ident.category = "contact";
//
// Create a new Contact Servant.
//
- ContactIPtr contact = new ContactI(this, _evictor);
- contact->setIdentity(ident);
+ ContactIPtr contact = new ContactI(_evictor);
//
// Create a new Ice Object in the evictor, using the new identity
// and the new Servant.
//
- // This can throw EvictorDeactivatedException (which indicates
- // an internal error). The exception is currently ignored.
- //
_evictor->createObject(ident, contact);
+
//
- // Add the identity to our name/identities map. The initial name
- // is the empty string. See the comment in getNewIdentity why the
- // prefix "N" is needed.
+ // Turn the identity into a Proxy and return the Proxy to the
+ // caller.
//
- try
- {
- NameIdentitiesDict::iterator p = _nameIdentitiesDict.find("N");
- Identities identities;
- if(p != _nameIdentitiesDict.end())
- {
- identities = p->second;
- }
-
- identities.push_back(ident);
- _nameIdentitiesDict.put(NameIdentitiesDict::value_type(string("N"), identities));
-
- //
- // Turn the identity into a Proxy and return the Proxy to the
- // caller.
- //
- return IdentityToContact(c.adapter)(ident);
- }
- catch(const Freeze::DatabaseException& ex)
- {
- DatabaseException e;
- e.message = ex.message;
- throw e;
- }
+ return IdentityToContact(c.adapter)(ident);
}
Contacts
PhoneBookI::findContacts(const string& name, const Ice::Current& c) const
{
- IceUtil::RWRecMutex::RLock sync(*this);
-
try
{
- //
- // Lookup all phone book contacts that match a name, and
- // return them to the caller. See the comment in
- // getNewIdentity why the prefix "N" is needed.
- //
- NameIdentitiesDict::const_iterator p = _nameIdentitiesDict.find("N" + name);
- Identities identities;
- if(p != _nameIdentitiesDict.end())
- {
- identities = p->second;
- }
-
+ vector<Identity> identities = _index->find(name);
+
Contacts contacts;
contacts.reserve(identities.size());
transform(identities.begin(), identities.end(), back_inserter(contacts), IdentityToContact(c.adapter));
@@ -267,9 +159,6 @@ PhoneBookI::findContacts(const string& name, const Ice::Current& c) const
void
PhoneBookI::setEvictorSize(Int size, const Ice::Current&)
{
- //
- // No synchronization necessary, _evictor is immutable.
- //
_evictor->setSize(size);
}
@@ -279,161 +168,3 @@ PhoneBookI::shutdown(const Ice::Current& c) const
c.adapter->getCommunicator()->shutdown();
}
-void
-PhoneBookI::remove(const Identity& ident, const string& name)
-{
- IceUtil::RWRecMutex::WLock sync(*this);
-
- try
- {
- removeI(ident, name);
- }
- catch(const Freeze::DatabaseException& ex)
- {
- DatabaseException e;
- e.message = ex.message;
- throw e;
- }
-}
-
-void
-PhoneBookI::move(const Identity& ident, const string& oldName, const string& newName)
-{
- IceUtil::RWRecMutex::WLock sync(*this);
-
- try
- {
- //
- // Called by ContactI in case the name has been changed. See
- // the comment in getNewIdentity why the prefix "N" is needed.
- //
- removeI(ident, oldName);
- NameIdentitiesDict::iterator p = _nameIdentitiesDict.find("N" + newName);
- Identities identities;
- if(p != _nameIdentitiesDict.end())
- {
- identities = p->second;
- }
- identities.push_back(ident);
- _nameIdentitiesDict.put(NameIdentitiesDict::value_type("N" + newName, identities));
- }
- catch(const Freeze::NotFoundException&)
- {
- //
- // Raised by remove. This should only happen under very rare
- // circumstances if destroy() had gotten to the object prior
- // to the setName() operation being dispatched. Ignore the
- // exception.
- //
- }
- catch(const Freeze::DatabaseException& ex)
- {
- DatabaseException e;
- e.message = ex.message;
- throw e;
- }
-}
-
-Identity
-PhoneBookI::getNewIdentity()
-{
- try
- {
- //
- // This code is a bit of a hack. It stores the last identity
- // that has been used (or the name component thereof, to be
- // more precise) in the _nameIdentitiesDict, with the special
- // prefix "ID". Because of this, all "real" names need to be
- // prefixed with "N", so that there is no potential for a name
- // clash.
- //
-
- Ice::Long n;
- Identities ids;
- {
- NameIdentitiesDict::iterator p = _nameIdentitiesDict.find("ID");
- if(p == _nameIdentitiesDict.end())
- {
- n = 0;
- }
- else
- {
- ids = p->second;
- assert(ids.size() == 1);
-
- string::size_type sz;
- bool rc = IceUtil::stringToInt64(ids.front().name, n, sz);
- assert(rc);
- n += 1;
- }
- }
-
- char s[20];
-
-#if defined(ICE_64)
- sprintf(s, "%ld", n);
-#else
-# ifdef _WIN32
- sprintf(s, "%I64d", n);
-# else
- sprintf(s, "%lld", n);
-# endif
-#endif
- Identity id;
-
- id.name = s;
- ids.clear();
- ids.push_back(id);
-
- _nameIdentitiesDict.put(NameIdentitiesDict::value_type(string("ID"), ids));
-
- id.name = s;
- id.category = "contact";
- return id;
- }
- catch(const Freeze::DatabaseException& ex)
- {
- DatabaseException e;
- e.message = ex.message;
- throw e;
- }
-}
-
-//
-// Called with the RWRecMutex already acquired.
-//
-void
-PhoneBookI::removeI(const Identity& ident, const string& name)
-{
- //
- // See the comment in getNewIdentity why the prefix "N" is
- // needed.
- //
- NameIdentitiesDict::iterator p = _nameIdentitiesDict.find("N" + name);
-
- //
- // If the name isn't found then raise a record not found
- // exception.
- //
- if(p == _nameIdentitiesDict.end())
- {
- throw Freeze::NotFoundException(__FILE__, __LINE__);
- }
-
- Identities identities = p->second;
- identities.erase(remove_if(identities.begin(), identities.end(), bind2nd(equal_to<Ice::Identity>(), ident)),
- identities.end());
-
- if(identities.empty())
- {
- _nameIdentitiesDict.erase(p);
- }
- else
- {
- //
- // See the comment in getNewIdentity why the prefix "N" is
- // needed.
- //
- _nameIdentitiesDict.put(NameIdentitiesDict::value_type("N" + name, identities));
- }
-}
diff --git a/cpp/demo/Freeze/phonebook/PhoneBookI.h b/cpp/demo/Freeze/phonebook/PhoneBookI.h
index 89d4fac9a80..13487b8f367 100644
--- a/cpp/demo/Freeze/phonebook/PhoneBookI.h
+++ b/cpp/demo/Freeze/phonebook/PhoneBookI.h
@@ -19,7 +19,7 @@
#include <Ice/Ice.h>
#include <Freeze/Freeze.h>
#include <PhoneBook.h>
-#include <NameIdentitiesDict.h>
+#include <NameIndex.h>
class PhoneBookI;
typedef IceUtil::Handle<PhoneBookI> PhoneBookIPtr;
@@ -32,9 +32,7 @@ class ContactI : public Contact,
{
public:
- ContactI(const PhoneBookIPtr&, const Freeze::EvictorPtr&);
-
- void setIdentity(const Ice::Identity&);
+ ContactI(const Freeze::EvictorPtr&);
virtual std::string getName(const Ice::Current&) const;
virtual void setName(const std::string&, const Ice::Current&);
@@ -49,36 +47,24 @@ public:
private:
- PhoneBookIPtr _phoneBook;
Freeze::EvictorPtr _evictor;
- Ice::Identity _identity;
- bool _destroyed;
};
-class PhoneBookI : public PhoneBook, public IceUtil::RWRecMutex
+class PhoneBookI : public PhoneBook
{
public:
- PhoneBookI(const Ice::CommunicatorPtr& communicator,
- const std::string& envName, const std::string& dbName,
- const Freeze::EvictorPtr& evictor);
+ PhoneBookI(const Freeze::EvictorPtr& evictor, const NameIndexPtr& index);
virtual ContactPrx createContact(const Ice::Current&);
virtual Contacts findContacts(const std::string&, const Ice::Current&) const;
virtual void setEvictorSize(Ice::Int, const Ice::Current&);
virtual void shutdown(const Ice::Current&) const;
-
- void remove(const Ice::Identity&, const std::string&);
- void move(const Ice::Identity&, const std::string&, const std::string&);
- Ice::Identity getNewIdentity();
private:
- void removeI(const Ice::Identity&, const std::string&);
-
Freeze::EvictorPtr _evictor;
- Freeze::ConnectionPtr _connection;
- NameIdentitiesDict _nameIdentitiesDict;
+ NameIndexPtr _index;
};
#endif
diff --git a/cpp/demo/Freeze/phonebook/Server.cpp b/cpp/demo/Freeze/phonebook/Server.cpp
index ad35aead066..6e1ca0fca9c 100644
--- a/cpp/demo/Freeze/phonebook/Server.cpp
+++ b/cpp/demo/Freeze/phonebook/Server.cpp
@@ -47,9 +47,16 @@ PhoneBookServer::run(int argc, char* argv[])
PropertiesPtr properties = communicator()->getProperties();
//
+ // Create the name index.
+ //
+ NameIndexPtr index = new NameIndex("name");
+ vector<Freeze::IndexPtr> indices;
+ indices.push_back(index);
+
+ //
// Create an evictor for contacts.
//
- Freeze::EvictorPtr evictor = Freeze::createEvictor(communicator(), _envName, "contacts");
+ Freeze::EvictorPtr evictor = Freeze::createEvictor(communicator(), _envName, "contacts", indices);
Int evictorSize = properties->getPropertyAsInt("PhoneBook.EvictorSize");
if(evictorSize > 0)
@@ -66,16 +73,14 @@ PhoneBookServer::run(int argc, char* argv[])
//
// Create the phonebook, and add it to the object adapter.
//
- PhoneBookIPtr phoneBook = new PhoneBookI(communicator(), _envName, "phonebook", evictor);
+ PhoneBookIPtr phoneBook = new PhoneBookI(evictor, index);
adapter->add(phoneBook, stringToIdentity("phonebook"));
//
- // Create and install a factory and initializer for contacts.
+ // Create and install a factory for contacts.
//
- ObjectFactoryPtr contactFactory = new ContactFactory(phoneBook, evictor);
- ServantInitializerPtr contactInitializer = ServantInitializerPtr::dynamicCast(contactFactory);
+ ObjectFactoryPtr contactFactory = new ContactFactory(evictor);
communicator()->addObjectFactory(contactFactory, "::Contact");
- evictor->installServantInitializer(contactInitializer);
//
// Everything ok, let's go.
diff --git a/cpp/demo/Freeze/phonebook/config b/cpp/demo/Freeze/phonebook/config
index f0d8e012da4..8584db36212 100644
--- a/cpp/demo/Freeze/phonebook/config
+++ b/cpp/demo/Freeze/phonebook/config
@@ -2,7 +2,6 @@ Ice.Warn.Connections=1
#Ice.Trace.Network=3
#Ice.Trace.Protocol=1
-Freeze.Trace.Map=1
Freeze.Trace.Evictor=2
Freeze.Trace.DbEnv=2
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);
diff --git a/cpp/src/Freeze/EvictorI.cpp b/cpp/src/Freeze/EvictorI.cpp
index 0840ecab263..5024a24b5bc 100644
--- a/cpp/src/Freeze/EvictorI.cpp
+++ b/cpp/src/Freeze/EvictorI.cpp
@@ -5,7 +5,7 @@
// Billerica, MA, USA
//
// All Rights Reserved.
-//d
+//
// 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.
@@ -15,208 +15,24 @@
#include <Freeze/EvictorI.h>
#include <Freeze/Initialize.h>
#include <IceUtil/AbstractMutex.h>
-#include <sys/stat.h>
+#include <Freeze/Util.h>
+#include <Freeze/EvictorIteratorI.h>
+#include <Freeze/IndexI.h>
+
#include <typeinfo>
using namespace std;
using namespace Freeze;
using namespace Ice;
-#ifdef _WIN32
-# define FREEZE_DB_MODE 0
-#else
-# define FREEZE_DB_MODE (S_IRUSR | S_IWUSR)
-#endif
-
-namespace Freeze
-{
-
-class EvictorIteratorI : public EvictorIterator
-{
-public:
-
- EvictorIteratorI(EvictorI&, Int, bool);
-
- virtual bool hasNext();
- virtual Identity next();
-
-private:
-
- vector<Identity>::const_iterator
- nextBatch();
-
- EvictorI& _evictor;
- size_t _batchSize;
- bool _loadServants;
- vector<Identity>::const_iterator _batchIterator;
-
- Key _key;
- Value _value;
- vector<Identity> _batch;
- bool _more;
-};
-
-}
-
-namespace
-{
-
-inline void
-initializeInDbt(const vector<Byte>& v, Dbt& dbt)
-{
- dbt.set_data(const_cast<Byte*>(&v[0]));
- dbt.set_size(v.size());
- dbt.set_ulen(0);
- dbt.set_dlen(0);
- dbt.set_doff(0);
- dbt.set_flags(DB_DBT_USERMEM);
-}
-
-inline void
-initializeOutDbt(vector<Byte>& v, Dbt& dbt)
-{
- v.resize(v.capacity());
- dbt.set_data(&v[0]);
- dbt.set_size(0);
- dbt.set_ulen(v.size());
- dbt.set_dlen(0);
- dbt.set_doff(0);
- dbt.set_flags(DB_DBT_USERMEM);
-}
-
-void
-handleMemoryException(const DbMemoryException& dx, Key& key, Dbt& dbKey)
-{
- if(dbKey.get_size() > dbKey.get_ulen())
- {
- //
- // Keep the old key size in case it's used as input
- //
- size_t oldKeySize = key.size();
-
- key.resize(dbKey.get_size());
- initializeOutDbt(key, dbKey);
- dbKey.set_size(oldKeySize);
- }
- else
- {
- //
- // Real problem
- //
- DatabaseException ex(__FILE__, __LINE__);
- ex.message = dx.what();
- throw ex;
- }
-}
-
-void
-handleMemoryException(const DbMemoryException& dx, Key& key, Dbt& dbKey, Value& value, Dbt& dbValue)
-{
- bool resized = false;
- if(dbKey.get_size() > dbKey.get_ulen())
- {
- size_t oldKeySize = key.size();
- key.resize(dbKey.get_size());
- initializeOutDbt(key, dbKey);
- dbKey.set_size(oldKeySize);
- resized = true;
- }
-
- if(dbValue.get_size() > dbValue.get_ulen())
- {
- value.resize(dbValue.get_size());
- initializeOutDbt(value, dbValue);
- resized = true;
- }
-
- if(!resized)
- {
- //
- // Real problem
- //
- DatabaseException ex(__FILE__, __LINE__);
- ex.message = dx.what();
- throw ex;
- }
-}
-
-inline bool startWith(Key key, Key root)
-{
- if(root.size() > key.size())
- {
- return false;
- }
- return memcmp(&root[0], &key[0], root.size()) == 0;
-}
-
-//
-// Marshaling/unmarshaling persistent (key, data) pairs. The marshalRoot function
-// is used to create a key prefix containing only the key's identity.
-//
-
-void
-marshalRoot(const Identity& v, Key& bytes, const CommunicatorPtr& communicator)
-{
- IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
- IceInternal::BasicStream stream(instance.get());
- v.__write(&stream);
- bytes.swap(stream.b);
-}
-
-void
-marshal(const EvictorStorageKey& v, Key& bytes, const CommunicatorPtr& communicator)
-{
- IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
- IceInternal::BasicStream stream(instance.get());
- v.__write(&stream);
- bytes.swap(stream.b);
-}
-
-void
-unmarshal(EvictorStorageKey& v, const Key& bytes, const CommunicatorPtr& communicator)
-{
- IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
- IceInternal::BasicStream stream(instance.get());
- stream.b = bytes;
- stream.i = stream.b.begin();
- v.__read(&stream);
-}
-
-void
-marshal(const ObjectRecord& v, Value& bytes, const CommunicatorPtr& communicator)
-{
- IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
- IceInternal::BasicStream stream(instance.get());
- stream.marshalFacets(false);
- stream.startWriteEncaps();
- v.__write(&stream);
- stream.writePendingObjects();
- stream.endWriteEncaps();
- bytes.swap(stream.b);
-}
-
-void
-unmarshal(ObjectRecord& v, const Value& bytes, const CommunicatorPtr& communicator)
-{
- IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
- IceInternal::BasicStream stream(instance.get());
- stream.b = bytes;
- stream.i = stream.b.begin();
- stream.startReadEncaps();
- v.__read(&stream);
- stream.readPendingObjects();
- stream.endReadEncaps();
-}
-
-}
-
Freeze::EvictorPtr
Freeze::createEvictor(const CommunicatorPtr& communicator,
const string& envName,
const string& dbName,
+ const vector<IndexPtr>& indices,
bool createDb)
{
- return new EvictorI(communicator, envName, dbName, createDb);
+ return new EvictorI(communicator, envName, dbName, indices, createDb);
}
Freeze::EvictorPtr
@@ -224,50 +40,57 @@ Freeze::createEvictor(const CommunicatorPtr& communicator,
const string& envName,
DbEnv& dbEnv,
const string& dbName,
+ const vector<IndexPtr>& indices,
bool createDb)
{
- return new EvictorI(communicator, envName, dbEnv, dbName, createDb);
+ return new EvictorI(communicator, envName, dbEnv, dbName, indices, createDb);
}
Freeze::EvictorI::EvictorI(const CommunicatorPtr communicator,
const string& envName,
- const string& dbName,
+ const string& dbName,
+ const std::vector<Freeze::IndexPtr>& indices,
bool createDb) :
_evictorSize(10),
_deactivated(false),
_communicator(communicator),
_dbEnv(0),
_dbEnvHolder(SharedDbEnv::get(communicator, envName)),
+ _dbName(dbName),
+ _indices(indices),
_trace(0),
_generation(0)
{
_dbEnv = _dbEnvHolder.get();
- init(envName, dbName, createDb);
+ init(envName, createDb);
}
Freeze::EvictorI::EvictorI(const CommunicatorPtr communicator,
const string& envName,
DbEnv& dbEnv,
const string& dbName,
+ const std::vector<Freeze::IndexPtr>& indices,
bool createDb) :
_evictorSize(10),
_deactivated(false),
_communicator(communicator),
_dbEnv(&dbEnv),
+ _dbName(dbName),
+ _indices(indices),
_trace(0),
_generation(0)
{
- init(envName, dbName, createDb);
+ init(envName, createDb);
}
void
-Freeze::EvictorI::init(const string& envName, const string& dbName, bool createDb)
+Freeze::EvictorI::init(const string& envName, bool createDb)
{
_trace = _communicator->getProperties()->getPropertyAsInt("Freeze.Trace.Evictor");
- string propertyPrefix = string("Freeze.Evictor.") + envName + '.' + dbName;
+ string propertyPrefix = string("Freeze.Evictor.") + envName + '.' + _dbName;
//
// By default, we save every minute or when the size of the modified queue
@@ -293,18 +116,44 @@ Freeze::EvictorI::init(const string& envName, const string& dbName, bool createD
_maxTxSize = 100;
}
+ bool populateEmptyIndices =
+ (_communicator->getProperties()->
+ getPropertyAsIntWithDefault(propertyPrefix + ".PopulateEmptyIndices", 0) != 0);
+
+ DbTxn* txn = 0;
try
{
_db.reset(new Db(_dbEnv, 0));
- u_int32_t flags = DB_AUTO_COMMIT | DB_THREAD;
+
+ _dbEnv->txn_begin(0, &txn, 0);
+
+ u_int32_t flags = DB_THREAD;
if(createDb)
{
flags |= DB_CREATE;
}
- _db->open(0, dbName.c_str(), 0, DB_BTREE, flags, FREEZE_DB_MODE);
+ _db->open(txn, _dbName.c_str(), 0, DB_BTREE, flags, FREEZE_DB_MODE);
+
+ for(size_t i = 0; i < _indices.size(); ++i)
+ {
+ _indices[i]->_impl->associate(this, txn, createDb, populateEmptyIndices);
+ }
+ DbTxn* toCommit = txn;
+ txn = 0;
+ toCommit->commit(0);
}
catch(const DbException& dx)
{
+ if(txn != 0)
+ {
+ try
+ {
+ txn->abort();
+ }
+ catch(...)
+ {
+ }
+ }
DatabaseException ex(__FILE__, __LINE__);
ex.message = dx.what();
throw ex;
@@ -1145,6 +994,12 @@ Freeze::EvictorI::deactivate(const string&)
try
{
_db->close(0);
+
+ for(size_t i = 0; i < _indices.size(); ++i)
+ {
+ _indices[i]->_impl->close();
+ }
+ _indices.clear();
}
catch(const DbException& dx)
{
@@ -1483,46 +1338,61 @@ Freeze::EvictorI::load(Dbc* dbc, Key& key, Value& value,
EvictorStorageKey esk;
unmarshal(esk, key, _communicator);
- if(_trace >= 3)
+ if(root.size() == 0)
{
- Trace out(_communicator->getLogger(), "Freeze.Evictor");
- out << "reading facet identity = \"" << esk.identity << "\" ";
+
if(esk.facet.size() == 0)
{
- out << "(main object)";
+ //
+ // Good, we found the object
+ //
+ marshalRoot(esk.identity, root, _communicator);
}
else
{
- out << "facet = \"";
- for(size_t i = 0; i < esk.facet.size(); i++)
+ //
+ // Otherwise, skip this orphan facet (could be a temporary
+ // inconsistency on disk)
+ //
+
+ if(_trace >= 3)
{
- out << esk.facet[i];
- if(i != esk.facet.size() - 1)
- {
- out << ".";
- }
- else
- {
- out << "\"";
- }
+ Trace out(_communicator->getLogger(), "Freeze.Evictor");
+ out << "Iterator is skipping orphan facet \"" << esk.identity
+ << "\" " << esk.facet;
}
}
}
-
- FacetPtr facet = new Facet(elt.get());
- facet->status = clean;
- unmarshal(facet->rec, value, _communicator);
-
- pair<FacetMap::iterator, bool> pair;
- pair = elt->facets.insert(FacetMap::value_type(esk.facet, facet));
- assert(pair.second);
- if(root.size() == 0)
+ if(root.size() != 0)
{
- assert(esk.facet.size() == 0);
- identities.push_back(esk.identity);
- marshalRoot(esk.identity, root, _communicator);
- elt->mainObject = facet;
+ if(_trace >= 3)
+ {
+ Trace out(_communicator->getLogger(), "Freeze.Evictor");
+ out << "reading facet identity = \"" << esk.identity << "\" ";
+ if(esk.facet.size() == 0)
+ {
+ out << "(main object)";
+ }
+ else
+ {
+ out << "facet = " << esk.facet;
+ }
+ }
+
+ FacetPtr facet = new Facet(elt.get());
+ facet->status = clean;
+ unmarshal(facet->rec, value, _communicator);
+
+ pair<FacetMap::iterator, bool> pair;
+ pair = elt->facets.insert(FacetMap::value_type(esk.facet, facet));
+ assert(pair.second);
+
+ if(esk.facet.size() == 0)
+ {
+ identities.push_back(esk.identity);
+ elt->mainObject = facet;
+ }
}
initializeOutDbt(key, dbKey);
@@ -1549,10 +1419,13 @@ Freeze::EvictorI::load(Dbc* dbc, Key& key, Value& value,
}
}
}
- while(rs == 0 && startWith(key, root));
+ while(rs == 0 && (root.size() == 0 || startWith(key, root)));
- buildFacetMap(elt->facets);
- evictorElements.push_back(elt);
+ if(root.size() != 0)
+ {
+ buildFacetMap(elt->facets);
+ evictorElements.push_back(elt);
+ }
return (rs == 0);
}
@@ -1573,6 +1446,40 @@ Freeze::EvictorI::load(Dbc* dbc, Key& key, vector<Identity>& identities)
int rs = 0;
do
{
+ if(root.size() == 0)
+ {
+ EvictorStorageKey esk;
+ unmarshal(esk, key, _communicator);
+
+ if(esk.facet.size() == 0)
+ {
+ //
+ // Good, we found the object
+ //
+ marshalRoot(esk.identity, root, _communicator);
+
+ if(_trace >= 3)
+ {
+ Trace out(_communicator->getLogger(), "Freeze.Evictor");
+ out << "Iterator read \"" << esk.identity << "\"";
+ }
+ identities.push_back(esk.identity);
+ }
+ else
+ {
+ //
+ // Otherwise, skip this orphan facet (could be a temporary
+ // inconsistency on disk)
+ //
+ if(_trace >= 3)
+ {
+ Trace out(_communicator->getLogger(), "Freeze.Evictor");
+ out << "Iterator is skipping orphan facet \"" << esk.identity
+ << "\" " << esk.facet;
+ }
+ }
+ }
+
initializeOutDbt(key, dbKey);
for(;;)
@@ -1592,7 +1499,7 @@ Freeze::EvictorI::load(Dbc* dbc, Key& key, vector<Identity>& identities)
}
}
}
- while(rs == 0 && startWith(key, root));
+ while(rs == 0 && (root.size() == 0 || startWith(key, root)));
return (rs == 0);
}
@@ -1630,11 +1537,69 @@ Freeze::EvictorI::insert(const vector<Identity>& identities,
//
// Otherwise we don't insert anything
//
-
}
}
+//
+// Marshaling/unmarshaling persistent (key, data) pairs. The marshalRoot function
+// is used to create a key prefix containing only the key's identity.
+//
+
+void
+Freeze::EvictorI::marshalRoot(const Identity& v, Key& bytes, const CommunicatorPtr& communicator)
+{
+ IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
+ IceInternal::BasicStream stream(instance.get());
+ v.__write(&stream);
+ bytes.swap(stream.b);
+}
+
+void
+Freeze::EvictorI::marshal(const EvictorStorageKey& v, Key& bytes, const CommunicatorPtr& communicator)
+{
+ IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
+ IceInternal::BasicStream stream(instance.get());
+ v.__write(&stream);
+ bytes.swap(stream.b);
+}
+
+void
+Freeze::EvictorI::unmarshal(EvictorStorageKey& v, const Key& bytes, const CommunicatorPtr& communicator)
+{
+ IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
+ IceInternal::BasicStream stream(instance.get());
+ stream.b = bytes;
+ stream.i = stream.b.begin();
+ v.__read(&stream);
+}
+
+void
+Freeze::EvictorI::marshal(const ObjectRecord& v, Value& bytes, const CommunicatorPtr& communicator)
+{
+ IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
+ IceInternal::BasicStream stream(instance.get());
+ stream.marshalFacets(false);
+ stream.startWriteEncaps();
+ v.__write(&stream);
+ stream.writePendingObjects();
+ stream.endWriteEncaps();
+ bytes.swap(stream.b);
+}
+
+void
+Freeze::EvictorI::unmarshal(ObjectRecord& v, const Value& bytes, const CommunicatorPtr& communicator)
+{
+ IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
+ IceInternal::BasicStream stream(instance.get());
+ stream.b = bytes;
+ stream.i = stream.b.begin();
+ stream.startReadEncaps();
+ v.__read(&stream);
+ stream.readPendingObjects();
+ stream.endReadEncaps();
+}
+
void
Freeze::EvictorI::evict()
@@ -1881,19 +1846,7 @@ Freeze::EvictorI::load(const Identity& ident)
}
else
{
- out << "facet = \"";
- for(size_t i = 0; i < esk.facet.size(); i++)
- {
- out << esk.facet[i];
- if(i != esk.facet.size() - 1)
- {
- out << ".";
- }
- else
- {
- out << "\"";
- }
- }
+ out << "facet = " << esk.facet;
}
}
@@ -2213,9 +2166,8 @@ Freeze::EvictorI::buildFacetMap(const FacetMap& facets)
if(r == facets.end())
{
//
- // TODO: log warning for this orphan facet
+ // TODO: tracing for this orphna facet
//
- assert(0);
}
else
{
@@ -2223,8 +2175,6 @@ Freeze::EvictorI::buildFacetMap(const FacetMap& facets)
}
}
}
-
-
}
@@ -2245,214 +2195,6 @@ Freeze::EvictorI::EvictorElement::~EvictorElement()
{
}
-Freeze::EvictorIteratorI::EvictorIteratorI(EvictorI& evictor, Int batchSize, bool loadServants) :
- _evictor(evictor),
- _batchSize(static_cast<size_t>(batchSize)),
- _loadServants(loadServants),
- _key(1024),
- _more(true)
-{
- if(loadServants)
- {
- _value.resize(1024);
- }
- _batchIterator = _batch.end();
-}
-
-
-bool
-Freeze::EvictorIteratorI::hasNext()
-{
- if(_batchIterator != _batch.end())
- {
- return true;
- }
- else
- {
- _batchIterator = nextBatch();
- return (_batchIterator != _batch.end());
- }
-}
-
-Identity
-Freeze::EvictorIteratorI::next()
-{
- if(hasNext())
- {
- return *_batchIterator++;
- }
- else
- {
- throw Freeze::NoSuchElementException(__FILE__, __LINE__);
- }
-}
-
-
-vector<Identity>::const_iterator
-Freeze::EvictorIteratorI::nextBatch()
-{
- _batch.clear();
-
- if(!_more)
- {
- return _batch.end();
- }
-
- vector<EvictorI::EvictorElementPtr> evictorElements;
- evictorElements.reserve(_batchSize);
-
- Key firstKey;
- firstKey = _key;
-
- int loadedGeneration = 0;
-
- try
- {
- for(;;)
- {
- _batch.clear();
- evictorElements.clear();
-
- Dbt dbKey;
- initializeOutDbt(_key, dbKey);
-
- Dbt dbValue;
- if(_loadServants)
- {
- initializeOutDbt(_value, dbValue);
- }
- else
- {
- dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
- }
-
- Dbc* dbc = 0;
- try
- {
- //
- // Move to the first record
- //
- u_int32_t flags = DB_NEXT;
- if(_key.size() > 0)
- {
- //
- // _key represents the next element not yet returned
- // if it has been deleted, we want the one after
- //
- flags = DB_SET_RANGE;
-
- //
- // Will be used as input as well
- //
- dbKey.set_size(firstKey.size());
- }
-
- if(_loadServants)
- {
- loadedGeneration = _evictor.currentGeneration();
- }
-
- _evictor.db()->cursor(0, &dbc, 0);
-
- for(;;)
- {
- try
- {
- _more = (dbc->get(&dbKey, &dbValue, flags) == 0);
- if(_more)
- {
- _key.resize(dbKey.get_size());
- //
- // No need to resize data as we never use it as input
- //
- }
- break;
- }
- catch(const DbMemoryException& dx)
- {
- handleMemoryException(dx, _key, dbKey, _value, dbValue);
- }
- }
-
- while(_batch.size() < _batchSize && _more)
- {
- //
- // Even when count is 0, we read one more record (unless we reach the end)
- //
- if(_loadServants)
- {
- _more = _evictor.load(dbc, _key, _value, _batch, evictorElements);
- }
- else
- {
- _more = _evictor.load(dbc, _key, _batch);
- }
- }
-
- Dbc* toClose = dbc;
- dbc = 0;
- toClose->close();
- break; // for (;;)
- }
- catch(const DbDeadlockException&)
- {
- if(dbc != 0)
- {
- try
- {
- dbc->close();
- }
- catch(const DbDeadlockException&)
- {
- //
- // Ignored
- //
- }
- }
- _key = firstKey;
- //
- // Retry
- //
- }
- catch(...)
- {
- if(dbc != 0)
- {
- try
- {
- dbc->close();
- }
- catch(const DbDeadlockException&)
- {
- //
- // Ignored
- //
- }
- }
- throw;
- }
- }
- }
- catch(const DbException& dx)
- {
- DatabaseException ex(__FILE__, __LINE__);
- ex.message = dx.what();
- throw ex;
- }
-
- if(_batch.size() == 0)
- {
- return _batch.end();
- }
- else
- {
- if(_loadServants)
- {
- _evictor.insert(_batch, evictorElements, loadedGeneration);
- }
- return _batch.begin();
- }
-}
diff --git a/cpp/src/Freeze/EvictorI.h b/cpp/src/Freeze/EvictorI.h
index d8107e0d910..d244405d106 100644
--- a/cpp/src/Freeze/EvictorI.h
+++ b/cpp/src/Freeze/EvictorI.h
@@ -20,6 +20,7 @@
#include <Freeze/Evictor.h>
#include <Freeze/SharedDbEnv.h>
#include <Freeze/EvictorStorage.h>
+#include <Freeze/Index.h>
#include <Freeze/DB.h>
#include <list>
#include <vector>
@@ -33,8 +34,11 @@ class EvictorI : public Evictor, public IceUtil::Monitor<IceUtil::Mutex>, publi
{
public:
- EvictorI(const Ice::CommunicatorPtr, const std::string&, const std::string&, bool);
- EvictorI(const Ice::CommunicatorPtr, const std::string&, DbEnv&, const std::string&, bool);
+ EvictorI(const Ice::CommunicatorPtr, const std::string&, const std::string&,
+ const std::vector<Freeze::IndexPtr>&, bool);
+
+ EvictorI(const Ice::CommunicatorPtr, const std::string&, DbEnv&, const std::string&,
+ const std::vector<Freeze::IndexPtr>&, bool);
virtual ~EvictorI();
@@ -73,6 +77,12 @@ public:
Db*
db() const;
+ DbEnv*
+ dbEnv() const;
+
+ const std::string&
+ dbName() const;
+
int
currentGeneration() const;
@@ -122,6 +132,24 @@ public:
//
+ // marshaling/unmarshaling functions
+ //
+ static void
+ marshalRoot(const Ice::Identity&, Freeze::Key&, const Ice::CommunicatorPtr&);
+
+ static void
+ marshal(const Freeze::EvictorStorageKey&, Freeze::Key& bytes, const Ice::CommunicatorPtr&);
+
+ static void
+ unmarshal(Freeze::EvictorStorageKey&, const Freeze::Key&, const Ice::CommunicatorPtr&);
+
+ static void
+ marshal(const Freeze::ObjectRecord&, Freeze::Value&, const Ice::CommunicatorPtr&);
+
+ static void
+ unmarshal(Freeze::ObjectRecord&, const Freeze::Value&, const Ice::CommunicatorPtr&);
+
+ //
// Streamed objects
//
struct StreamedObject
@@ -172,9 +200,11 @@ public:
#endif
+
+
private:
- void init(const std::string& envName, const std::string& dbName, bool createDb);
+ void init(const std::string& envName, bool createDb);
void evict();
bool dbHasObject(const Ice::Identity&);
@@ -222,8 +252,14 @@ private:
DbEnv* _dbEnv;
SharedDbEnvPtr _dbEnvHolder;
+
+ std::string _dbName;
+
std::auto_ptr<Db> _db;
ServantInitializerPtr _initializer;
+
+ std::vector<Freeze::IndexPtr> _indices;
+
Ice::Int _trace;
//
@@ -264,6 +300,18 @@ EvictorI::db() const
return _db.get();
}
+inline DbEnv*
+EvictorI::dbEnv() const
+{
+ return _dbEnv;
+}
+
+inline const std::string&
+EvictorI::dbName() const
+{
+ return _dbName;
+}
+
inline int
EvictorI::currentGeneration() const
{
@@ -271,6 +319,32 @@ EvictorI::currentGeneration() const
return _generation;
}
+inline bool
+startWith(const Key& key, const Key& root)
+{
+ if(root.size() > key.size())
+ {
+ return false;
+ }
+ return memcmp(&root[0], &key[0], root.size()) == 0;
+}
+
+inline Ice::Trace&
+operator<<(Ice::Trace& os, const std::vector<std::string>& facetPath)
+{
+ os << '"';
+ for(size_t i = 0; i < facetPath.size(); i++)
+ {
+ os << facetPath[i];
+ if(i != facetPath.size() - 1)
+ {
+ os << '.';
+ }
+ }
+ os << '"';
+ return os;
+}
+
}
#endif
diff --git a/cpp/src/Freeze/EvictorIteratorI.cpp b/cpp/src/Freeze/EvictorIteratorI.cpp
new file mode 100644
index 00000000000..2d348e63b86
--- /dev/null
+++ b/cpp/src/Freeze/EvictorIteratorI.cpp
@@ -0,0 +1,231 @@
+// **********************************************************************
+//
+// 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.
+//
+// **********************************************************************
+
+#include <Freeze/EvictorIteratorI.h>
+#include <Freeze/EvictorI.h>
+#include <Freeze/Util.h>
+
+using namespace std;
+using namespace Freeze;
+using namespace Ice;
+
+
+Freeze::EvictorIteratorI::EvictorIteratorI(EvictorI& evictor, Int batchSize, bool loadServants) :
+ _evictor(evictor),
+ _batchSize(static_cast<size_t>(batchSize)),
+ _loadServants(loadServants),
+ _key(1024),
+ _more(true)
+{
+ if(loadServants)
+ {
+ _value.resize(1024);
+ }
+ _batchIterator = _batch.end();
+}
+
+
+bool
+Freeze::EvictorIteratorI::hasNext()
+{
+ if(_batchIterator != _batch.end())
+ {
+ return true;
+ }
+ else
+ {
+ _batchIterator = nextBatch();
+ return (_batchIterator != _batch.end());
+ }
+}
+
+Identity
+Freeze::EvictorIteratorI::next()
+{
+ if(hasNext())
+ {
+ return *_batchIterator++;
+ }
+ else
+ {
+ throw Freeze::NoSuchElementException(__FILE__, __LINE__);
+ }
+}
+
+
+vector<Identity>::const_iterator
+Freeze::EvictorIteratorI::nextBatch()
+{
+ _batch.clear();
+
+ if(!_more)
+ {
+ return _batch.end();
+ }
+
+ vector<EvictorI::EvictorElementPtr> evictorElements;
+ evictorElements.reserve(_batchSize);
+
+ Key firstKey;
+ firstKey = _key;
+
+ int loadedGeneration = 0;
+
+ try
+ {
+ for(;;)
+ {
+ _batch.clear();
+ evictorElements.clear();
+
+ Dbt dbKey;
+ initializeOutDbt(_key, dbKey);
+
+ Dbt dbValue;
+ if(_loadServants)
+ {
+ initializeOutDbt(_value, dbValue);
+ }
+ else
+ {
+ dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
+ }
+
+ Dbc* dbc = 0;
+ try
+ {
+ //
+ // Move to the first record
+ //
+ u_int32_t flags = DB_NEXT;
+ if(_key.size() > 0)
+ {
+ //
+ // _key represents the next element not yet returned
+ // if it has been deleted, we want the one after
+ //
+ flags = DB_SET_RANGE;
+
+ //
+ // Will be used as input as well
+ //
+ dbKey.set_size(firstKey.size());
+ }
+
+ if(_loadServants)
+ {
+ loadedGeneration = _evictor.currentGeneration();
+ }
+
+ _evictor.db()->cursor(0, &dbc, 0);
+
+ for(;;)
+ {
+ try
+ {
+ _more = (dbc->get(&dbKey, &dbValue, flags) == 0);
+ if(_more)
+ {
+ _key.resize(dbKey.get_size());
+ //
+ // No need to resize data as we never use it as input
+ //
+ }
+ break;
+ }
+ catch(const DbMemoryException& dx)
+ {
+ handleMemoryException(dx, _key, dbKey, _value, dbValue);
+ }
+ }
+
+ while(_batch.size() < _batchSize && _more)
+ {
+ //
+ // Even when count is 0, we read one more record (unless we reach the end)
+ //
+ if(_loadServants)
+ {
+ _more = _evictor.load(dbc, _key, _value, _batch, evictorElements);
+ }
+ else
+ {
+ _more = _evictor.load(dbc, _key, _batch);
+ }
+ }
+
+ Dbc* toClose = dbc;
+ dbc = 0;
+ toClose->close();
+ break; // for (;;)
+ }
+ catch(const DbDeadlockException&)
+ {
+ if(dbc != 0)
+ {
+ try
+ {
+ dbc->close();
+ }
+ catch(const DbDeadlockException&)
+ {
+ //
+ // Ignored
+ //
+ }
+ }
+ _key = firstKey;
+ //
+ // Retry
+ //
+ }
+ catch(...)
+ {
+ if(dbc != 0)
+ {
+ try
+ {
+ dbc->close();
+ }
+ catch(const DbDeadlockException&)
+ {
+ //
+ // Ignored
+ //
+ }
+ }
+ throw;
+ }
+ }
+ }
+ catch(const DbException& dx)
+ {
+ DatabaseException ex(__FILE__, __LINE__);
+ ex.message = dx.what();
+ throw ex;
+ }
+
+ if(_batch.size() == 0)
+ {
+ return _batch.end();
+ }
+ else
+ {
+ if(_loadServants)
+ {
+ _evictor.insert(_batch, evictorElements, loadedGeneration);
+ }
+ return _batch.begin();
+ }
+}
diff --git a/cpp/src/Freeze/EvictorIteratorI.h b/cpp/src/Freeze/EvictorIteratorI.h
new file mode 100644
index 00000000000..817570c2c36
--- /dev/null
+++ b/cpp/src/Freeze/EvictorIteratorI.h
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// 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_EVICTOR_ITERATOR_I_H
+#define FREEZE_EVICTOR_ITERATOR_I_H
+
+#include <Ice/Ice.h>
+#include <Freeze/Evictor.h>
+#include <Freeze/DB.h>
+#include <vector>
+
+namespace Freeze
+{
+
+class EvictorI;
+
+class EvictorIteratorI : public EvictorIterator
+{
+public:
+
+ EvictorIteratorI(EvictorI&, Ice::Int, bool);
+
+ virtual bool hasNext();
+ virtual Ice::Identity next();
+
+private:
+
+ std::vector<Ice::Identity>::const_iterator
+ nextBatch();
+
+ EvictorI& _evictor;
+ size_t _batchSize;
+ bool _loadServants;
+ std::vector<Ice::Identity>::const_iterator _batchIterator;
+
+ Key _key;
+ Value _value;
+ std::vector<Ice::Identity> _batch;
+ bool _more;
+};
+
+}
+
+#endif
diff --git a/cpp/src/Freeze/Index.cpp b/cpp/src/Freeze/Index.cpp
new file mode 100644
index 00000000000..db4034fce27
--- /dev/null
+++ b/cpp/src/Freeze/Index.cpp
@@ -0,0 +1,48 @@
+// **********************************************************************
+//
+// 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.
+//
+// **********************************************************************
+
+#include <Freeze/Index.h>
+#include <Freeze/IndexI.h>
+
+using namespace Freeze;
+using namespace Ice;
+using namespace std;
+
+Freeze::Index::~Index()
+{
+ delete _impl;
+}
+
+Freeze::Index::Index(const string& name) :
+ _impl(new IndexI(*this, name))
+{
+}
+
+vector<Identity>
+Freeze::Index::untypedFindFirst(const Key& bytes, Int firstN) const
+{
+ return _impl->untypedFindFirst(bytes, firstN);
+}
+
+vector<Identity>
+Freeze::Index::untypedFind(const Key& bytes) const
+{
+ return _impl->untypedFind(bytes);
+}
+
+Int
+Freeze::Index::untypedCount(const Key& bytes) const
+{
+ return _impl->untypedCount(bytes);
+}
diff --git a/cpp/src/Freeze/IndexI.cpp b/cpp/src/Freeze/IndexI.cpp
new file mode 100644
index 00000000000..42d4e2115e3
--- /dev/null
+++ b/cpp/src/Freeze/IndexI.cpp
@@ -0,0 +1,352 @@
+// **********************************************************************
+//
+// 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.
+//
+// **********************************************************************
+
+#include <Freeze/IndexI.h>
+#include <Freeze/Util.h>
+
+using namespace Freeze;
+using namespace Ice;
+using namespace std;
+
+
+static int
+callback(Db* secondary, const Dbt* key, const Dbt* value, Dbt* result)
+{
+ void* indexObj = secondary->get_app_private();
+ IndexI* index = static_cast<IndexI*>(indexObj);
+ assert(index != 0);
+ return index->secondaryKeyCreate(secondary, key, value, result);
+}
+
+
+Freeze::IndexI::IndexI(Index& index, const string& name) :
+ _index(index),
+ _name(name),
+ _evictor(0)
+{
+}
+
+vector<Identity>
+Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const
+{
+ Dbt dbKey;
+ initializeInDbt(bytes, dbKey);
+
+ //
+ // Berkeley DB 4.1.25 bug: it should not write into dbKey
+ //
+ dbKey.set_ulen(bytes.size());
+
+ Key pkey(1024);
+ Dbt pdbKey;
+ initializeOutDbt(pkey, pdbKey);
+
+ Dbt dbValue;
+ dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
+
+
+ Ice::CommunicatorPtr communicator = _evictor->communicator();
+ _evictor->saveNow();
+
+ vector<Identity> identities;
+
+ try
+ {
+ for(;;)
+ {
+ Dbc* dbc = 0;
+ identities.clear();
+
+ try
+ {
+ //
+ // Move to the first record
+ //
+ _db->cursor(0, &dbc, 0);
+ bool more;
+
+ for(;;)
+ {
+ try
+ {
+ more = (dbc->pget(&dbKey, &pdbKey, &dbValue, DB_SET) == 0);
+ if(more)
+ {
+ pkey.resize(pdbKey.get_size());
+ }
+ break; // for(;;)
+ }
+ catch(const DbMemoryException& dx)
+ {
+ handleMemoryException(dx, pkey, pdbKey);
+ }
+ }
+
+ while((firstN <= 0 || identities.size() < static_cast<size_t>(firstN)) && more)
+ {
+ EvictorStorageKey esk;
+ EvictorI::unmarshal(esk, pkey, communicator);
+
+ if(esk.facet.size() == 0)
+ {
+ identities.push_back(esk.identity);
+ }
+ //
+ // Else skip "orphan" facet (could be just a temporary inconsistency
+ // on disk)
+ //
+ for(;;)
+ {
+ try
+ {
+ more = (dbc->pget(&dbKey, &pdbKey, &dbValue, DB_NEXT_DUP) == 0);
+ if(more)
+ {
+ pkey.resize(pdbKey.get_size());
+ }
+ break; // for(;;)
+ }
+ catch(const DbMemoryException& dx)
+ {
+ handleMemoryException(dx, pkey, pdbKey);
+ }
+ }
+ }
+ Dbc* toClose = dbc;
+ dbc = 0;
+ toClose->close();
+ break; // for (;;)
+ }
+ catch(const DbDeadlockException& dx)
+ {
+ if(dbc != 0)
+ {
+ try
+ {
+ dbc->close();
+ }
+ catch(const DbDeadlockException&)
+ {
+ //
+ // Ignored
+ //
+ }
+ }
+ //
+ // Retry
+ //
+ }
+ catch(...)
+ {
+ if(dbc != 0)
+ {
+ try
+ {
+ dbc->close();
+ }
+ catch(const DbDeadlockException&)
+ {
+ //
+ // Ignored
+ //
+ }
+ }
+ throw;
+ }
+ }
+ }
+ catch(const DbException& dx)
+ {
+ DatabaseException ex(__FILE__, __LINE__);
+ ex.message = dx.what();
+ throw ex;
+ }
+
+ return identities;
+}
+
+vector<Identity>
+Freeze::IndexI::untypedFind(const Key& bytes) const
+{
+ return untypedFindFirst(bytes, 0);
+}
+
+Int
+Freeze::IndexI::untypedCount(const Key& bytes) const
+{
+
+ Dbt dbKey;
+ initializeInDbt(bytes, dbKey);
+
+ Dbt dbValue;
+ dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
+
+ _evictor->saveNow();
+ Int result = 0;
+
+ try
+ {
+ for(;;)
+ {
+ Dbc* dbc = 0;
+
+ try
+ {
+ //
+ // Move to the first record
+ //
+ _db->cursor(0, &dbc, 0);
+ bool found = (dbc->get(&dbKey, &dbValue, DB_SET) == 0);
+
+ if(found)
+ {
+ db_recno_t count = 0;
+ dbc->count(&count, 0);
+ result = static_cast<Int>(count);
+ }
+
+ Dbc* toClose = dbc;
+ dbc = 0;
+ toClose->close();
+ break; // for (;;)
+ }
+ catch(const DbDeadlockException& dx)
+ {
+ if(dbc != 0)
+ {
+ try
+ {
+ dbc->close();
+ }
+ catch(const DbDeadlockException&)
+ {
+ //
+ // Ignored
+ //
+ }
+ }
+ //
+ // Retry
+ //
+ }
+ catch(...)
+ {
+ if(dbc != 0)
+ {
+ try
+ {
+ dbc->close();
+ }
+ catch(const DbDeadlockException&)
+ {
+ //
+ // Ignored
+ //
+ }
+ }
+ throw;
+ }
+ }
+ }
+ catch(const DbException& dx)
+ {
+ DatabaseException ex(__FILE__, __LINE__);
+ ex.message = dx.what();
+ throw ex;
+ }
+
+ return result;
+}
+
+void
+Freeze::IndexI::associate(EvictorI* evictor, DbTxn* txn,
+ bool createDb, bool populateIndex)
+{
+ assert(txn != 0);
+ _evictor = evictor;
+ _index._communicator = evictor->communicator();
+
+ _db.reset(new Db(evictor->dbEnv(), 0));
+ _db->set_flags(DB_DUP | DB_DUPSORT);
+ _db->set_app_private(this);
+
+ u_int32_t flags = 0;
+ if(createDb)
+ {
+ flags = DB_CREATE;
+ }
+ _db->open(txn, (evictor->dbName() + "." + _name).c_str(), 0, DB_BTREE, flags, FREEZE_DB_MODE);
+
+ flags = 0;
+ if(populateIndex)
+ {
+ flags = DB_CREATE;
+ }
+ evictor->db()->associate(txn, _db.get(), callback, flags);
+}
+
+int
+Freeze::IndexI::secondaryKeyCreate(Db* secondary, const Dbt* dbKey,
+ const Dbt* dbValue, Dbt* result)
+{
+ Ice::CommunicatorPtr communicator = _evictor->communicator();
+
+ EvictorStorageKey esk;
+ Byte* first = static_cast<Byte*>(dbKey->get_data());
+ Key key(first, first + dbKey->get_size());
+ EvictorI::unmarshal(esk, key, communicator);
+
+ if(esk.facet.size() == 0)
+ {
+ ObjectRecord rec;
+ first = static_cast<Byte*>(dbValue->get_data());
+ Value value(first, first + dbValue->get_size());
+ EvictorI::unmarshal(rec, value, communicator);
+
+ Key bytes;
+ if(_index.marshalKey(rec.servant, bytes))
+ {
+ result->set_flags(DB_DBT_APPMALLOC);
+ void* data = malloc(bytes.size());
+ memcpy(data, &bytes[0], bytes.size());
+ result->set_data(data);
+ result->set_size(bytes.size());
+ return 0;
+ }
+ }
+
+ //
+ // Don't want to index this one
+ //
+ return DB_DONOTINDEX;
+}
+
+void
+Freeze::IndexI::close()
+{
+ if(_db.get() != 0)
+ {
+ try
+ {
+ _db->close(0);
+ }
+ catch(const DbException& dx)
+ {
+ DatabaseException ex(__FILE__, __LINE__);
+ ex.message = dx.what();
+ throw ex;
+ }
+ _db.reset(0);
+ }
+}
diff --git a/cpp/src/Freeze/IndexI.h b/cpp/src/Freeze/IndexI.h
new file mode 100644
index 00000000000..ca59018ac4b
--- /dev/null
+++ b/cpp/src/Freeze/IndexI.h
@@ -0,0 +1,61 @@
+// **********************************************************************
+//
+// 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_I_H
+#define FREEZE_INDEX_I_H
+
+#include <Ice/Ice.h>
+#include <Freeze/Index.h>
+#include <Freeze/EvictorI.h>
+
+namespace Freeze
+{
+
+class IndexI
+{
+public:
+
+ IndexI(Index&, const std::string&);
+
+ 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;
+
+ void
+ associate(EvictorI* evictor, DbTxn* txn, bool createDb, bool populateIndex);
+
+ int
+ secondaryKeyCreate(Db*, const Dbt*, const Dbt*, Dbt*);
+
+ void
+ close();
+
+
+
+private:
+
+ Index& _index;
+ std::string _name;
+ std::auto_ptr<Db> _db;
+ EvictorI* _evictor;
+};
+
+}
+#endif
+
diff --git a/cpp/src/Freeze/Makefile b/cpp/src/Freeze/Makefile
index 7d90e769150..ff9d5d34791 100644
--- a/cpp/src/Freeze/Makefile
+++ b/cpp/src/Freeze/Makefile
@@ -33,7 +33,11 @@ OBJS = DB.o \
TransactionI.o \
SharedDb.o \
MapI.o \
+ Util.o \
EvictorI.o \
+ EvictorIteratorI.o \
+ Index.o \
+ IndexI.o \
SharedDbEnv.o \
TransactionHolder.o
diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp
index ceb12e1ee2c..b108b6c1b7c 100644
--- a/cpp/src/Freeze/MapI.cpp
+++ b/cpp/src/Freeze/MapI.cpp
@@ -15,40 +15,13 @@
#include <Freeze/MapI.h>
#include <Freeze/Exception.h>
#include <Freeze/SharedDb.h>
+#include <Freeze/Util.h>
#include <stdlib.h>
using namespace std;
using namespace Ice;
using namespace Freeze;
-namespace
-{
-
-inline void
-initializeInDbt(const vector<Ice::Byte>& v, Dbt& dbt)
-{
- dbt.set_data(const_cast<Ice::Byte*>(&v[0]));
- dbt.set_size(v.size());
- dbt.set_ulen(0);
- dbt.set_dlen(0);
- dbt.set_doff(0);
- dbt.set_flags(DB_DBT_USERMEM);
-}
-
-inline void
-initializeOutDbt(vector<Ice::Byte>& v, Dbt& dbt)
-{
- v.resize(v.capacity());
- dbt.set_data(&v[0]);
- dbt.set_size(0);
- dbt.set_ulen(v.size());
- dbt.set_dlen(0);
- dbt.set_doff(0);
- dbt.set_flags(DB_DBT_USERMEM);
-}
-
-}
-
//
// MapHelper (from Map.h)
diff --git a/cpp/src/Freeze/SharedDb.cpp b/cpp/src/Freeze/SharedDb.cpp
index 143828d9fda..19e88243a29 100644
--- a/cpp/src/Freeze/SharedDb.cpp
+++ b/cpp/src/Freeze/SharedDb.cpp
@@ -15,18 +15,12 @@
#include <Freeze/SharedDb.h>
#include <IceUtil/StaticMutex.h>
#include <Freeze/Exception.h>
-#include <sys/stat.h>
+#include <Freeze/Util.h>
using namespace std;
using namespace IceUtil;
using namespace Ice;
-#ifdef _WIN32
-# define FREEZE_DB_MODE 0
-#else
-# define FREEZE_DB_MODE (S_IRUSR | S_IWUSR)
-#endif
-
namespace
{
diff --git a/cpp/src/Freeze/SharedDbEnv.cpp b/cpp/src/Freeze/SharedDbEnv.cpp
index 6c72ab34549..f088c65511d 100644
--- a/cpp/src/Freeze/SharedDbEnv.cpp
+++ b/cpp/src/Freeze/SharedDbEnv.cpp
@@ -16,22 +16,17 @@
#include <IceUtil/StaticMutex.h>
#include <IceUtil/Thread.h>
#include <Freeze/Exception.h>
+#include <Freeze/Util.h>
+
#include <cstdlib>
#include <map>
#include <memory>
-#include <sys/stat.h>
+
using namespace std;
using namespace IceUtil;
using namespace Ice;
-#ifdef _WIN32
-# define FREEZE_DB_MODE 0
-#else
-# define FREEZE_DB_MODE (S_IRUSR | S_IWUSR)
-#endif
-
-
namespace Freeze
{
diff --git a/cpp/src/Freeze/Util.cpp b/cpp/src/Freeze/Util.cpp
new file mode 100644
index 00000000000..ebaca432024
--- /dev/null
+++ b/cpp/src/Freeze/Util.cpp
@@ -0,0 +1,77 @@
+// **********************************************************************
+//
+// 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.
+//
+// **********************************************************************
+
+#include <Freeze/Util.h>
+#include <Freeze/Exception.h>
+
+using namespace Freeze;
+using namespace Ice;
+using namespace std;
+
+void
+Freeze::handleMemoryException(const DbMemoryException& dx, Key& key, Dbt& dbKey)
+{
+ if(dbKey.get_size() > dbKey.get_ulen())
+ {
+ //
+ // Keep the old key size in case it's used as input
+ //
+ size_t oldKeySize = key.size();
+
+ key.resize(dbKey.get_size());
+ initializeOutDbt(key, dbKey);
+ dbKey.set_size(oldKeySize);
+ }
+ else
+ {
+ //
+ // Real problem
+ //
+ DatabaseException ex(__FILE__, __LINE__);
+ ex.message = dx.what();
+ throw ex;
+ }
+}
+
+void
+Freeze::handleMemoryException(const DbMemoryException& dx, Key& key, Dbt& dbKey,
+ Value& value, Dbt& dbValue)
+{
+ bool resized = false;
+ if(dbKey.get_size() > dbKey.get_ulen())
+ {
+ size_t oldKeySize = key.size();
+ key.resize(dbKey.get_size());
+ initializeOutDbt(key, dbKey);
+ dbKey.set_size(oldKeySize);
+ resized = true;
+ }
+
+ if(dbValue.get_size() > dbValue.get_ulen())
+ {
+ value.resize(dbValue.get_size());
+ initializeOutDbt(value, dbValue);
+ resized = true;
+ }
+
+ if(!resized)
+ {
+ //
+ // Real problem
+ //
+ DatabaseException ex(__FILE__, __LINE__);
+ ex.message = dx.what();
+ throw ex;
+ }
+}
diff --git a/cpp/src/Freeze/Util.h b/cpp/src/Freeze/Util.h
new file mode 100644
index 00000000000..e5ec22b758a
--- /dev/null
+++ b/cpp/src/Freeze/Util.h
@@ -0,0 +1,66 @@
+// **********************************************************************
+//
+// 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_UTIL_H
+#define FREEZE_UTIL_H
+
+#include <Ice/Ice.h>
+#include <Freeze/DB.h>
+#include <db_cxx.h>
+#include <sys/stat.h>
+
+#ifdef _WIN32
+# define FREEZE_DB_MODE 0
+#else
+# define FREEZE_DB_MODE (S_IRUSR | S_IWUSR)
+#endif
+
+
+namespace Freeze
+{
+
+inline void
+initializeInDbt(const std::vector<Ice::Byte>& v, Dbt& dbt)
+{
+ dbt.set_data(const_cast<Ice::Byte*>(&v[0]));
+ dbt.set_size(v.size());
+ dbt.set_ulen(0);
+ dbt.set_dlen(0);
+ dbt.set_doff(0);
+ dbt.set_flags(DB_DBT_USERMEM);
+}
+
+inline void
+initializeOutDbt(std::vector<Ice::Byte>& v, Dbt& dbt)
+{
+ v.resize(v.capacity());
+ dbt.set_data(&v[0]);
+ dbt.set_size(0);
+ dbt.set_ulen(v.size());
+ dbt.set_dlen(0);
+ dbt.set_doff(0);
+ dbt.set_flags(DB_DBT_USERMEM);
+}
+
+void
+handleMemoryException(const DbMemoryException&, Key&, Dbt&);
+
+void
+handleMemoryException(const DbMemoryException&, Key&, Dbt&, Value&, Dbt&);
+
+}
+
+
+#endif
+
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp
index 8e6bfc0508c..6eeb1ad285f 100644
--- a/cpp/src/slice2freeze/Main.cpp
+++ b/cpp/src/slice2freeze/Main.cpp
@@ -27,6 +27,14 @@ struct Dict
string value;
};
+struct Index
+{
+ string name;
+ string type;
+ string member;
+ bool caseSensitive;
+};
+
void
usage(const char* n)
{
@@ -47,6 +55,13 @@ usage(const char* n)
" using KEY as key, and VALUE as value. This\n"
" option may be specified multiple times for\n"
" different names. NAME may be a scoped name.\n"
+ "--index NAME,TYPE,MEMBER[,{case-sensitive|case-insensitive}]\n"
+ " Create a Freeze evictor index with the name\n"
+ " NAME for member MEMBER of class TYPE. This\n"
+ " option may be specified multiple times for\n"
+ " different names. NAME may be a scoped name.\n"
+ " When member is a string, the case can be\n"
+ " sensitive or insensitive (default is sensitive).\n"
"--output-dir DIR Create files in the directory DIR.\n"
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
@@ -76,7 +91,7 @@ checkIdentifier(string n, string t, string s)
}
void
-printFreezeTypes(Output& out, const vector<Dict>& dicts)
+printFreezeTypes(Output& out, const vector<Dict>& dicts, const vector<Index>& indices)
{
out << '\n';
out << "\n// Freeze types in this file:";
@@ -84,6 +99,16 @@ printFreezeTypes(Output& out, const vector<Dict>& dicts)
{
out << "\n// name=\"" << p->name << "\", key=\"" << p->key << "\", value=\"" << p->value << "\"";
}
+
+ for(vector<Index>::const_iterator q = indices.begin(); q != indices.end(); ++q)
+ {
+ out << "\n// name=\"" << q->name << "\", type=\"" << q->type
+ << "\", member=\"" << q->member << "\"";
+ if(q->caseSensitive == false)
+ {
+ out << " (case insensitive)";
+ }
+ }
out << '\n';
}
@@ -223,6 +248,225 @@ writeCodecs(const string& n, UnitPtr& u, const Dict& dict, Output& H, Output& C,
return true;
}
+
+void
+writeIndexH(const string& memberTypeString, const string& name, Output& H, const string& dllExport)
+{
+ H << sp << nl << dllExport << "class " << name
+ << " : public Freeze::Index";
+ H << sb;
+ H.dec();
+ H << sp << nl << "public:";
+ H << sp;
+ H.inc();
+
+ H << nl << name << "(const std::string&);";
+ H << sp << nl << "std::vector<Ice::Identity>";
+ H << nl << "findFirst(" << memberTypeString << ", Ice::Int) const;";
+
+ H << sp << nl << "std::vector<Ice::Identity>";
+ H << nl << "find(" << memberTypeString << ") const;";
+
+ H << sp << nl << "Ice::Int";
+ H << nl << "count(" << memberTypeString << ") const;";
+ H.dec();
+ H << sp << nl << "private:";
+ H << sp;
+ H.inc();
+
+ H << nl << "virtual bool";
+ H << nl << "marshalKey(const Ice::ObjectPtr&, Freeze::Key&) const;";
+
+ H << sp << nl << "void";
+ H << nl << "marshalKey(" << memberTypeString << ", Freeze::Key&) const;";
+
+ H << eb << ';';
+ H << sp;
+ H << nl << "typedef IceUtil::Handle<" << name << "> " << name << "Ptr;";
+}
+
+
+void
+writeIndexC(const TypePtr& type, const TypePtr& memberType, const string& memberName,
+ bool caseSensitive, const string& fullName, const string& name, Output& C)
+{
+ string inputType = inputTypeToString(memberType);
+
+ C << sp << nl << fullName << "::" << name << "(const ::std::string& __name)";
+ C.inc();
+ C << nl << ": Freeze::Index(__name)";
+ C.dec();
+ C << sb;
+ C << eb;
+
+ C << sp << nl << "std::vector<Ice::Identity>";
+ C << nl << fullName << "::" << "findFirst(" << inputType << " __index, ::Ice::Int __firstN) const";
+ C << sb;
+ C << nl << "Freeze::Key __bytes;";
+ C << nl << "marshalKey(__index, __bytes);";
+ C << nl << "return untypedFindFirst(__bytes, __firstN);";
+ C << eb;
+
+ C << sp << nl << "std::vector<Ice::Identity>";
+ C << nl << fullName << "::" << "find(" << inputType << " __index) const";
+ C << sb;
+ C << nl << "Freeze::Key __bytes;";
+ C << nl << "marshalKey(__index, __bytes);";
+ C << nl << "return untypedFind(__bytes);";
+ C << eb;
+
+ C << sp << nl << "Ice::Int";
+ C << nl << fullName << "::" << "count(" << inputType << " __index) const";
+ C << sb;
+ C << nl << "Freeze::Key __bytes;";
+ C << nl << "marshalKey(__index, __bytes);";
+ C << nl << "return untypedCount(__bytes);";
+ C << eb;
+
+ string typeString = typeToString(type);
+
+ C << sp << nl << "bool";
+ C << nl << fullName << "::" << "marshalKey(const Ice::ObjectPtr& __servant, Freeze::Key& __bytes) const";
+ C << sb;
+ C << nl << typeString << " __s = " << typeString << "::dynamicCast(__servant);";
+ C << nl << "if(__s != 0)";
+ C << sb;
+ C << nl << "marshalKey(__s->" << memberName << ", __bytes);";
+ C << nl << "return true;";
+ C << eb;
+ C << nl << "else";
+ C << sb;
+ C << nl << "return false;";
+ C << eb;
+ C << eb;
+
+ C << sp << nl << "void";
+ C << nl << fullName << "::" << "marshalKey(" << inputType << " __index, Freeze::Key& __bytes) const";
+ C << sb;
+ C << nl << "IceInternal::InstancePtr __instance = IceInternal::getInstance(_communicator);";
+ C << nl << "IceInternal::BasicStream __stream(__instance.get());";
+
+ string valueS;
+ if(caseSensitive)
+ {
+ valueS = "__index";
+ }
+ else
+ {
+ C << nl << typeToString(memberType) << " __lowerCaseIndex = __index;";
+ C << nl << "std::transform(__lowerCaseIndex.begin(), __lowerCaseIndex.end(), __lowerCaseIndex.begin(), tolower);";
+ valueS = "__lowerCaseIndex";
+ }
+
+ writeMarshalUnmarshalCode(C, memberType, valueS, true, "__stream", false);
+ if(memberType->usesClasses())
+ {
+ C << nl << "__stream.writePendingObjects();";
+ }
+ C << nl << "__bytes.swap(__stream.b);";
+ C << eb;
+}
+
+bool
+writeIndex(const string& n, UnitPtr& u, const Index& index, Output& H, Output& C, const string& dllExport)
+{
+ string absolute = index.name;
+ if(absolute.find("::") == 0)
+ {
+ absolute.erase(0, 2);
+ }
+ string name = absolute;
+ vector<string> scope;
+ string::size_type pos;
+ while((pos = name.find("::")) != string::npos)
+ {
+ string s = name.substr(0, pos);
+ name.erase(0, pos + 2);
+
+ if(!checkIdentifier(n, absolute, s))
+ {
+ return false;
+ }
+
+ scope.push_back(s);
+ }
+
+ if(!checkIdentifier(n, absolute, name))
+ {
+ return false;
+ }
+
+ TypeList types = u->lookupType(index.type, false);
+ if(types.empty())
+ {
+ cerr << n << ": `" << index.type << "' is not a valid type" << endl;
+ return false;
+ }
+ TypePtr type = types.front();
+
+ ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type);
+ if(classDecl == 0)
+ {
+ cerr << n << ": `" << index.type << "' is not a class" << endl;
+ return false;
+ }
+
+ DataMemberList dataMembers = classDecl->definition()->allDataMembers();
+ DataMemberPtr dataMember = 0;
+ DataMemberList::const_iterator p = dataMembers.begin();
+ while(p != dataMembers.end() && dataMember == 0)
+ {
+ if((*p)->name() == index.member)
+ {
+ dataMember = *p;
+ }
+ else
+ {
+ ++p;
+ }
+ }
+
+ if(dataMember == 0)
+ {
+ cerr << n << ": `" << index.type << "' has no data member named `" << index.member << "'" << endl;
+ return false;
+ }
+
+ if(index.caseSensitive == false)
+ {
+ //
+ // Let's check member is a string
+ //
+ BuiltinPtr memberType = BuiltinPtr::dynamicCast(dataMember->type());
+ if(memberType == 0 || memberType->kind() != Builtin::KindString)
+ {
+ cerr << n << ": `" << index.member << "'is not a string " << endl;
+ return false;
+ }
+ }
+
+ vector<string>::const_iterator q;
+
+ for(q = scope.begin(); q != scope.end(); ++q)
+ {
+ H << sp;
+ H << nl << "namespace " << *q << nl << '{';
+ }
+
+ writeIndexH(inputTypeToString(dataMember->type()), name, H, dllExport);
+
+ for(q = scope.begin(); q != scope.end(); ++q)
+ {
+ H << sp;
+ H << nl << '}';
+ }
+
+ writeIndexC(type, dataMember->type(), index.member, index.caseSensitive, absolute, name, C);
+ return true;
+}
+
+
+
int
main(int argc, char* argv[])
{
@@ -237,7 +481,8 @@ main(int argc, char* argv[])
bool ice = false;
bool caseSensitive = false;
vector<Dict> dicts;
-
+ vector<Index> indices;
+
int idx = 1;
while(idx < argc)
{
@@ -327,6 +572,85 @@ main(int argc, char* argv[])
}
argc -= 2;
}
+ else if(strcmp(argv[idx], "--index") == 0)
+ {
+ if(idx + 1 >= argc || argv[idx + 1][0] == '-')
+ {
+ cerr << argv[0] << ": argument expected for `" << argv[idx] << "'" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ string s = argv[idx + 1];
+ s.erase(remove_if(s.begin(), s.end(), ::isspace), s.end());
+
+ Index index;
+
+ string::size_type pos;
+ pos = s.find(',');
+ if(pos != string::npos)
+ {
+ index.name = s.substr(0, pos);
+ s.erase(0, pos + 1);
+ }
+ pos = s.find(',');
+ if(pos != string::npos)
+ {
+ index.type = s.substr(0, pos);
+ s.erase(0, pos + 1);
+ }
+ pos = s.find(',');
+ string caseString;
+ if(pos != string::npos)
+ {
+ index.member = s.substr(0, pos);
+ s.erase(0, pos + 1);
+ caseString = s;
+ }
+ else
+ {
+ index.member = s;
+ caseString = "case-sensitive";
+ }
+
+ if(index.name.empty())
+ {
+ cerr << argv[0] << ": " << argv[idx] << ": no name specified" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ if(index.type.empty())
+ {
+ cerr << argv[0] << ": " << argv[idx] << ": no type specified" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ if(index.member.empty())
+ {
+ cerr << argv[0] << ": " << argv[idx] << ": no member specified" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ if(caseString != "case-sensitive" && caseString != "case-insensitive")
+ {
+ cerr << argv[0] << ": " << argv[idx]
+ << ": the case can be `case-sensitive' or `case-insensitive'" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+ index.caseSensitive = (caseString == "case-sensitive");
+
+ indices.push_back(index);
+
+ for(int i = idx ; i + 2 < argc ; ++i)
+ {
+ argv[i] = argv[i + 2];
+ }
+ argc -= 2;
+ }
else if(strcmp(argv[idx], "-h") == 0 || strcmp(argv[idx], "--help") == 0)
{
usage(argv[0]);
@@ -456,7 +780,7 @@ main(int argc, char* argv[])
}
}
- if(dicts.empty())
+ if(dicts.empty() && indices.empty())
{
cerr << argv[0] << ": no Freeze types specified" << endl;
usage(argv[0]);
@@ -533,7 +857,7 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
printHeader(H);
- printFreezeTypes(H, dicts);
+ printFreezeTypes(H, dicts, indices);
Output C;
C.open(fileC.c_str());
@@ -544,14 +868,24 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
printHeader(C);
- printFreezeTypes(C, dicts);
+ printFreezeTypes(C, dicts, indices);
string s = fileH;
transform(s.begin(), s.end(), s.begin(), ToIfdef());
H << "\n#ifndef __" << s << "__";
H << "\n#define __" << s << "__";
H << '\n';
- H << "\n#include <Freeze/Map.h>";
+
+ if(dicts.size() > 0)
+ {
+ H << "\n#include <Freeze/Map.h>";
+ }
+
+ if(indices.size() > 0)
+ {
+ H << "\n#include <Freeze/Index.h>";
+ }
+
{
for(StringList::const_iterator p = includes.begin(); p != includes.end(); ++p)
@@ -594,6 +928,25 @@ main(int argc, char* argv[])
u->destroy();
return EXIT_FAILURE;
}
+ }
+
+
+ for(vector<Index>::const_iterator q = indices.begin(); q != indices.end(); ++q)
+ {
+ try
+ {
+ if(!writeIndex(argv[0], u, *q, H, C, dllExport))
+ {
+ u->destroy();
+ return EXIT_FAILURE;
+ }
+ }
+ catch(...)
+ {
+ cerr << argv[0] << ": unknown exception" << endl;
+ u->destroy();
+ return EXIT_FAILURE;
+ }
}
}
diff --git a/cpp/test/Ice/gc/.depend b/cpp/test/Ice/gc/.depend
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/cpp/test/Ice/gc/.depend