summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/customEvictor/Client.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2008-01-09 18:09:32 -0500
committerBernard Normier <bernard@zeroc.com>2008-01-09 18:09:32 -0500
commit27ed1dbf26ed4d3fe715bbbdf1ed635cda385a60 (patch)
treebf9c5d505bea08035b592d39eaff1b665c223e08 /cpp/demo/Freeze/customEvictor/Client.cpp
parentMerge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff)
downloadice-27ed1dbf26ed4d3fe715bbbdf1ed635cda385a60.tar.bz2
ice-27ed1dbf26ed4d3fe715bbbdf1ed635cda385a60.tar.xz
ice-27ed1dbf26ed4d3fe715bbbdf1ed635cda385a60.zip
Removed IceUtilInternal calls from demos
Diffstat (limited to 'cpp/demo/Freeze/customEvictor/Client.cpp')
-rw-r--r--cpp/demo/Freeze/customEvictor/Client.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/cpp/demo/Freeze/customEvictor/Client.cpp b/cpp/demo/Freeze/customEvictor/Client.cpp
index 53a4523cbd2..7cdb7d2fdb7 100644
--- a/cpp/demo/Freeze/customEvictor/Client.cpp
+++ b/cpp/demo/Freeze/customEvictor/Client.cpp
@@ -8,9 +8,9 @@
// **********************************************************************
#include <IceUtil/IceUtil.h>
-#include <IceUtil/Random.h>
#include <Ice/Ice.h>
#include <Item.h>
+#include <stdlib.h>
using namespace std;
using namespace Warehouse;
@@ -55,7 +55,7 @@ public:
{
for(int i = 0; i < readCount; ++i)
{
- int id = IceUtilInternal::random(objectCount);
+ int id = rand() % objectCount;
ostringstream os;
os << "P/N " << id;
string name = os.str();
@@ -107,8 +107,8 @@ public:
{
for(int i = 0; i < writeCount; ++i)
{
- int id = IceUtilInternal::random(objectCount);
-
+ int id = rand() % objectCount;
+
ostringstream os;
os << "P/N " << id;
string name = os.str();
@@ -150,6 +150,12 @@ WarehouseClient::run(int argc, char* argv[])
}
//
+ // Initialize pseudo-random number generator; here, for fair comparisons,
+ // it's useful to get the same sequence for each run.
+ //
+ srand(1);
+
+ //
// Retrieve a proxy to one item (any item will do).
//
ItemPrx anItem = ItemPrx::checkedCast(communicator()->propertyToProxy("Item.Proxy"));