summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-09-16 20:11:25 +0000
committerMarc Laukien <marc@zeroc.com>2001-09-16 20:11:25 +0000
commitc4fc439d096dc506c503b5cecb2e9a3cf86f6276 (patch)
tree53e755a2c697eebc0163668a7390fd615cc2b968 /cpp
parentfixes for windows (diff)
downloadice-c4fc439d096dc506c503b5cecb2e9a3cf86f6276.tar.bz2
ice-c4fc439d096dc506c503b5cecb2e9a3cf86f6276.tar.xz
ice-c4fc439d096dc506c503b5cecb2e9a3cf86f6276.zip
fixes
Diffstat (limited to 'cpp')
-rw-r--r--cpp/config/Make.rules5
-rw-r--r--cpp/demo/Freeze/phonebook/Client.cpp2
-rw-r--r--cpp/demo/Freeze/phonebook/Makefile13
-rw-r--r--cpp/demo/Freeze/phonebook/Server.cpp2
-rw-r--r--cpp/demo/Freeze/phonebook/config1
-rw-r--r--cpp/demo/Ice/hello/Client.cpp2
-rw-r--r--cpp/demo/Ice/hello/Server.cpp2
-rw-r--r--cpp/demo/Ice/latency/Client.cpp2
-rw-r--r--cpp/demo/Ice/latency/Server.cpp2
-rw-r--r--cpp/demo/Ice/pickle/Reader.cpp2
-rw-r--r--cpp/demo/Ice/pickle/Writer.cpp2
-rw-r--r--cpp/demo/Ice/value/Client.cpp2
-rw-r--r--cpp/demo/Ice/value/Server.cpp2
-rw-r--r--cpp/slice/Freeze/DB.ice43
-rw-r--r--cpp/src/Freeze/DBI.cpp61
-rw-r--r--cpp/src/Freeze/DBI.h2
-rw-r--r--cpp/src/Freeze/Makefile3
-rw-r--r--cpp/src/IcePack/Client.cpp2
-rw-r--r--cpp/src/IcePack/Server.cpp2
-rw-r--r--cpp/test/Ice/exceptions/AllTests.cpp2
-rw-r--r--cpp/test/Ice/exceptions/Client.cpp4
-rw-r--r--cpp/test/Ice/exceptions/Collocated.cpp4
-rw-r--r--cpp/test/Ice/exceptions/Server.cpp2
-rw-r--r--cpp/test/Ice/faultTolerance/AllTests.cpp2
-rw-r--r--cpp/test/Ice/faultTolerance/Client.cpp4
-rw-r--r--cpp/test/Ice/faultTolerance/Server.cpp2
-rw-r--r--cpp/test/Ice/inheritance/AllTests.cpp2
-rw-r--r--cpp/test/Ice/inheritance/Client.cpp4
-rw-r--r--cpp/test/Ice/inheritance/Collocated.cpp4
-rw-r--r--cpp/test/Ice/inheritance/Server.cpp2
-rw-r--r--cpp/test/Ice/locationForward/AllTests.cpp2
-rw-r--r--cpp/test/Ice/locationForward/Client.cpp4
-rw-r--r--cpp/test/Ice/locationForward/Server.cpp2
-rw-r--r--cpp/test/Ice/operations/AllTests.cpp6
-rw-r--r--cpp/test/Ice/operations/Client.cpp4
-rw-r--r--cpp/test/Ice/operations/Collocated.cpp4
-rw-r--r--cpp/test/Ice/operations/Exceptions.cpp2
-rw-r--r--cpp/test/Ice/operations/Server.cpp2
-rw-r--r--cpp/test/Ice/operations/Twoways.cpp2
-rw-r--r--cpp/test/IcePack/simple/AllTests.cpp2
-rw-r--r--cpp/test/IcePack/simple/Client.cpp4
-rw-r--r--cpp/test/IcePack/simple/Collocated.cpp4
-rw-r--r--cpp/test/IcePack/simple/Server.cpp2
43 files changed, 134 insertions, 90 deletions
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules
index 53ace9f5a08..d8129ef22c7 100644
--- a/cpp/config/Make.rules
+++ b/cpp/config/Make.rules
@@ -19,14 +19,17 @@ includedir = $(top_srcdir)/include
slicedir = $(top_srcdir)/slice
#
+# The locations of STLport, JThreads/C++, and Berkeley DB.
+#
# The values below can be overwritten by defining them as environment
# variables. For example, if you are using a bourne shell or
# compatible, you can overwrite the location of STLPORT like this:
#
# export STLPORT=/usr/local/STLport-4.0
#
-STLPORT ?= /opt/STLport-4.0
+STLPORT ?= /opt/STLport
JTC ?= /opt/JTC
+DB ?= /opt/db
#
# Experts only: You can change the following lines, for example, to
diff --git a/cpp/demo/Freeze/phonebook/Client.cpp b/cpp/demo/Freeze/phonebook/Client.cpp
index 2f9d2630fa2..1e9768337fd 100644
--- a/cpp/demo/Freeze/phonebook/Client.cpp
+++ b/cpp/demo/Freeze/phonebook/Client.cpp
@@ -27,7 +27,7 @@ usage(const char* n)
}
int
-run(int argc, char* argv[], CommunicatorPtr communicator)
+run(int argc, char* argv[], const CommunicatorPtr& communicator)
{
string commands;
bool debug = false;
diff --git a/cpp/demo/Freeze/phonebook/Makefile b/cpp/demo/Freeze/phonebook/Makefile
index 87fd0288417..f42211ec678 100644
--- a/cpp/demo/Freeze/phonebook/Makefile
+++ b/cpp/demo/Freeze/phonebook/Makefile
@@ -13,7 +13,7 @@ top_srcdir = ../../..
CLIENT = client
SERVER = server
-TARGETS = $(CLIENT) $(SERVER)
+TARGETS = $(CLIENT) $(SERVER) db
OBJS = PhoneBook.o
@@ -32,7 +32,8 @@ SRCS = $(OBJS:.o=.cpp) \
include $(top_srcdir)/config/Make.rules
-CPPFLAGS := -I. $(CPPFLAGS)
+CPPFLAGS := -I. $(CPPFLAGS) -I$(DB)/include
+LDLAGS := $(LDFLAGS) -I$(DB)/lib
$(CLIENT): $(OBJS) $(COBJS)
rm -f $@
@@ -40,7 +41,7 @@ $(CLIENT): $(OBJS) $(COBJS)
$(SERVER): $(OBJS) $(SOBJS)
rm -f $@
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) -lFreeze $(LIBS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) -lFreeze -ldb $(LIBS)
Grammer.cpp Grammer.h: Grammer.y
bison -dvt Grammer.y
@@ -62,4 +63,10 @@ PhoneBook.h PhoneBook.cpp: PhoneBook.ice $(SLICE)
clean::
rm -f PhoneBook.h PhoneBook.cpp
+db:
+ mkdir db;
+
+clean::
+ rm -rf db;
+
include .depend
diff --git a/cpp/demo/Freeze/phonebook/Server.cpp b/cpp/demo/Freeze/phonebook/Server.cpp
index 8cc5572aba1..26dee26d18f 100644
--- a/cpp/demo/Freeze/phonebook/Server.cpp
+++ b/cpp/demo/Freeze/phonebook/Server.cpp
@@ -14,7 +14,7 @@ using namespace Ice;
using namespace std;
int
-run(int argc, char* argv[], CommunicatorPtr communicator)
+run(int argc, char* argv[], const CommunicatorPtr& communicator)
{
ObjectAdapterPtr adapter = communicator->createObjectAdapter("PhoneBookAdapter");
PhoneBookIPtr phoneBook = new PhoneBookI(adapter);
diff --git a/cpp/demo/Freeze/phonebook/config b/cpp/demo/Freeze/phonebook/config
index a3b49a632b3..6398a528228 100644
--- a/cpp/demo/Freeze/phonebook/config
+++ b/cpp/demo/Freeze/phonebook/config
@@ -1,2 +1,3 @@
PhoneBook.PhoneBook=phonebook:tcp -p 10000
Ice.Adapter.PhoneBookAdapter.Endpoints=tcp -p 10000
+Freeze.Directory=db
diff --git a/cpp/demo/Ice/hello/Client.cpp b/cpp/demo/Ice/hello/Client.cpp
index a244a4f9916..ecc5680cd77 100644
--- a/cpp/demo/Ice/hello/Client.cpp
+++ b/cpp/demo/Ice/hello/Client.cpp
@@ -32,7 +32,7 @@ menu()
}
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
Ice::PropertiesPtr properties = communicator->getProperties();
std::string ref = properties->getProperty("Hello.Hello");
diff --git a/cpp/demo/Ice/hello/Server.cpp b/cpp/demo/Ice/hello/Server.cpp
index 6861ca03656..57111f01a64 100644
--- a/cpp/demo/Ice/hello/Server.cpp
+++ b/cpp/demo/Ice/hello/Server.cpp
@@ -14,7 +14,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("HelloAdapter");
Ice::ObjectPtr object = new HelloI(communicator);
diff --git a/cpp/demo/Ice/latency/Client.cpp b/cpp/demo/Ice/latency/Client.cpp
index b08993da888..78d6734d948 100644
--- a/cpp/demo/Ice/latency/Client.cpp
+++ b/cpp/demo/Ice/latency/Client.cpp
@@ -19,7 +19,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
Ice::PropertiesPtr properties = communicator->getProperties();
std::string ref = properties->getProperty("Latency.Ping");
diff --git a/cpp/demo/Ice/latency/Server.cpp b/cpp/demo/Ice/latency/Server.cpp
index 7c998f00648..1e300b0a440 100644
--- a/cpp/demo/Ice/latency/Server.cpp
+++ b/cpp/demo/Ice/latency/Server.cpp
@@ -14,7 +14,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("LatencyAdapter");
Ice::ObjectPtr object = new PingI;
diff --git a/cpp/demo/Ice/pickle/Reader.cpp b/cpp/demo/Ice/pickle/Reader.cpp
index 9f1b3a08ff7..71f7eced286 100644
--- a/cpp/demo/Ice/pickle/Reader.cpp
+++ b/cpp/demo/Ice/pickle/Reader.cpp
@@ -16,7 +16,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
Ice::ValueFactoryPtr factory = new Factory;
communicator->installValueFactory(factory, "::Persistent");
diff --git a/cpp/demo/Ice/pickle/Writer.cpp b/cpp/demo/Ice/pickle/Writer.cpp
index 9319db1a184..3f1ba3118f1 100644
--- a/cpp/demo/Ice/pickle/Writer.cpp
+++ b/cpp/demo/Ice/pickle/Writer.cpp
@@ -15,7 +15,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
PersistentPtr persistent = new Persistent;
persistent->aString = "this is the persistent string";
diff --git a/cpp/demo/Ice/value/Client.cpp b/cpp/demo/Ice/value/Client.cpp
index 4a55e10a7ef..5c3dc9e8f6d 100644
--- a/cpp/demo/Ice/value/Client.cpp
+++ b/cpp/demo/Ice/value/Client.cpp
@@ -15,7 +15,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
Ice::PropertiesPtr properties = communicator->getProperties();
string ref = properties->getProperty("Value.Initial");
diff --git a/cpp/demo/Ice/value/Server.cpp b/cpp/demo/Ice/value/Server.cpp
index 0eb18ccc795..d11e51cb1aa 100644
--- a/cpp/demo/Ice/value/Server.cpp
+++ b/cpp/demo/Ice/value/Server.cpp
@@ -14,7 +14,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ValueAdapter");
Ice::ObjectPtr object = new InitialI(adapter);
diff --git a/cpp/slice/Freeze/DB.ice b/cpp/slice/Freeze/DB.ice
index b89ee81a3b7..832c8e6884c 100644
--- a/cpp/slice/Freeze/DB.ice
+++ b/cpp/slice/Freeze/DB.ice
@@ -24,31 +24,12 @@ local class DBFactory;
/**
*
- * The base class for all Freeze exceptions.
+ * A database exception.
*
**/
-local class Exception
-{
- /**
- *
- * Get a message describing the failure that caused the exception.
- *
- * @return The message describing the exception.
- *
- **/
- string message();
-};
-
-/**
- *
- * This exception is raised by <literal>DB</literal>
- * operations.
- *
- * @see DB
- *
- **/
-local class DBException extends Exception
+struct DBException
{
+ string message;
};
/**
@@ -87,21 +68,9 @@ local class DB
/**
*
- * This exception is raised by <literal>DBFactory</literal>
- * operations.
- *
- * @see DBFactory
- *
- **/
-local class DBFactoryException extends Exception
-{
-};
-
-/**
- *
* A factory for database objects.
*
- * @see DBFactoryException
+ * @see DBException
* @see DB
*
**/
@@ -116,14 +85,14 @@ local class DBFactory
* @see DB
*
**/
- DB createDB() throws DBFactoryException;
+ DB createDB() throws DBException;
/**
*
* Destroy this factory and all database objects that have been created by this factory.
*
**/
- void destroy() throws DBFactoryException, DBException;
+ void destroy() throws DBException;
};
};
diff --git a/cpp/src/Freeze/DBI.cpp b/cpp/src/Freeze/DBI.cpp
index 1874803d7fd..6dda091275a 100644
--- a/cpp/src/Freeze/DBI.cpp
+++ b/cpp/src/Freeze/DBI.cpp
@@ -13,6 +13,7 @@
#include <Ice/Logger.h>
#include <Ice/LocalException.h>
#include <Freeze/DBI.h>
+#include <sys/stat.h>
using namespace std;
using namespace Ice;
@@ -49,6 +50,65 @@ Freeze::DBFactoryI::DBFactoryI(const CommunicatorPtr& communicator, const Proper
_properties(properties),
_destroy(false)
{
+ string directory = _properties->getProperty("Freeze.Directory");
+
+//
+// TODO: Should we really try to create the directory? Perhaps we
+// better leave this task to the administrator, and simply let DB fail
+// in case the directory does not exist.
+//
+/*
+ if(!directory.empty())
+ {
+ //
+ // Check whether the directory exists. If yes, we don't need
+ // to create it. Note that we don't further check the type of
+ // the file, DB will fail appropriately if it's the wrong
+ // time.
+ //
+ struct stat sb;
+ if (stat(directory.c_str(), &sb) == 0)
+ {
+ //
+ // Directory does not exist, create it.
+ //
+ if (mkdir(directory.c_str(), S_IRWXU) != 0)
+ {
+ throw SystemException(__FILE__, __LINE__);
+ }
+ }
+ }
+*/
+
+ int ret;
+
+ if ((ret = db_env_create(&_dbenv, 0)) != 0)
+ {
+ DBException ex;
+ ex.message = db_strerror(ret);
+ throw ex;
+ }
+
+ const char* dir = 0;
+ if (!directory.empty())
+ {
+ dir = directory.c_str();
+ }
+
+ if ((ret = _dbenv->open(_dbenv, dir,
+ DB_CREATE |
+ DB_INIT_LOCK |
+ DB_INIT_LOG |
+ DB_INIT_MPOOL |
+ DB_INIT_TXN |
+ DB_RECOVER |
+ DB_THREAD,
+ S_IRUSR | S_IWUSR)) != 0)
+ {
+ DBException ex;
+ ex.message = db_strerror(ret);
+ throw ex;
+ }
}
Freeze::DBFactoryI::~DBFactoryI()
@@ -70,3 +130,4 @@ Freeze::initializeWithProperties(const CommunicatorPtr& communicator, const Prop
{
return new DBFactoryI(communicator, properties);
}
+
diff --git a/cpp/src/Freeze/DBI.h b/cpp/src/Freeze/DBI.h
index 2c8c7f7ec3e..60f41a95a3d 100644
--- a/cpp/src/Freeze/DBI.h
+++ b/cpp/src/Freeze/DBI.h
@@ -13,6 +13,7 @@
#include <Freeze/Initialize.h>
#include <Freeze/DB.h>
+#include <db.h>
namespace Freeze
{
@@ -36,6 +37,7 @@ private:
::Ice::CommunicatorPtr _communicator;
::Ice::PropertiesPtr _properties;
bool _destroy;
+ DB_ENV* _dbenv;
};
}
diff --git a/cpp/src/Freeze/Makefile b/cpp/src/Freeze/Makefile
index cfec4712aed..a5462526aaf 100644
--- a/cpp/src/Freeze/Makefile
+++ b/cpp/src/Freeze/Makefile
@@ -29,7 +29,8 @@ SLICECMD = $(SLICE) --include-dir Freeze --dll-export FREEZE_API -I$(slicedir)
include $(top_srcdir)/config/Make.rules
-CPPFLAGS := -I.. $(CPPFLAGS)
+CPPFLAGS := -I.. $(CPPFLAGS) -I$(DB)/include
+LDLAGS := $(LDFLAGS) -I$(DB)/lib
$(VERSIONED_NAME): $(OBJS)
rm -f $@
diff --git a/cpp/src/IcePack/Client.cpp b/cpp/src/IcePack/Client.cpp
index 8b2c461a0fe..c4853e153d1 100644
--- a/cpp/src/IcePack/Client.cpp
+++ b/cpp/src/IcePack/Client.cpp
@@ -34,7 +34,7 @@ usage(const char* n)
}
int
-run(int argc, char* argv[], CommunicatorPtr communicator)
+run(int argc, char* argv[], const CommunicatorPtr& communicator)
{
string cpp("cpp");
string commands;
diff --git a/cpp/src/IcePack/Server.cpp b/cpp/src/IcePack/Server.cpp
index e48c8725751..d9e35785e68 100644
--- a/cpp/src/IcePack/Server.cpp
+++ b/cpp/src/IcePack/Server.cpp
@@ -29,7 +29,7 @@ usage(const char* n)
}
int
-run(int argc, char* argv[], CommunicatorPtr communicator)
+run(int argc, char* argv[], const CommunicatorPtr& communicator)
{
bool nowarn = false;
for (int i = 1; i < argc; ++i)
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp
index c80231c67e9..2a067ee3aec 100644
--- a/cpp/test/Ice/exceptions/AllTests.cpp
+++ b/cpp/test/Ice/exceptions/AllTests.cpp
@@ -15,7 +15,7 @@
using namespace std;
ThrowerPrx
-allTests(Ice::CommunicatorPtr communicator)
+allTests(const Ice::CommunicatorPtr& communicator)
{
cout << "testing stringToProxy... " << flush;
string ref("thrower:tcp -p 12345 -t 2000");
diff --git a/cpp/test/Ice/exceptions/Client.cpp b/cpp/test/Ice/exceptions/Client.cpp
index 033e9929d48..fa06f9a9f3d 100644
--- a/cpp/test/Ice/exceptions/Client.cpp
+++ b/cpp/test/Ice/exceptions/Client.cpp
@@ -15,9 +15,9 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
- ThrowerPrx allTests(Ice::CommunicatorPtr);
+ ThrowerPrx allTests(const Ice::CommunicatorPtr&);
ThrowerPrx thrower = allTests(communicator);
thrower->shutdown();
return EXIT_SUCCESS;
diff --git a/cpp/test/Ice/exceptions/Collocated.cpp b/cpp/test/Ice/exceptions/Collocated.cpp
index c79ef8c989e..63a8fda6ccf 100644
--- a/cpp/test/Ice/exceptions/Collocated.cpp
+++ b/cpp/test/Ice/exceptions/Collocated.cpp
@@ -14,14 +14,14 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
string endpts("tcp -p 12345 -t 2000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts);
Ice::ObjectPtr object = new ThrowerI(adapter);
adapter->add(object, "thrower");
- ThrowerPrx allTests(Ice::CommunicatorPtr);
+ ThrowerPrx allTests(const Ice::CommunicatorPtr&);
allTests(communicator);
return EXIT_SUCCESS;
diff --git a/cpp/test/Ice/exceptions/Server.cpp b/cpp/test/Ice/exceptions/Server.cpp
index 3789d6fa6b2..4e3a05e3328 100644
--- a/cpp/test/Ice/exceptions/Server.cpp
+++ b/cpp/test/Ice/exceptions/Server.cpp
@@ -14,7 +14,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
string endpts("tcp -p 12345 -t 2000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts);
diff --git a/cpp/test/Ice/faultTolerance/AllTests.cpp b/cpp/test/Ice/faultTolerance/AllTests.cpp
index 8acbf478e9d..14135ddfabb 100644
--- a/cpp/test/Ice/faultTolerance/AllTests.cpp
+++ b/cpp/test/Ice/faultTolerance/AllTests.cpp
@@ -16,7 +16,7 @@
using namespace std;
void
-allTests(Ice::CommunicatorPtr communicator, const vector<int>& ports)
+allTests(const Ice::CommunicatorPtr& communicator, const vector<int>& ports)
{
cout << "testing stringToProxy... " << flush;
ostringstream ref;
diff --git a/cpp/test/Ice/faultTolerance/Client.cpp b/cpp/test/Ice/faultTolerance/Client.cpp
index a5c488e9486..fcedc08778c 100644
--- a/cpp/test/Ice/faultTolerance/Client.cpp
+++ b/cpp/test/Ice/faultTolerance/Client.cpp
@@ -21,7 +21,7 @@ usage(const char* n)
}
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
vector<int> ports;
for (int i = 1; i < argc; ++i)
@@ -43,7 +43,7 @@ run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
return EXIT_FAILURE;
}
- void allTests(Ice::CommunicatorPtr, const vector<int>&);
+ void allTests(const Ice::CommunicatorPtr, const vector<int>&&);
allTests(communicator, ports);
return EXIT_SUCCESS;
}
diff --git a/cpp/test/Ice/faultTolerance/Server.cpp b/cpp/test/Ice/faultTolerance/Server.cpp
index 61795f3b5b8..8140ee5f1a6 100644
--- a/cpp/test/Ice/faultTolerance/Server.cpp
+++ b/cpp/test/Ice/faultTolerance/Server.cpp
@@ -21,7 +21,7 @@ usage(const char* n)
}
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
int port = 0;
for (int i = 1; i < argc; ++i)
diff --git a/cpp/test/Ice/inheritance/AllTests.cpp b/cpp/test/Ice/inheritance/AllTests.cpp
index 5b29aa4d83f..b4d6fb14d42 100644
--- a/cpp/test/Ice/inheritance/AllTests.cpp
+++ b/cpp/test/Ice/inheritance/AllTests.cpp
@@ -15,7 +15,7 @@
using namespace std;
InitialPrx
-allTests(Ice::CommunicatorPtr communicator)
+allTests(const Ice::CommunicatorPtr& communicator)
{
cout << "testing stringToProxy... " << flush;
string ref("initial:tcp -p 12345 -t 2000");
diff --git a/cpp/test/Ice/inheritance/Client.cpp b/cpp/test/Ice/inheritance/Client.cpp
index 28aa409f55e..b4bc3978387 100644
--- a/cpp/test/Ice/inheritance/Client.cpp
+++ b/cpp/test/Ice/inheritance/Client.cpp
@@ -15,9 +15,9 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
- InitialPrx allTests(Ice::CommunicatorPtr);
+ InitialPrx allTests(const Ice::CommunicatorPtr&);
InitialPrx initial = allTests(communicator);
initial->shutdown();
return EXIT_SUCCESS;
diff --git a/cpp/test/Ice/inheritance/Collocated.cpp b/cpp/test/Ice/inheritance/Collocated.cpp
index ddac110a51b..63b9d8ffb00 100644
--- a/cpp/test/Ice/inheritance/Collocated.cpp
+++ b/cpp/test/Ice/inheritance/Collocated.cpp
@@ -14,14 +14,14 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
string endpts("tcp -p 12345 -t 2000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts);
Ice::ObjectPtr object = new InitialI(adapter);
adapter->add(object, "initial");
- InitialPrx allTests(Ice::CommunicatorPtr);
+ InitialPrx allTests(const Ice::CommunicatorPtr&);
allTests(communicator);
return EXIT_SUCCESS;
diff --git a/cpp/test/Ice/inheritance/Server.cpp b/cpp/test/Ice/inheritance/Server.cpp
index 9468768ebfd..1d42278c8b1 100644
--- a/cpp/test/Ice/inheritance/Server.cpp
+++ b/cpp/test/Ice/inheritance/Server.cpp
@@ -14,7 +14,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
string endpts("tcp -p 12345 -t 2000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts);
diff --git a/cpp/test/Ice/locationForward/AllTests.cpp b/cpp/test/Ice/locationForward/AllTests.cpp
index c8bb3a865f1..c8dcecce4c0 100644
--- a/cpp/test/Ice/locationForward/AllTests.cpp
+++ b/cpp/test/Ice/locationForward/AllTests.cpp
@@ -16,7 +16,7 @@
using namespace std;
void
-allTests(Ice::CommunicatorPtr communicator, int port, int lastPort)
+allTests(const Ice::CommunicatorPtr& communicator, int port, int lastPort)
{
cout << "testing stringToProxy... " << flush;
ostringstream ref;
diff --git a/cpp/test/Ice/locationForward/Client.cpp b/cpp/test/Ice/locationForward/Client.cpp
index 266789f30a0..15b528933fb 100644
--- a/cpp/test/Ice/locationForward/Client.cpp
+++ b/cpp/test/Ice/locationForward/Client.cpp
@@ -21,7 +21,7 @@ usage(const char* n)
}
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
int port = 0;
int lastPort = 0;
@@ -57,7 +57,7 @@ run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
return EXIT_FAILURE;
}
- void allTests(Ice::CommunicatorPtr, int, int);
+ void allTests(const Ice::CommunicatorPtr, int, int&);
allTests(communicator, port, lastPort);
return EXIT_SUCCESS;
}
diff --git a/cpp/test/Ice/locationForward/Server.cpp b/cpp/test/Ice/locationForward/Server.cpp
index 2157d7c9556..2627d5f023d 100644
--- a/cpp/test/Ice/locationForward/Server.cpp
+++ b/cpp/test/Ice/locationForward/Server.cpp
@@ -21,7 +21,7 @@ usage(const char* n)
}
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
int port = 0;
Ice::ObjectPrx fwd;
diff --git a/cpp/test/Ice/operations/AllTests.cpp b/cpp/test/Ice/operations/AllTests.cpp
index 2b9ca0e1558..c1174c5f926 100644
--- a/cpp/test/Ice/operations/AllTests.cpp
+++ b/cpp/test/Ice/operations/AllTests.cpp
@@ -15,7 +15,7 @@
using namespace std;
Test::MyClassPrx
-allTests(Ice::CommunicatorPtr communicator)
+allTests(const Ice::CommunicatorPtr& communicator)
{
cout << "testing stringToProxy... " << flush;
string ref("test:tcp -p 12345 -t 2000");
@@ -34,14 +34,14 @@ allTests(Ice::CommunicatorPtr communicator)
cout << "ok" << endl;
cout << "testing twoway operations... " << flush;
- void twoways(Test::MyClassPrx);
+ void twoways(const Test::MyClassPrx&);
twoways(cl);
twoways(derived);
derived->opDerived();
cout << "ok" << endl;
cout << "testing exceptions... " << flush;
- void exceptions(Test::MyClassPrx);
+ void exceptions(const Test::MyClassPrx&);
exceptions(cl);
cout << "ok" << endl;
diff --git a/cpp/test/Ice/operations/Client.cpp b/cpp/test/Ice/operations/Client.cpp
index a7ea950191e..26d25217968 100644
--- a/cpp/test/Ice/operations/Client.cpp
+++ b/cpp/test/Ice/operations/Client.cpp
@@ -15,9 +15,9 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
- Test::MyClassPrx allTests(Ice::CommunicatorPtr);
+ Test::MyClassPrx allTests(const Ice::CommunicatorPtr&);
Test::MyClassPrx myClass = allTests(communicator);
cout << "testing server shutdown... " << flush;
diff --git a/cpp/test/Ice/operations/Collocated.cpp b/cpp/test/Ice/operations/Collocated.cpp
index aa71e68397b..a266c7bdf0b 100644
--- a/cpp/test/Ice/operations/Collocated.cpp
+++ b/cpp/test/Ice/operations/Collocated.cpp
@@ -14,14 +14,14 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
string endpts("tcp -p 12345 -t 2000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts);
Ice::ObjectPtr object = new MyDerivedClassI(adapter, "test");
adapter->add(object, "test");
- Test::MyClassPrx allTests(Ice::CommunicatorPtr);
+ Test::MyClassPrx allTests(const Ice::CommunicatorPtr&);
allTests(communicator);
return EXIT_SUCCESS;
diff --git a/cpp/test/Ice/operations/Exceptions.cpp b/cpp/test/Ice/operations/Exceptions.cpp
index 3a364d6b72e..8f55a9aceeb 100644
--- a/cpp/test/Ice/operations/Exceptions.cpp
+++ b/cpp/test/Ice/operations/Exceptions.cpp
@@ -15,7 +15,7 @@
using namespace std;
void
-exceptions(Test::MyClassPrx p)
+exceptions(const Test::MyClassPrx& p)
{
p->opEx(0);
diff --git a/cpp/test/Ice/operations/Server.cpp b/cpp/test/Ice/operations/Server.cpp
index 009a01008e6..1a99bc502fb 100644
--- a/cpp/test/Ice/operations/Server.cpp
+++ b/cpp/test/Ice/operations/Server.cpp
@@ -14,7 +14,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
string endpts("tcp -p 12345 -t 2000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts);
diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp
index e739bebd9d2..12cb2af9dec 100644
--- a/cpp/test/Ice/operations/Twoways.cpp
+++ b/cpp/test/Ice/operations/Twoways.cpp
@@ -26,7 +26,7 @@
using namespace std;
void
-twoways(Test::MyClassPrx p)
+twoways(const Test::MyClassPrx& p)
{
{
p->opVoid();
diff --git a/cpp/test/IcePack/simple/AllTests.cpp b/cpp/test/IcePack/simple/AllTests.cpp
index b48bc16f91a..56c1605399b 100644
--- a/cpp/test/IcePack/simple/AllTests.cpp
+++ b/cpp/test/IcePack/simple/AllTests.cpp
@@ -16,7 +16,7 @@
using namespace std;
TestPrx
-allTests(Ice::CommunicatorPtr communicator)
+allTests(const Ice::CommunicatorPtr& communicator)
{
cout << "testing stringToProxy... " << flush;
string ref("test:tcp -p 12346 -t 5000");
diff --git a/cpp/test/IcePack/simple/Client.cpp b/cpp/test/IcePack/simple/Client.cpp
index 3ae77a6499d..34292b65f81 100644
--- a/cpp/test/IcePack/simple/Client.cpp
+++ b/cpp/test/IcePack/simple/Client.cpp
@@ -15,9 +15,9 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
- TestPrx allTests(Ice::CommunicatorPtr);
+ TestPrx allTests(const Ice::CommunicatorPtr&);
TestPrx obj = allTests(communicator);
cout << "shutting down server... " << flush;
diff --git a/cpp/test/IcePack/simple/Collocated.cpp b/cpp/test/IcePack/simple/Collocated.cpp
index 5c02cfc2e94..eba91ca4924 100644
--- a/cpp/test/IcePack/simple/Collocated.cpp
+++ b/cpp/test/IcePack/simple/Collocated.cpp
@@ -14,14 +14,14 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
string endpts("tcp -p 12345 -t 5000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts);
Ice::ObjectPtr object = new TestI(adapter);
adapter->add(object, "test");
- TestPrx allTests(Ice::CommunicatorPtr);
+ TestPrx allTests(const Ice::CommunicatorPtr&);
allTests(communicator);
return EXIT_SUCCESS;
}
diff --git a/cpp/test/IcePack/simple/Server.cpp b/cpp/test/IcePack/simple/Server.cpp
index 3ec39518793..d84f763e582 100644
--- a/cpp/test/IcePack/simple/Server.cpp
+++ b/cpp/test/IcePack/simple/Server.cpp
@@ -14,7 +14,7 @@
using namespace std;
int
-run(int argc, char* argv[], Ice::CommunicatorPtr communicator)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
string endpts("tcp -p 12345 -t 5000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts);