summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/phonebook/Collocated.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-09-12 02:46:32 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-09-12 02:46:32 +0000
commit759f7f34281a2c3d406ce93e52e63272a9d4beba (patch)
tree491339afc3ba74316d9d9019318836ffb6621ce8 /cpp/demo/Freeze/phonebook/Collocated.cpp
parentbug fix to the icepack hello demo. (diff)
downloadice-759f7f34281a2c3d406ce93e52e63272a9d4beba.tar.bz2
ice-759f7f34281a2c3d406ce93e52e63272a9d4beba.tar.xz
ice-759f7f34281a2c3d406ce93e52e63272a9d4beba.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'cpp/demo/Freeze/phonebook/Collocated.cpp')
-rw-r--r--cpp/demo/Freeze/phonebook/Collocated.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/cpp/demo/Freeze/phonebook/Collocated.cpp b/cpp/demo/Freeze/phonebook/Collocated.cpp
index 60aed9975cd..8f526cc0044 100644
--- a/cpp/demo/Freeze/phonebook/Collocated.cpp
+++ b/cpp/demo/Freeze/phonebook/Collocated.cpp
@@ -7,15 +7,12 @@
//
// **********************************************************************
-#include <Ice/Application.h>
#include <ContactFactory.h>
#include <NameIndex.h>
#include <PhoneBookI.h>
#include <Parser.h>
using namespace std;
-using namespace Ice;
-using namespace Freeze;
class PhoneBookCollocated : public Ice::Application
{
@@ -29,6 +26,7 @@ public:
virtual int run(int argc, char* argv[]);
private:
+
const string _envName;
};
@@ -42,7 +40,7 @@ main(int argc, char* argv[])
int
PhoneBookCollocated::run(int argc, char* argv[])
{
- PropertiesPtr properties = communicator()->getProperties();
+ Ice::PropertiesPtr properties = communicator()->getProperties();
//
// Create and install a factory for contacts.
@@ -60,20 +58,21 @@ PhoneBookCollocated::run(int argc, char* argv[])
//
// Create an object adapter, use the evictor as servant locator.
//
- ObjectAdapterPtr adapter = communicator()->createObjectAdapter("PhoneBook");
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("PhoneBook");
//
// Create an evictor for contacts.
- // When Freeze.Evictor.db.contacts.PopulateEmptyIndices is not 0 and the
- // Name index is empty, Freeze will traverse the database to recreate
- // the index during createEvictor(). Therefore the factories for the objects
- // stored in evictor (contacts here) must be registered before the call
- // to createEvictor().
+ //
+ // When Freeze.Evictor.db.contacts.PopulateEmptyIndices is not 0
+ // and the Name index is empty, Freeze will traverse the database
+ // to recreate the index during createEvictor(). Therefore the
+ // factories for the objects stored in evictor (contacts here)
+ // must be registered before the call to createEvictor().
//
Freeze::EvictorPtr evictor = Freeze::createEvictor(adapter, _envName, "contacts", 0, indices);
adapter->addServantLocator(evictor, "contact");
- Int evictorSize = properties->getPropertyAsInt("PhoneBook.EvictorSize");
+ Ice::Int evictorSize = properties->getPropertyAsInt("PhoneBook.EvictorSize");
if(evictorSize > 0)
{
evictor->setSize(evictorSize);
@@ -90,12 +89,12 @@ PhoneBookCollocated::run(int argc, char* argv[])
// Create the phonebook, and add it to the Object Adapter.
//
PhoneBookIPtr phoneBook = new PhoneBookI(evictor, contactFactory, index);
- adapter->add(phoneBook, stringToIdentity("phonebook"));
+ adapter->add(phoneBook, Ice::stringToIdentity("phonebook"));
//
// Everything ok, let's go.
//
- int runParser(int, char*[], const CommunicatorPtr&);
+ int runParser(int, char*[], const Ice::CommunicatorPtr&);
int status = runParser(argc, argv, communicator());
adapter->deactivate();
adapter->waitForDeactivate();