summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/backup/Client.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-09-09 07:05:32 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-09-09 07:05:32 +0000
commitd9e37798719846dd6ea7f25fcc4eb053db2c2efe (patch)
tree04dc91fdacae69db9adb3ba8c8d0872a7243662d /cpp/demo/Freeze/backup/Client.cpp
parentFirst saving support (diff)
downloadice-d9e37798719846dd6ea7f25fcc4eb053db2c2efe.tar.bz2
ice-d9e37798719846dd6ea7f25fcc4eb053db2c2efe.tar.xz
ice-d9e37798719846dd6ea7f25fcc4eb053db2c2efe.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'cpp/demo/Freeze/backup/Client.cpp')
-rw-r--r--cpp/demo/Freeze/backup/Client.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/cpp/demo/Freeze/backup/Client.cpp b/cpp/demo/Freeze/backup/Client.cpp
index 231d772044d..1ad35f9eea1 100644
--- a/cpp/demo/Freeze/backup/Client.cpp
+++ b/cpp/demo/Freeze/backup/Client.cpp
@@ -11,17 +11,13 @@
#include <IceUtil/Time.h>
#include <Freeze/Freeze.h>
-using namespace Freeze;
-using namespace Ice;
-using namespace IceUtil;
using namespace std;
-
static void
testFailed(const char* expr, const char* file, unsigned int line)
{
- std::cout << "failed!" << std::endl;
- std::cout << file << ':' << line << ": assertion `" << expr << "' failed" << std::endl;
+ cout << "failed!" << endl;
+ cout << file << ':' << line << ": assertion `" << expr << "' failed" << endl;
abort();
}
@@ -30,12 +26,12 @@ testFailed(const char* expr, const char* file, unsigned int line)
int
main(int argc, char* argv[])
{
- PropertiesPtr properties = Ice::createProperties();
+ Ice::PropertiesPtr properties = Ice::createProperties();
properties->load("config");
- CommunicatorPtr communicator = initializeWithProperties(argc, argv, properties);
+ Ice::CommunicatorPtr communicator = Ice::initializeWithProperties(argc, argv, properties);
- Freeze::ConnectionPtr connection = createConnection(communicator, "backup");
+ Freeze::ConnectionPtr connection = Freeze::createConnection(communicator, "backup");
IntLongMap m(connection, "IntLongMap", true);
const int size = 10000;
@@ -43,10 +39,10 @@ main(int argc, char* argv[])
if(m.size() == 0)
{
cout << "********* Creating new map ***********" << endl;
- TransactionHolder txHolder(connection);
+ Freeze::TransactionHolder txHolder(connection);
- Time time = Time::now();
- Int64 ms = time.toMilliSeconds();
+ IceUtil::Time time = IceUtil::Time::now();
+ IceUtil::Int64 ms = time.toMilliSeconds();
for(int i = 0; i < size; ++i)
{
@@ -61,12 +57,12 @@ main(int argc, char* argv[])
{
int count = 0;
- TransactionHolder txHolder(connection);
- Time time = Time::now();
- Int64 ms = time.toMilliSeconds();
+ Freeze::TransactionHolder txHolder(connection);
+ IceUtil::Time time = IceUtil::Time::now();
+ IceUtil::Int64 ms = time.toMilliSeconds();
IntLongMap::iterator p = m.begin();
- Int64 oldMs = p->second;
+ IceUtil::Int64 oldMs = p->second;
do
{
if(p->second != oldMs)
@@ -80,7 +76,7 @@ main(int argc, char* argv[])
count++;
} while(++p != m.end());
- cout << "Read " << Time::milliSeconds(oldMs).toString() << " in all records;"
+ cout << "Read " << IceUtil::Time::milliSeconds(oldMs).toString() << " in all records;"
<< " updating with " << time.toString() << " ... " << flush;
txHolder.commit();
@@ -89,6 +85,7 @@ main(int argc, char* argv[])
}
connection->close();
+
communicator->destroy();
return EXIT_SUCCESS;