summaryrefslogtreecommitdiff
path: root/cppe
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2008-06-03 19:32:20 -0700
committerMark Spruiell <mes@zeroc.com>2008-06-03 19:32:20 -0700
commit3d649bed4328992f41f567136025f58a019a5159 (patch)
tree470be901fbbfe5c6cd4269884412b0d36b48dc92 /cppe
parentlocal interface fixes for slice2javae (diff)
downloadice-3d649bed4328992f41f567136025f58a019a5159.tar.bz2
ice-3d649bed4328992f41f567136025f58a019a5159.tar.xz
ice-3d649bed4328992f41f567136025f58a019a5159.zip
Various Ice-E fixes:
- Bug fix in slice2javae for local interfaces/classes - Added Ice.LocalObjectHolder - Reviewed Java/C++ demos and aligned with Ice - Source code clean up (removed tabs, etc.)
Diffstat (limited to 'cppe')
-rw-r--r--cppe/demo/IceE/MFC/client/HelloClient.cpp40
-rw-r--r--cppe/demo/IceE/MFC/client/HelloClientDlg.cpp4
-rw-r--r--cppe/demo/IceE/MFC/client/stdafx.h8
-rw-r--r--cppe/demo/IceE/MFC/server/HelloServer.cpp40
-rw-r--r--cppe/demo/IceE/MFC/server/LogI.cpp4
-rw-r--r--cppe/demo/IceE/MFC/server/stdafx.h8
-rw-r--r--cppe/demo/IceE/bidir/CallbackI.cpp74
-rw-r--r--cppe/demo/IceE/bidir/CallbackI.h19
-rw-r--r--cppe/demo/IceE/bidir/Client.cpp17
-rw-r--r--cppe/demo/IceE/bidir/Server.cpp8
-rw-r--r--cppe/demo/IceE/bidir/config7
-rw-r--r--cppe/demo/IceE/bidir/config.client28
-rw-r--r--cppe/demo/IceE/bidir/config.server29
-rw-r--r--cppe/demo/IceE/callback/CallbackSenderI.cpp8
-rw-r--r--cppe/demo/IceE/callback/Client.cpp111
-rw-r--r--cppe/demo/IceE/callback/Server.cpp5
-rw-r--r--cppe/demo/IceE/callback/config7
-rw-r--r--cppe/demo/IceE/callback/config.client35
-rw-r--r--cppe/demo/IceE/callback/config.server29
-rw-r--r--cppe/demo/IceE/chat/ChatClient.cpp4
-rw-r--r--cppe/demo/IceE/chat/ChatClientDlg.cpp300
-rw-r--r--cppe/demo/IceE/chat/ChatConfigDlg.cpp2
-rw-r--r--cppe/demo/IceE/chat/Client.cpp124
-rw-r--r--cppe/demo/IceE/chat/LogI.cpp4
-rw-r--r--cppe/demo/IceE/chat/README4
-rw-r--r--cppe/demo/IceE/chat/Router.ice4
-rw-r--r--cppe/demo/IceE/chat/Session.ice2
-rw-r--r--cppe/demo/IceE/chat/config28
-rw-r--r--cppe/demo/IceE/chat/stdafx.h8
-rw-r--r--cppe/demo/IceE/hello/Client.cpp220
-rw-r--r--cppe/demo/IceE/hello/Server.cpp34
-rw-r--r--cppe/demo/IceE/hello/config.client (renamed from cppe/demo/IceE/hello/config)13
-rw-r--r--cppe/demo/IceE/hello/config.server (renamed from cppe/demo/IceE/minimal/config)10
-rw-r--r--cppe/demo/IceE/latency/Client.cpp42
-rw-r--r--cppe/demo/IceE/latency/Server.cpp39
-rw-r--r--cppe/demo/IceE/latency/WinCEClient.cpp256
-rw-r--r--cppe/demo/IceE/latency/WinCEServer.cpp187
-rw-r--r--cppe/demo/IceE/latency/config7
-rw-r--r--cppe/demo/IceE/latency/config.client5
-rw-r--r--cppe/demo/IceE/latency/config.server10
-rw-r--r--cppe/demo/IceE/minimal/Client.cpp117
-rw-r--r--cppe/demo/IceE/minimal/Server.cpp60
-rw-r--r--cppe/demo/IceE/minimal/WinCEClient.cpp88
-rw-r--r--cppe/demo/IceE/minimal/WinCEServer.cpp205
-rw-r--r--cppe/demo/IceE/throughput/Client.cpp685
-rw-r--r--cppe/demo/IceE/throughput/Server.cpp42
-rw-r--r--cppe/demo/IceE/throughput/Throughput.ice4
-rw-r--r--cppe/demo/IceE/throughput/ThroughputI.cpp68
-rw-r--r--cppe/demo/IceE/throughput/ThroughputI.h5
-rw-r--r--cppe/demo/IceE/throughput/WinCEClient.cpp410
-rw-r--r--cppe/demo/IceE/throughput/WinCEServer.cpp184
-rw-r--r--cppe/demo/IceE/throughput/config7
-rw-r--r--cppe/demo/IceE/throughput/config.client5
-rw-r--r--cppe/demo/IceE/throughput/config.server11
-rw-r--r--cppe/demo/IceE/workqueue/WorkQueue.cpp90
-rw-r--r--cppe/include/IceE/AbstractMutex.h18
-rw-r--r--cppe/include/IceE/BasicStream.h518
-rw-r--r--cppe/include/IceE/Buffer.h270
-rw-r--r--cppe/include/IceE/Cond.h40
-rw-r--r--cppe/include/IceE/Connection.h28
-rw-r--r--cppe/include/IceE/DisableWarnings.h4
-rw-r--r--cppe/include/IceE/FactoryTable.h2
-rw-r--r--cppe/include/IceE/Functional.h32
-rw-r--r--cppe/include/IceE/Handle.h380
-rw-r--r--cppe/include/IceE/Initialize.h4
-rw-r--r--cppe/include/IceE/Lock.h58
-rw-r--r--cppe/include/IceE/Monitor.h94
-rw-r--r--cppe/include/IceE/Mutex.h42
-rw-r--r--cppe/include/IceE/Object.h8
-rw-r--r--cppe/include/IceE/ObjectAdapter.h6
-rw-r--r--cppe/include/IceE/Outgoing.h10
-rw-r--r--cppe/include/IceE/Proxy.h100
-rw-r--r--cppe/include/IceE/ProxyHandle.h184
-rw-r--r--cppe/include/IceE/RecMutex.h6
-rw-r--r--cppe/include/IceE/ScopedArray.h24
-rw-r--r--cppe/include/IceE/Shared.h112
-rw-r--r--cppe/include/IceE/StaticMutex.h14
-rw-r--r--cppe/include/IceE/StringConverter.h4
-rw-r--r--cppe/include/IceE/Thread.h4
-rw-r--r--cppe/include/IceE/Time.h88
-rw-r--r--cppe/include/IceE/Unicode.h14
-rw-r--r--cppe/slice/IceE/Locator.ice8
-rw-r--r--cppe/src/IceE/BasicStream.cpp606
-rw-r--r--cppe/src/IceE/Buffer.cpp76
-rw-r--r--cppe/src/IceE/Communicator.cpp20
-rw-r--r--cppe/src/IceE/Cond.cpp96
-rw-r--r--cppe/src/IceE/Connection.cpp1888
-rw-r--r--cppe/src/IceE/ConvertUTF.cpp458
-rw-r--r--cppe/src/IceE/ConvertUTF.h34
-rw-r--r--cppe/src/IceE/Current.cpp46
-rw-r--r--cppe/src/IceE/DefaultsAndOverrides.cpp8
-rw-r--r--cppe/src/IceE/ExceptionBase.cpp10
-rw-r--r--cppe/src/IceE/FactoryTableDef.cpp60
-rw-r--r--cppe/src/IceE/Incoming.cpp628
-rw-r--r--cppe/src/IceE/IncomingConnectionFactory.cpp452
-rw-r--r--cppe/src/IceE/IncomingConnectionFactory.h16
-rw-r--r--cppe/src/IceE/Initialize.cpp66
-rw-r--r--cppe/src/IceE/Instance.cpp494
-rw-r--r--cppe/src/IceE/Instance.h6
-rw-r--r--cppe/src/IceE/LocalException.cpp34
-rw-r--r--cppe/src/IceE/LocatorInfo.cpp318
-rw-r--r--cppe/src/IceE/LoggerI.cpp6
-rw-r--r--cppe/src/IceE/LoggerUtil.cpp8
-rw-r--r--cppe/src/IceE/Network.cpp692
-rw-r--r--cppe/src/IceE/Object.cpp60
-rw-r--r--cppe/src/IceE/ObjectAdapter.cpp438
-rw-r--r--cppe/src/IceE/ObjectAdapterFactory.cpp118
-rw-r--r--cppe/src/IceE/ObjectAdapterFactory.h4
-rw-r--r--cppe/src/IceE/Outgoing.cpp500
-rw-r--r--cppe/src/IceE/OutgoingConnectionFactory.cpp588
-rw-r--r--cppe/src/IceE/Properties.cpp50
-rw-r--r--cppe/src/IceE/Protocol.cpp2
-rw-r--r--cppe/src/IceE/Proxy.cpp448
-rw-r--r--cppe/src/IceE/ProxyFactory.cpp108
-rw-r--r--cppe/src/IceE/RecMutex.cpp116
-rw-r--r--cppe/src/IceE/Reference.cpp466
-rw-r--r--cppe/src/IceE/Reference.h36
-rw-r--r--cppe/src/IceE/ReferenceFactory.cpp498
-rw-r--r--cppe/src/IceE/ReferenceFactory.h10
-rw-r--r--cppe/src/IceE/RouterInfo.cpp90
-rw-r--r--cppe/src/IceE/ServantManager.cpp124
-rw-r--r--cppe/src/IceE/StaticMutex.cpp12
-rw-r--r--cppe/src/IceE/StringConverter.cpp66
-rw-r--r--cppe/src/IceE/StringUtil.cpp382
-rw-r--r--cppe/src/IceE/Thread.cpp136
-rw-r--r--cppe/src/IceE/ThreadException.cpp50
-rw-r--r--cppe/src/IceE/TraceUtil.cpp334
-rw-r--r--cppe/src/IceE/Transceiver.h4
-rw-r--r--cppe/src/IceE/UUID.cpp156
-rw-r--r--cppe/src/IceE/Unicode.cpp116
-rw-r--r--cppe/src/IceE/UnknownEndpoint.cpp16
-rw-r--r--cppe/src/TcpTransport/Acceptor.cpp38
-rw-r--r--cppe/src/TcpTransport/Connector.cpp8
-rw-r--r--cppe/src/TcpTransport/EndpointFactory.cpp2
-rw-r--r--cppe/src/TcpTransport/TcpEndpoint.cpp294
-rw-r--r--cppe/src/TcpTransport/Transceiver.cpp730
-rw-r--r--cppe/test/Common/TestCommon.cpp376
-rw-r--r--cppe/test/IceE/adapterDeactivation/AllTests.cpp8
-rw-r--r--cppe/test/IceE/adapterDeactivation/Client.cpp6
-rw-r--r--cppe/test/IceE/adapterDeactivation/Collocated.cpp4
-rw-r--r--cppe/test/IceE/adapterDeactivation/Server.cpp2
-rw-r--r--cppe/test/IceE/adapterDeactivation/TestI.cpp2
-rw-r--r--cppe/test/IceE/custom/AllTests.cpp646
-rw-r--r--cppe/test/IceE/custom/Client.cpp8
-rw-r--r--cppe/test/IceE/custom/Collocated.cpp18
-rw-r--r--cppe/test/IceE/custom/MyByteSeq.cpp6
-rw-r--r--cppe/test/IceE/custom/Server.cpp22
-rw-r--r--cppe/test/IceE/custom/StringConverterI.cpp4
-rw-r--r--cppe/test/IceE/custom/StringConverterI.h4
-rw-r--r--cppe/test/IceE/custom/Test.ice10
-rw-r--r--cppe/test/IceE/custom/TestI.cpp84
-rw-r--r--cppe/test/IceE/custom/TestI.h84
-rw-r--r--cppe/test/IceE/custom/WstringI.cpp20
-rw-r--r--cppe/test/IceE/custom/WstringI.h20
-rw-r--r--cppe/test/IceE/exceptions/AllTests.cpp382
-rw-r--r--cppe/test/IceE/exceptions/Client.cpp2
-rw-r--r--cppe/test/IceE/exceptions/Collocated.cpp6
-rw-r--r--cppe/test/IceE/exceptions/Server.cpp6
-rw-r--r--cppe/test/IceE/exceptions/Test.ice2
-rw-r--r--cppe/test/IceE/exceptions/TestI.cpp12
-rw-r--r--cppe/test/IceE/facets/AllTests.cpp12
-rw-r--r--cppe/test/IceE/facets/Client.cpp2
-rw-r--r--cppe/test/IceE/facets/Collocated.cpp6
-rw-r--r--cppe/test/IceE/facets/Server.cpp8
-rw-r--r--cppe/test/IceE/faultTolerance/AllTests.cpp152
-rw-r--r--cppe/test/IceE/faultTolerance/Client.cpp42
-rw-r--r--cppe/test/IceE/faultTolerance/Server.cpp34
-rw-r--r--cppe/test/IceE/inheritance/AllTests.cpp2
-rw-r--r--cppe/test/IceE/inheritance/Client.cpp2
-rw-r--r--cppe/test/IceE/inheritance/Collocated.cpp4
-rw-r--r--cppe/test/IceE/inheritance/Server.cpp8
-rw-r--r--cppe/test/IceE/inheritance/TestI.h2
-rw-r--r--cppe/test/IceE/location/AllTests.cpp98
-rw-r--r--cppe/test/IceE/location/Client.cpp28
-rw-r--r--cppe/test/IceE/location/Server.cpp52
-rw-r--r--cppe/test/IceE/location/ServerLocator.cpp8
-rw-r--r--cppe/test/IceE/location/ServerLocator.h2
-rw-r--r--cppe/test/IceE/location/TestI.cpp18
-rw-r--r--cppe/test/IceE/location/TestI.h2
-rw-r--r--cppe/test/IceE/operations/AllTests.cpp6
-rw-r--r--cppe/test/IceE/operations/BatchOneways.cpp36
-rw-r--r--cppe/test/IceE/operations/Client.cpp50
-rw-r--r--cppe/test/IceE/operations/Collocated.cpp40
-rw-r--r--cppe/test/IceE/operations/Server.cpp16
-rw-r--r--cppe/test/IceE/operations/Test.ice44
-rw-r--r--cppe/test/IceE/operations/TestI.cpp168
-rw-r--r--cppe/test/IceE/operations/TestI.h152
-rw-r--r--cppe/test/IceE/operations/Twoways.cpp1106
-rw-r--r--cppe/test/IceE/proxy/Client.cpp16
-rw-r--r--cppe/test/IceE/proxy/Collocated.cpp18
-rw-r--r--cppe/test/IceE/proxy/Server.cpp6
-rw-r--r--cppe/test/IceE/retry/AllTests.cpp6
-rw-r--r--cppe/test/IceE/retry/Client.cpp26
-rw-r--r--cppe/test/IceE/retry/Server.cpp14
-rw-r--r--cppe/test/IceE/retry/TestI.cpp2
-rw-r--r--cppe/test/IceE/slicing/AllTests.cpp418
-rw-r--r--cppe/test/IceE/slicing/Client.cpp2
-rw-r--r--cppe/test/IceE/slicing/Server.cpp4
-rw-r--r--cppe/test/IceE/thread/AliveTest.cpp36
-rw-r--r--cppe/test/IceE/thread/Client.cpp28
-rw-r--r--cppe/test/IceE/thread/CreateTest.cpp32
-rw-r--r--cppe/test/IceE/thread/MonitorMutexTest.cpp94
-rw-r--r--cppe/test/IceE/thread/MonitorRecMutexTest.cpp94
-rw-r--r--cppe/test/IceE/thread/MutexTest.cpp170
-rw-r--r--cppe/test/IceE/thread/RecMutexTest.cpp68
-rw-r--r--cppe/test/IceE/thread/StartTest.cpp64
-rw-r--r--cppe/test/IceE/thread/StaticMutexTest.cpp152
-rw-r--r--cppe/test/IceE/thread/TestBase.cpp4
-rw-r--r--cppe/test/IceE/uuid/Client.cpp252
209 files changed, 11676 insertions, 11523 deletions
diff --git a/cppe/demo/IceE/MFC/client/HelloClient.cpp b/cppe/demo/IceE/MFC/client/HelloClient.cpp
index 03f55a05a5d..fbb96b11150 100644
--- a/cppe/demo/IceE/MFC/client/HelloClient.cpp
+++ b/cppe/demo/IceE/MFC/client/HelloClient.cpp
@@ -46,30 +46,30 @@ CHelloClientApp::InitInstance()
try
{
int argc = 0;
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- //
- // Set a default value for Hello.Proxy so that the demo will
- // run without a configuration file.
- //
- initData.properties->setProperty("Hello.Proxy", "hello:tcp -p 10000");
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties();
+ //
+ // Set a default value for Hello.Proxy so that the demo will
+ // run without a configuration file.
+ //
+ initData.properties->setProperty("Hello.Proxy", "hello:tcp -p 10000");
- //
- // Now, load the configuration file if present. Under WinCE we
- // use "config.txt" since it can be edited with pocket word.
- //
+ //
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
+ //
#ifdef _WIN32_WCE
- string config = "config.txt";
+ string config = "config.txt";
#else
- string config = "config";
+ string config = "config";
#endif
- try
- {
- initData.properties->load(config);
- }
- catch(const Ice::FileException&)
- {
- }
+ try
+ {
+ initData.properties->load(config);
+ }
+ catch(const Ice::FileException&)
+ {
+ }
communicator = Ice::initialize(argc, 0, initData);
}
diff --git a/cppe/demo/IceE/MFC/client/HelloClientDlg.cpp b/cppe/demo/IceE/MFC/client/HelloClientDlg.cpp
index 5ccb10cd449..f0fb65c754a 100644
--- a/cppe/demo/IceE/MFC/client/HelloClientDlg.cpp
+++ b/cppe/demo/IceE/MFC/client/HelloClientDlg.cpp
@@ -59,7 +59,6 @@ CHelloClientDlg::OnInitDialog()
//
_mode->SetCurSel(_currentMode);
-
//
// Disable flush button if built without batch support.
//
@@ -67,7 +66,6 @@ CHelloClientDlg::OnInitDialog()
(CButton*)GetDlgItem(IDC_FLUSH)->EnableWindow(FALSE);
#endif
-
//
// Create the proxy.
//
@@ -214,7 +212,7 @@ CHelloClientDlg::updateProxy()
#else
AfxMessageBox(CString("Batch mode is currently not enabled."),
MB_OK|MB_ICONEXCLAMATION);
- return;
+ return;
#endif
default:
assert(false);
diff --git a/cppe/demo/IceE/MFC/client/stdafx.h b/cppe/demo/IceE/MFC/client/stdafx.h
index f3bc1290dc9..a4761e36b74 100644
--- a/cppe/demo/IceE/MFC/client/stdafx.h
+++ b/cppe/demo/IceE/MFC/client/stdafx.h
@@ -49,22 +49,22 @@
#endif // _WIN32_WCE
#ifndef VC_EXTRALEAN
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#if defined(_WIN32_WCE) && (_WIN32_WCE >= 211) && (_AFXDLL)
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
+#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
+#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
-#include <afxsock.h> // MFC socket extensions
+#include <afxsock.h> // MFC socket extensions
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
diff --git a/cppe/demo/IceE/MFC/server/HelloServer.cpp b/cppe/demo/IceE/MFC/server/HelloServer.cpp
index 98194c1e96a..bd5f3391a3c 100644
--- a/cppe/demo/IceE/MFC/server/HelloServer.cpp
+++ b/cppe/demo/IceE/MFC/server/HelloServer.cpp
@@ -50,34 +50,34 @@ BOOL CHelloServerApp::InitInstance()
try
{
int argc = 0;
- Ice::InitializationData initData;
+ Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- //
- // Set a default value for Hello.Endpoints so that the demo
- // will run without a configuration file.
- //
- initData.properties->setProperty("Hello.Endpoints", "tcp -p 10000");
+ //
+ // Set a default value for Hello.Endpoints so that the demo
+ // will run without a configuration file.
+ //
+ initData.properties->setProperty("Hello.Endpoints", "tcp -p 10000");
- //
- // Now, load the configuration file if present. Under WinCE we
- // use "config.txt" since it can be edited with pocket word.
- //
+ //
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
+ //
#ifdef _WIN32_WCE
- string config = "config.txt";
+ string config = "config.txt";
#else
- string config = "config";
+ string config = "config";
#endif
- try
- {
- initData.properties->load(config);
- }
- catch(const Ice::FileException&)
- {
- }
+ try
+ {
+ initData.properties->load(config);
+ }
+ catch(const Ice::FileException&)
+ {
+ }
log = new LogI;
- initData.logger = log;
+ initData.logger = log;
communicator = Ice::initialize(argc, 0, initData);
adapter = communicator->createObjectAdapter("Hello");
diff --git a/cppe/demo/IceE/MFC/server/LogI.cpp b/cppe/demo/IceE/MFC/server/LogI.cpp
index dbed3ad13c9..7577334bb12 100644
--- a/cppe/demo/IceE/MFC/server/LogI.cpp
+++ b/cppe/demo/IceE/MFC/server/LogI.cpp
@@ -65,7 +65,7 @@ LogI::message(const string& msg)
string line = msg + "\r\n";
if(_hwnd)
{
- post(line);
+ post(line);
}
else
{
@@ -79,7 +79,7 @@ LogI::setHandle(HWND hwnd)
_hwnd = hwnd;
if(_hwnd != 0 && !_buffer.empty())
{
- post(_buffer);
+ post(_buffer);
_buffer.clear();
}
}
diff --git a/cppe/demo/IceE/MFC/server/stdafx.h b/cppe/demo/IceE/MFC/server/stdafx.h
index ab60a56baa8..0affd98b539 100644
--- a/cppe/demo/IceE/MFC/server/stdafx.h
+++ b/cppe/demo/IceE/MFC/server/stdafx.h
@@ -50,22 +50,22 @@
#endif // _WIN32_WCE
#ifndef VC_EXTRALEAN
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#if defined(_WIN32_WCE) && (_WIN32_WCE >= 211) && (_AFXDLL)
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
+#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
+#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
-#include <afxsock.h> // MFC socket extensions
+#include <afxsock.h> // MFC socket extensions
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
diff --git a/cppe/demo/IceE/bidir/CallbackI.cpp b/cppe/demo/IceE/bidir/CallbackI.cpp
index defd118bec3..ec486167729 100644
--- a/cppe/demo/IceE/bidir/CallbackI.cpp
+++ b/cppe/demo/IceE/bidir/CallbackI.cpp
@@ -15,7 +15,6 @@ using namespace Demo;
CallbackSenderI::CallbackSenderI(const Ice::CommunicatorPtr& communicator) :
_communicator(communicator),
_destroy(false),
- _num(0),
_callbackSenderThread(new CallbackSenderThread(this))
{
}
@@ -26,15 +25,15 @@ CallbackSenderI::destroy()
IceUtil::ThreadPtr callbackSenderThread;
{
- Lock lock(*this);
-
- printf("destroying callback sender\n");
- _destroy = true;
-
- notify();
+ Lock lock(*this);
+
+ printf("destroying callback sender\n");
+ _destroy = true;
+
+ notify();
- callbackSenderThread = _callbackSenderThread;
- _callbackSenderThread = 0; // Resolve cyclic dependency.
+ callbackSenderThread = _callbackSenderThread;
+ _callbackSenderThread = 0; // Resolve cyclic dependency.
}
callbackSenderThread->getThreadControl().join();
@@ -60,32 +59,39 @@ CallbackSenderI::start()
void
CallbackSenderI::run()
{
- Lock lock(*this);
-
- while(!_destroy)
+ int num = 0;
+ while(true)
{
- timedWait(IceUtil::Time::seconds(2));
+ std::set<Demo::CallbackReceiverPrx> clients;
+ {
+ Lock lock(*this);
+ timedWait(IceUtil::Time::seconds(2));
+
+ if(_destroy)
+ {
+ break;
+ }
+
+ clients = _clients;
+ }
- if(!_destroy && !_clients.empty())
- {
- ++_num;
-
- set<CallbackReceiverPrx>::iterator p = _clients.begin();
- while(p != _clients.end())
- {
- try
- {
- (*p)->callback(_num);
- ++p;
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "removing client `%s':\n%s\n",
- _communicator->identityToString((*p)->ice_getIdentity()).c_str(),
- ex.toString().c_str());
- _clients.erase(p++);
- }
- }
- }
+ if(!clients.empty())
+ {
+ ++num;
+ for(set<CallbackReceiverPrx>::iterator p = clients.begin(); p != clients.end(); ++p)
+ {
+ try
+ {
+ (*p)->callback(num);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "removing client `%s':\n%s\n",
+ _communicator->identityToString((*p)->ice_getIdentity()).c_str(),
+ ex.toString().c_str());
+ _clients.erase(*p);
+ }
+ }
+ }
}
}
diff --git a/cppe/demo/IceE/bidir/CallbackI.h b/cppe/demo/IceE/bidir/CallbackI.h
index 922410f76c1..6fd80632369 100644
--- a/cppe/demo/IceE/bidir/CallbackI.h
+++ b/cppe/demo/IceE/bidir/CallbackI.h
@@ -34,7 +34,6 @@ private:
Ice::CommunicatorPtr _communicator;
bool _destroy;
- Ice::Int _num;
std::set<Demo::CallbackReceiverPrx> _clients;
//
@@ -47,19 +46,19 @@ private:
{
public:
- CallbackSenderThread(const CallbackSenderIPtr& callbackSender) :
- _callbackSender(callbackSender)
- {
- }
+ CallbackSenderThread(const CallbackSenderIPtr& callbackSender) :
+ _callbackSender(callbackSender)
+ {
+ }
- virtual void run()
- {
- _callbackSender->run();
- }
+ virtual void run()
+ {
+ _callbackSender->run();
+ }
private:
- CallbackSenderIPtr _callbackSender;
+ CallbackSenderIPtr _callbackSender;
};
IceUtil::ThreadPtr _callbackSenderThread;
diff --git a/cppe/demo/IceE/bidir/Client.cpp b/cppe/demo/IceE/bidir/Client.cpp
index dc982affc9f..4d5084bca5f 100644
--- a/cppe/demo/IceE/bidir/Client.cpp
+++ b/cppe/demo/IceE/bidir/Client.cpp
@@ -20,7 +20,7 @@ public:
virtual void
callback(Ice::Int num, const Ice::Current&)
{
- printf("received callback #%d\n", num);
+ printf("received callback #%d\n", num);
}
};
@@ -34,26 +34,27 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
Ice::PropertiesPtr properties = communicator->getProperties();
- const char* proxyProperty = "Callback.Client.CallbackServer";
+ const char* proxyProperty = "CallbackSender.Proxy";
string proxy = properties->getProperty(proxyProperty);
if(proxy.empty())
{
- fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
+ return EXIT_FAILURE;
}
CallbackSenderPrx server = CallbackSenderPrx::checkedCast(communicator->stringToProxy(proxy));
if(!server)
{
- fprintf(stderr, "%s: invalid proxy\n", argv[0]);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: invalid proxy\n", argv[0]);
+ return EXIT_FAILURE;
}
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Callback.Client");
Ice::Identity ident;
ident.name = IceUtil::generateUUID();
ident.category = "";
- adapter->add(new CallbackReceiverI, ident);
+ CallbackReceiverPtr cr = new CallbackReceiverI;
+ adapter->add(cr, ident);
adapter->activate();
server->ice_getConnection()->setAdapter(adapter);
server->addClient(ident);
@@ -72,7 +73,7 @@ main(int argc, char* argv[])
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- initData.properties->load("config");
+ initData.properties->load("config.client");
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
diff --git a/cppe/demo/IceE/bidir/Server.cpp b/cppe/demo/IceE/bidir/Server.cpp
index 949fb23d2df..08b07d343de 100644
--- a/cppe/demo/IceE/bidir/Server.cpp
+++ b/cppe/demo/IceE/bidir/Server.cpp
@@ -29,12 +29,12 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
sender->start();
try
{
- communicator->waitForShutdown();
+ communicator->waitForShutdown();
}
catch(...)
{
- sender->destroy();
- throw;
+ sender->destroy();
+ throw;
}
sender->destroy();
@@ -51,7 +51,7 @@ main(int argc, char* argv[])
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- initData.properties->load("config");
+ initData.properties->load("config.server");
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
diff --git a/cppe/demo/IceE/bidir/config b/cppe/demo/IceE/bidir/config
deleted file mode 100644
index d194f5d3765..00000000000
--- a/cppe/demo/IceE/bidir/config
+++ /dev/null
@@ -1,7 +0,0 @@
-Callback.Client.CallbackServer=sender:tcp -p 10000
-Callback.Client.Endpoints=
-Callback.Server.Endpoints=tcp -p 10000
-
-#Ice.Trace.Network=1
-#Ice.Trace.Protocol=1
-Ice.Warn.Connections=1
diff --git a/cppe/demo/IceE/bidir/config.client b/cppe/demo/IceE/bidir/config.client
new file mode 100644
index 00000000000..fa7a6ae7fb4
--- /dev/null
+++ b/cppe/demo/IceE/bidir/config.client
@@ -0,0 +1,28 @@
+#
+# The client reads this property to create the reference to the
+# "CallbackSender" object in the server.
+#
+CallbackSender.Proxy=sender:tcp -p 10000
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
+
+#
+# Network Tracing
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
+#Ice.Trace.Network=1
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
+#Ice.Trace.Protocol=1
diff --git a/cppe/demo/IceE/bidir/config.server b/cppe/demo/IceE/bidir/config.server
new file mode 100644
index 00000000000..e7e23e47480
--- /dev/null
+++ b/cppe/demo/IceE/bidir/config.server
@@ -0,0 +1,29 @@
+#
+# The server creates one single object adapter with the name
+# "Callback.Server". The following line sets the endpoints for this
+# adapter.
+#
+Callback.Server.Endpoints=tcp -p 10000
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
+
+#
+# Network Tracing
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
+#Ice.Trace.Network=1
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
+#Ice.Trace.Protocol=1
diff --git a/cppe/demo/IceE/callback/CallbackSenderI.cpp b/cppe/demo/IceE/callback/CallbackSenderI.cpp
index cf492a4bb11..e3008b7f8d5 100644
--- a/cppe/demo/IceE/callback/CallbackSenderI.cpp
+++ b/cppe/demo/IceE/callback/CallbackSenderI.cpp
@@ -19,11 +19,11 @@ CallbackSenderI::initiateCallback(const CallbackReceiverPrx& proxy, const Ice::C
printf("initiating callback\n");
try
{
- proxy->callback(current.ctx);
+ proxy->callback(current.ctx);
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
+ fprintf(stderr, "%s\n", ex.toString().c_str());
}
}
@@ -33,10 +33,10 @@ CallbackSenderI::shutdown(const Ice::Current& c)
printf("shutting down...\n");
try
{
- c.adapter->getCommunicator()->shutdown();
+ c.adapter->getCommunicator()->shutdown();
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
+ fprintf(stderr, "%s\n", ex.toString().c_str());
}
}
diff --git a/cppe/demo/IceE/callback/Client.cpp b/cppe/demo/IceE/callback/Client.cpp
index da018dfec4a..dc3c2f9ab68 100644
--- a/cppe/demo/IceE/callback/Client.cpp
+++ b/cppe/demo/IceE/callback/Client.cpp
@@ -19,7 +19,7 @@ public:
virtual void callback(const Ice::Current&)
{
- printf("received callback\n");
+ printf("received callback\n");
}
};
@@ -47,30 +47,31 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
Ice::PropertiesPtr properties = communicator->getProperties();
- const char* proxyProperty = "Callback.Client.CallbackServer";
+ const char* proxyProperty = "CallbackSender.Proxy";
string proxy = properties->getProperty(proxyProperty);
if(proxy.empty())
{
- fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
+ return EXIT_FAILURE;
}
Ice::ObjectPrx base = communicator->stringToProxy(proxy);
CallbackSenderPrx twoway = CallbackSenderPrx::checkedCast(base->ice_twoway()->ice_timeout(-1));
if(!twoway)
{
- fprintf(stderr, "%s: invalid proxy\n", argv[0]);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: invalid proxy\n", argv[0]);
+ return EXIT_FAILURE;
}
CallbackSenderPrx oneway = CallbackSenderPrx::uncheckedCast(twoway->ice_oneway());
CallbackSenderPrx batchOneway = CallbackSenderPrx::uncheckedCast(twoway->ice_batchOneway());
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Callback.Client");
- adapter->add(new CallbackReceiverI, communicator->stringToIdentity("callbackReceiver"));
+ CallbackReceiverPtr cr = new CallbackReceiverI;
+ adapter->add(cr, communicator->stringToIdentity("callbackReceiver"));
adapter->activate();
CallbackReceiverPrx twowayR = CallbackReceiverPrx::uncheckedCast(
- adapter->createProxy(communicator->stringToIdentity("callbackReceiver")));
+ adapter->createProxy(communicator->stringToIdentity("callbackReceiver")));
CallbackReceiverPrx onewayR = CallbackReceiverPrx::uncheckedCast(twowayR->ice_oneway());
menu();
@@ -78,52 +79,52 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
char c = EOF;
do
{
- try
- {
- printf("==> ");
- do
- {
- c = getchar();
- }
- while(c != EOF && c == '\n');
- if(c == 't')
- {
- twoway->initiateCallback(twowayR);
- }
- else if(c == 'o')
- {
- oneway->initiateCallback(onewayR);
- }
- else if(c == 'O')
- {
- batchOneway->initiateCallback(onewayR);
- }
- else if(c == 'f')
- {
- communicator->flushBatchRequests();
- }
- else if(c == 's')
- {
- twoway->shutdown();
- }
- else if(c == 'x')
- {
- // Nothing to do
- }
- else if(c == '?')
- {
- menu();
- }
- else
- {
- printf("unknown command `%c'\n", c);
- menu();
- }
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- }
+ try
+ {
+ printf("==> ");
+ do
+ {
+ c = getchar();
+ }
+ while(c != EOF && c == '\n');
+ if(c == 't')
+ {
+ twoway->initiateCallback(twowayR);
+ }
+ else if(c == 'o')
+ {
+ oneway->initiateCallback(onewayR);
+ }
+ else if(c == 'O')
+ {
+ batchOneway->initiateCallback(onewayR);
+ }
+ else if(c == 'f')
+ {
+ communicator->flushBatchRequests();
+ }
+ else if(c == 's')
+ {
+ twoway->shutdown();
+ }
+ else if(c == 'x')
+ {
+ // Nothing to do
+ }
+ else if(c == '?')
+ {
+ menu();
+ }
+ else
+ {
+ printf("unknown command `%c'\n", c);
+ menu();
+ }
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ }
}
while(c != EOF && c != 'x');
@@ -140,7 +141,7 @@ main(int argc, char* argv[])
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- initData.properties->load("config");
+ initData.properties->load("config.client");
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
diff --git a/cppe/demo/IceE/callback/Server.cpp b/cppe/demo/IceE/callback/Server.cpp
index 2950777c207..01997a21f21 100644
--- a/cppe/demo/IceE/callback/Server.cpp
+++ b/cppe/demo/IceE/callback/Server.cpp
@@ -23,7 +23,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Callback.Server");
- adapter->add(new CallbackSenderI, communicator->stringToIdentity("callback"));
+ CallbackSenderPtr cbs = new CallbackSenderI;
+ adapter->add(cbs, communicator->stringToIdentity("callback"));
adapter->activate();
communicator->waitForShutdown();
return EXIT_SUCCESS;
@@ -39,7 +40,7 @@ main(int argc, char* argv[])
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- initData.properties->load("config");
+ initData.properties->load("config.server");
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
diff --git a/cppe/demo/IceE/callback/config b/cppe/demo/IceE/callback/config
deleted file mode 100644
index 3b224be4236..00000000000
--- a/cppe/demo/IceE/callback/config
+++ /dev/null
@@ -1,7 +0,0 @@
-Callback.Client.CallbackServer=callback:tcp -p 10000
-Callback.Client.Endpoints=tcp
-Callback.Server.Endpoints=tcp -p 10000
-
-#Ice.Trace.Network=1
-#Ice.Trace.Protocol=1
-Ice.Warn.Connections=1
diff --git a/cppe/demo/IceE/callback/config.client b/cppe/demo/IceE/callback/config.client
new file mode 100644
index 00000000000..012ddfb43b7
--- /dev/null
+++ b/cppe/demo/IceE/callback/config.client
@@ -0,0 +1,35 @@
+#
+# The client reads this property to create the reference to the
+# "CallbackSender" object in the server.
+#
+CallbackSender.Proxy=callback:tcp -p 10000
+
+#
+# The client creates one single object adapter with the name
+# "Callback.Client". The following line sets the endpoints for this
+# adapter.
+#
+Callback.Client.Endpoints=tcp
+
+#
+# Warn about connection exceptions.
+#
+Ice.Warn.Connections=1
+
+#
+# Network Tracing
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
+#Ice.Trace.Network=1
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
+#Ice.Trace.Protocol=1
diff --git a/cppe/demo/IceE/callback/config.server b/cppe/demo/IceE/callback/config.server
new file mode 100644
index 00000000000..d9c7154678a
--- /dev/null
+++ b/cppe/demo/IceE/callback/config.server
@@ -0,0 +1,29 @@
+#
+# The server creates one single object adapter with the name
+# "Callback.Server". The following line sets the endpoints for this
+# adapter.
+#
+Callback.Server.Endpoints=tcp -p 10000
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
+
+#
+# Network Tracing
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
+#Ice.Trace.Network=1
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
+#Ice.Trace.Protocol=1
diff --git a/cppe/demo/IceE/chat/ChatClient.cpp b/cppe/demo/IceE/chat/ChatClient.cpp
index f8acfe634cd..0f4be3f31d3 100644
--- a/cppe/demo/IceE/chat/ChatClient.cpp
+++ b/cppe/demo/IceE/chat/ChatClient.cpp
@@ -52,9 +52,9 @@ BOOL CChatClientApp::InitInstance()
LogIPtr log;
try
{
- Ice::InitializationData initData;
+ Ice::InitializationData initData;
log = new LogI;
- initData.logger = log;
+ initData.logger = log;
int argc = 0;
communicator = Ice::initialize(argc, 0, initData);
diff --git a/cppe/demo/IceE/chat/ChatClientDlg.cpp b/cppe/demo/IceE/chat/ChatClientDlg.cpp
index 216a77ba4d9..6bb3f13d32c 100644
--- a/cppe/demo/IceE/chat/ChatClientDlg.cpp
+++ b/cppe/demo/IceE/chat/ChatClientDlg.cpp
@@ -35,17 +35,15 @@ public:
virtual void
message(const string& data, const Ice::Current&)
{
- _log->message(data);
+ _log->message(data);
}
private:
const LogIPtr _log;
-
};
-CChatClientDlg::CChatClientDlg(const Ice::CommunicatorPtr& communicator, const LogIPtr& log,
- CWnd* pParent /*=NULL*/) :
+CChatClientDlg::CChatClientDlg(const Ice::CommunicatorPtr& communicator, const LogIPtr& log, CWnd* pParent /*=NULL*/) :
CDialog(CChatClientDlg::IDD, pParent),
_communicator(communicator),
_chat(0),
@@ -53,7 +51,7 @@ CChatClientDlg::CChatClientDlg(const Ice::CommunicatorPtr& communicator, const L
//_user(""), // For ease of testing these can be filled in.
//_password(""),
//_host(""),
- _port("10005")
+ _port("4063")
{
_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
@@ -66,9 +64,9 @@ CChatClientDlg::~CChatClientDlg()
//
if(_ping)
{
- _ping->destroy();
- _ping->getThreadControl().join();
- _ping = 0;
+ _ping->destroy();
+ _ping->getThreadControl().join();
+ _ping = 0;
}
}
@@ -108,9 +106,9 @@ CChatClientDlg::setDialogState()
if(_chat == 0)
{
- //
- // Logged out: Disable all except Login.
- //
+ //
+ // Logged out: Disable all except Login.
+ //
_edit->EnableWindow(FALSE);
_display->EnableWindow(FALSE);
sendWnd->EnableWindow(FALSE);
@@ -120,23 +118,23 @@ CChatClientDlg::setDialogState()
configWnd->SetWindowText("Login");
#endif
- //
- // Set the focus to the login button
- //
- loginWnd->SetFocus();
-
- //
- // Set the default button.
- //
- sendWnd->SendMessage(BM_SETSTYLE, (WPARAM)BS_PUSHBUTTON, (LPARAM)TRUE);
- SendMessage(DM_SETDEFID, (WPARAM)IDC_CONFIG, 0);
- configWnd->SendMessage(BM_SETSTYLE, (WPARAM)BS_DEFPUSHBUTTON, (LPARAM)TRUE);
+ //
+ // Set the focus to the login button
+ //
+ loginWnd->SetFocus();
+
+ //
+ // Set the default button.
+ //
+ sendWnd->SendMessage(BM_SETSTYLE, (WPARAM)BS_PUSHBUTTON, (LPARAM)TRUE);
+ SendMessage(DM_SETDEFID, (WPARAM)IDC_CONFIG, 0);
+ configWnd->SendMessage(BM_SETSTYLE, (WPARAM)BS_DEFPUSHBUTTON, (LPARAM)TRUE);
}
else
{
//
- // Logged in: Enable all and change Login to Logout
- //
+ // Logged in: Enable all and change Login to Logout
+ //
_edit->EnableWindow(TRUE);
_display->EnableWindow(TRUE);
sendWnd->EnableWindow(TRUE);
@@ -147,12 +145,12 @@ CChatClientDlg::setDialogState()
#endif
_edit->SetFocus();
- //
- // Set the default button.
- //
- configWnd->SendMessage(BM_SETSTYLE, (WPARAM)BS_PUSHBUTTON, (LPARAM)TRUE);
- SendMessage(DM_SETDEFID, (WPARAM)IDC_SEND, 0);
- sendWnd->SendMessage(BM_SETSTYLE, (WPARAM)BS_DEFPUSHBUTTON, (LPARAM)TRUE);
+ //
+ // Set the default button.
+ //
+ configWnd->SendMessage(BM_SETSTYLE, (WPARAM)BS_PUSHBUTTON, (LPARAM)TRUE);
+ SendMessage(DM_SETDEFID, (WPARAM)IDC_SEND, 0);
+ sendWnd->SendMessage(BM_SETSTYLE, (WPARAM)BS_DEFPUSHBUTTON, (LPARAM)TRUE);
}
}
@@ -195,24 +193,24 @@ CChatClientDlg::OnCancel()
{
if(_chat)
{
- //
- // Clear the router.
- //
- assert(_router);
- try
- {
- _router->destroySession();
- }
+ //
+ // Clear the router.
+ //
+ assert(_router);
+ try
+ {
+ _router->destroySession();
+ }
catch(const Ice::ConnectionLostException&)
{
//
// Expected: the router closed the connection.
//
}
- catch(const Ice::Exception& ex)
- {
- AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
- }
+ catch(const Ice::Exception& ex)
+ {
+ AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
+ }
}
_log->setHandle(0);
@@ -283,15 +281,15 @@ CChatClientDlg::OnSend()
text.TrimRight();
if(text.IsEmpty())
{
- return;
+ return;
}
try
{
#ifdef _WIN32_WCE
- char buffer[256];
- wcstombs(buffer, text, 256);
- _chat->say(buffer);
+ char buffer[256];
+ wcstombs(buffer, text, 256);
+ _chat->say(buffer);
#else
_chat->say(string(text));
#endif
@@ -300,10 +298,10 @@ CChatClientDlg::OnSend()
{
AfxMessageBox(CString(e.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
- _ping->destroy();
- _ping->getThreadControl().join();
+ _ping->destroy();
+ _ping->getThreadControl().join();
- EndDialog(0);
+ EndDialog(0);
}
//
@@ -319,129 +317,127 @@ CChatClientDlg::OnLogin()
if(_chat == 0)
{
//
- // Login: Create and display login dialog.
- //
+ // Login: Create and display login dialog.
+ //
CChatConfigDlg dlg(_user, _password, _host, _port);
if(dlg.DoModal() == IDOK)
- {
- _user = dlg.getUser();
- _password = dlg.getPassword();
- _host = dlg.getHost();
- _port = dlg.getPort();
-
- string user;
- string password;
- string host;
- string port;
+ {
+ _user = dlg.getUser();
+ _password = dlg.getPassword();
+ _host = dlg.getHost();
+ _port = dlg.getPort();
+
+ string user;
+ string password;
+ string host;
+ string port;
#ifdef _WIN32_WCE
- char buffer[64];
- wcstombs(buffer, _user, 64);
- user = buffer;
+ char buffer[64];
+ wcstombs(buffer, _user, 64);
+ user = buffer;
- wcstombs(buffer, _password, 64);
- password = buffer;
+ wcstombs(buffer, _password, 64);
+ password = buffer;
- wcstombs(buffer, _host, 64);
- host = buffer;
+ wcstombs(buffer, _host, 64);
+ host = buffer;
- wcstombs(buffer, _port, 64);
- port = buffer;
+ wcstombs(buffer, _port, 64);
+ port = buffer;
#else
- user = _user;
- password = _password;
- host = _host;
- port = _port;
+ user = _user;
+ password = _password;
+ host = _host;
+ port = _port;
#endif
- try
- {
- string routerStr =
- Ice::printfToString("DemoGlacier2/router:tcp -p %s -h %s", port.c_str(), host.c_str());
- _router = Glacier2::RouterPrx::checkedCast(_communicator->stringToProxy(routerStr));
- assert(_router);
-
- //
- // Now setup the new router.
- //
- _chat = ChatSessionPrx::uncheckedCast(_router->createSession(user, password)->ice_router(_router));
-
-
- //
- // Create the OA.
- //
- _adapter = _communicator->createObjectAdapterWithRouter("Chat.Client", _router);
- _adapter->activate();
-
- //
- // Create the callback object. This must have the
- // category as defined by the Glacier2 session.
- //
- string category = _router->getServerProxy()->ice_getIdentity().category;
- Ice::Identity callbackReceiverIdent;
- callbackReceiverIdent.name = "callbackReceiver";
- callbackReceiverIdent.category = category;
- _callback = ChatCallbackPrx::uncheckedCast(
- _adapter->add(new ChatCallbackI(_log), callbackReceiverIdent));
-
- _chat->setCallback(_callback);
-
- //
- // Create a ping thread to keep the session alive.
- //
- _ping = new SessionPingThread(_chat, (long)_router->getSessionTimeout() / 2);
- _ping->start();
- }
- catch(const Glacier2::CannotCreateSessionException& ex)
- {
- AfxMessageBox(CString(ex.reason.c_str()), MB_OK|MB_ICONEXCLAMATION);
- }
- catch(const Ice::Exception& ex)
- {
- AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
- _chat = 0;
- }
- }
+ try
+ {
+ string routerStr =
+ Ice::printfToString("DemoGlacier2/router:tcp -p %s -h %s", port.c_str(), host.c_str());
+ _router = Glacier2::RouterPrx::checkedCast(_communicator->stringToProxy(routerStr));
+ assert(_router);
+
+ //
+ // Now setup the new router.
+ //
+ _chat = ChatSessionPrx::uncheckedCast(_router->createSession(user, password)->ice_router(_router));
+
+ //
+ // Create the OA.
+ //
+ _adapter = _communicator->createObjectAdapterWithRouter("Chat.Client", _router);
+ _adapter->activate();
+
+ //
+ // Create the callback object. This must have the
+ // category as defined by the Glacier2 session.
+ //
+ Ice::Identity callbackReceiverIdent;
+ callbackReceiverIdent.name = "callbackReceiver";
+ callbackReceiverIdent.category = _router->getCallbackForClient();
+ ChatCallbackPtr cb = new ChatCallbackI(_log);
+ _callback = ChatCallbackPrx::uncheckedCast(_adapter->add(cb, callbackReceiverIdent));
+
+ _chat->setCallback(_callback);
+
+ //
+ // Create a ping thread to keep the session alive.
+ //
+ _ping = new SessionPingThread(_chat, (long)_router->getSessionTimeout() / 2);
+ _ping->start();
+ }
+ catch(const Glacier2::CannotCreateSessionException& ex)
+ {
+ AfxMessageBox(CString(ex.reason.c_str()), MB_OK|MB_ICONEXCLAMATION);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
+ _chat = 0;
+ }
+ }
}
else
{
//
- // Logout: Destroy session and stop ping thread.
- //
- assert(_callback);
- _adapter->remove(_callback->ice_getIdentity());
- _callback = 0;
-
- assert(_chat);
- _chat = 0;
-
- //
- // Destroy the ping thread.
- //
- _ping->destroy();
- _ping->getThreadControl().join();
- _ping = 0;
-
- //
- // Clear the router.
- //
- assert(_router);
- try
- {
- _router->destroySession();
- }
+ // Logout: Destroy session and stop ping thread.
+ //
+ assert(_callback);
+ _adapter->remove(_callback->ice_getIdentity());
+ _callback = 0;
+
+ assert(_chat);
+ _chat = 0;
+
+ //
+ // Destroy the ping thread.
+ //
+ _ping->destroy();
+ _ping->getThreadControl().join();
+ _ping = 0;
+
+ //
+ // Clear the router.
+ //
+ assert(_router);
+ try
+ {
+ _router->destroySession();
+ }
catch(const Ice::ConnectionLostException&)
{
//
// Expected: the router closed the connection.
//
}
- catch(const Ice::Exception& ex)
- {
- AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
- }
+ catch(const Ice::Exception& ex)
+ {
+ AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
+ }
- _adapter->destroy();
- _router = 0;
+ _adapter->destroy();
+ _router = 0;
}
//
diff --git a/cppe/demo/IceE/chat/ChatConfigDlg.cpp b/cppe/demo/IceE/chat/ChatConfigDlg.cpp
index 5ff7993880a..3849f12bc6c 100644
--- a/cppe/demo/IceE/chat/ChatConfigDlg.cpp
+++ b/cppe/demo/IceE/chat/ChatConfigDlg.cpp
@@ -19,7 +19,7 @@
using namespace std;
CChatConfigDlg::CChatConfigDlg(const CString& user, const CString& password,
- const CString& host, const CString& port, CWnd* pParent /*=NULL*/) :
+ const CString& host, const CString& port, CWnd* pParent /*=NULL*/) :
CDialog(CChatConfigDlg::IDD, pParent),
_user(user),
_password(password),
diff --git a/cppe/demo/IceE/chat/Client.cpp b/cppe/demo/IceE/chat/Client.cpp
index 78b09f415bd..7559dd37ae4 100644
--- a/cppe/demo/IceE/chat/Client.cpp
+++ b/cppe/demo/IceE/chat/Client.cpp
@@ -24,7 +24,7 @@ public:
virtual void
message(const string& data, const Ice::Current&)
{
- printf("%s\n", data.c_str());
+ printf("%s\n", data.c_str());
}
};
@@ -46,6 +46,23 @@ trim(const string& s)
return s;
}
+void
+cleanup(const Glacier2::RouterPrx& router, const SessionPingThreadPtr& ping)
+{
+ try
+ {
+ router->destroySession();
+ }
+ catch(const Ice::ConnectionLostException&)
+ {
+ //
+ // Expected: the router closed the connection.
+ //
+ }
+ ping->destroy();
+ ping->getThreadControl().join();
+}
+
int
run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
@@ -63,12 +80,10 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
Glacier2::RouterPrx router = Glacier2::RouterPrx::checkedCast(defaultRouter);
+ if(!router)
{
- if(!router)
- {
- fprintf(stderr, "%s: configured router is not a Glacier2 router\n", argv[0]);
- return EXIT_FAILURE;
- }
+ fprintf(stderr, "%s: configured router is not a Glacier2 router\n", argv[0]);
+ return EXIT_FAILURE;
}
char buffer[1024];
@@ -76,40 +91,39 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
ChatSessionPrx session;
while(true)
{
- printf("This demo accepts any user-id / password combination.\n");
+ printf("This demo accepts any user-id / password combination.\n");
printf("user id: ");
- fgets(buffer, 1024, stdin);
- string id(buffer);
+ fgets(buffer, 1024, stdin);
+ string id(buffer);
id = trim(id);
printf("password: ");
- fgets(buffer, 1024, stdin);
- string pw(buffer);
+ fgets(buffer, 1024, stdin);
+ string pw(buffer);
pw = trim(pw);
try
{
- session = ChatSessionPrx::uncheckedCast(router->createSession(id, pw));
- break;
+ session = ChatSessionPrx::uncheckedCast(router->createSession(id, pw));
+ break;
}
catch(const Glacier2::PermissionDeniedException& ex)
{
- fprintf(stderr, "permission denied:\n%s", ex.toString().c_str());
+ fprintf(stderr, "permission denied:\n%s", ex.toString().c_str());
}
}
SessionPingThreadPtr ping = new SessionPingThread(session, (long)router->getSessionTimeout() / 2);
ping->start();
- string category = router->getServerProxy()->ice_getIdentity().category;
Ice::Identity callbackReceiverIdent;
callbackReceiverIdent.name = "callbackReceiver";
- callbackReceiverIdent.category = category;
+ callbackReceiverIdent.category = router->getCategoryForClient();
- Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Chat.Client");
- ChatCallbackPrx callback = ChatCallbackPrx::uncheckedCast(
- adapter->add(new ChatCallbackI, callbackReceiverIdent));
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithRouter("Chat.Client", defaultRouter);
+ ChatCallbackPtr cb = new ChatCallbackI;
+ ChatCallbackPrx callback = ChatCallbackPrx::uncheckedCast(adapter->add(cb, callbackReceiverIdent));
adapter->activate();
session->setCallback(callback);
@@ -120,54 +134,42 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
do
{
- printf("==> ");
- char* ret = fgets(buffer, 1024, stdin);
- if(ret == NULL)
- {
- break;
- }
-
- string s(buffer);
- s = trim(s);
- if(!s.empty())
- {
- if(s[0] == '/')
- {
- if(s == "/quit")
- {
- break;
- }
- menu();
- }
- else
- {
- session->say(s);
- }
- }
- }
- while(true);
-
- try
- {
- router->destroySession();
- }
- catch(const Ice::ConnectionLostException&)
- {
- //
- // Expected: the router closed the connection.
- //
- }
+ printf("==> ");
+ char* ret = fgets(buffer, 1024, stdin);
+ if(ret == NULL)
+ {
+ break;
+ }
+
+ string s(buffer);
+ s = trim(s);
+ if(!s.empty())
+ {
+ if(s[0] == '/')
+ {
+ if(s == "/quit")
+ {
+ break;
+ }
+ menu();
+ }
+ else
+ {
+ session->say(s);
+ }
+ }
+ }
+ while(true);
+
+ cleanup(router, ping);
}
catch(const Ice::Exception& ex)
{
fprintf(stderr, "%s\n", ex.toString().c_str());
- ping->destroy();
- ping->getThreadControl().join();
+ cleanup(router, ping);
+
return EXIT_FAILURE;
}
-
- ping->destroy();
- ping->getThreadControl().join();
return EXIT_SUCCESS;
}
diff --git a/cppe/demo/IceE/chat/LogI.cpp b/cppe/demo/IceE/chat/LogI.cpp
index dbed3ad13c9..7577334bb12 100644
--- a/cppe/demo/IceE/chat/LogI.cpp
+++ b/cppe/demo/IceE/chat/LogI.cpp
@@ -65,7 +65,7 @@ LogI::message(const string& msg)
string line = msg + "\r\n";
if(_hwnd)
{
- post(line);
+ post(line);
}
else
{
@@ -79,7 +79,7 @@ LogI::setHandle(HWND hwnd)
_hwnd = hwnd;
if(_hwnd != 0 && !_buffer.empty())
{
- post(_buffer);
+ post(_buffer);
_buffer.clear();
}
}
diff --git a/cppe/demo/IceE/chat/README b/cppe/demo/IceE/chat/README
index 9204b31ccc2..fd026868442 100644
--- a/cppe/demo/IceE/chat/README
+++ b/cppe/demo/IceE/chat/README
@@ -16,11 +16,11 @@ public interface instead of the loopback interface.
For most configurations the property can be changed from:
-Glacier2.Client.Endpoints=ssl -p 10005 -h 127.0.0.1
+Glacier2.Client.Endpoints=ssl -p 4064 -h 127.0.0.1
to:
-Glacier2.Client.Endpoints=tcp -p 10005
+Glacier2.Client.Endpoints=tcp -p 4063
Next, start the Glacier2 router:
diff --git a/cppe/demo/IceE/chat/Router.ice b/cppe/demo/IceE/chat/Router.ice
index 5f22e1081bf..a8d117da000 100644
--- a/cppe/demo/IceE/chat/Router.ice
+++ b/cppe/demo/IceE/chat/Router.ice
@@ -107,7 +107,7 @@ interface Router extends Ice::Router
*
**/
Session* createSession(string userId, string password)
- throws PermissionDeniedException, CannotCreateSessionException;
+ throws PermissionDeniedException, CannotCreateSessionException;
/**
*
@@ -118,7 +118,7 @@ interface Router extends Ice::Router
*
**/
void destroySession()
- throws SessionNotExistException;
+ throws SessionNotExistException;
/**
*
diff --git a/cppe/demo/IceE/chat/Session.ice b/cppe/demo/IceE/chat/Session.ice
index f2fb6861fc3..f1f9c39b54d 100644
--- a/cppe/demo/IceE/chat/Session.ice
+++ b/cppe/demo/IceE/chat/Session.ice
@@ -224,7 +224,7 @@ interface SessionManager
*
**/
Session* create(string userId, SessionControl* control)
- throws CannotCreateSessionException;
+ throws CannotCreateSessionException;
};
};
diff --git a/cppe/demo/IceE/chat/config b/cppe/demo/IceE/chat/config
index 83d3000811e..e6dec3e0505 100644
--- a/cppe/demo/IceE/chat/config
+++ b/cppe/demo/IceE/chat/config
@@ -2,14 +2,7 @@
# The proxy to the Glacier2 router for all outgoing connections. This
# must match the value of Glacier2.Client.Endpoints in config.glacier2.
#
-Ice.Default.Router=DemoGlacier2/router:tcp -p 10005 -h 127.0.0.1
-
-#
-# The proxy for the Glacier2 router, installed in the client's
-# object adapter named Chat.Client. This router proxy must
-# match the value of Glacier2.Client.Endpoints.
-#
-Chat.Client.Router=DemoGlacier2/router:tcp -p 10005 -h 127.0.0.1
+Ice.Default.Router=DemoGlacier2/router:tcp -p 4063 -h 127.0.0.1
#
# We don't need any endpoints for the client if we use a
@@ -25,9 +18,24 @@ Chat.Client.Endpoints=
Ice.RetryIntervals=-1
#
-# Other settings.
+# Warn about connection exceptions
#
+#Ice.Warn.Connections=1
+#
+# Network Tracing
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
#Ice.Trace.Network=1
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
#Ice.Trace.Protocol=1
-#Ice.Warn.Connections=1
diff --git a/cppe/demo/IceE/chat/stdafx.h b/cppe/demo/IceE/chat/stdafx.h
index 64165af5a41..7316cf46505 100644
--- a/cppe/demo/IceE/chat/stdafx.h
+++ b/cppe/demo/IceE/chat/stdafx.h
@@ -51,21 +51,21 @@
#endif // _WIN32_WCE
#ifndef VC_EXTRALEAN
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#if defined(_WIN32_WCE) && (_WIN32_WCE >= 211) && (_AFXDLL)
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
+#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
+#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
-#include <afxsock.h> // MFC socket extensions
+#include <afxsock.h> // MFC socket extensions
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
diff --git a/cppe/demo/IceE/hello/Client.cpp b/cppe/demo/IceE/hello/Client.cpp
index f2174d5e25b..f739944e5e2 100644
--- a/cppe/demo/IceE/hello/Client.cpp
+++ b/cppe/demo/IceE/hello/Client.cpp
@@ -44,16 +44,16 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
string proxy = properties->getProperty(proxyProperty);
if(proxy.empty())
{
- fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
+ return EXIT_FAILURE;
}
Ice::ObjectPrx base = communicator->stringToProxy(proxy);
HelloPrx twoway = HelloPrx::checkedCast(base->ice_twoway()->ice_timeout(-1));
if(!twoway)
{
- fprintf(stderr, "%s: invalid proxy\n", argv[0]);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: invalid proxy\n", argv[0]);
+ return EXIT_FAILURE;
}
HelloPrx oneway = HelloPrx::uncheckedCast(twoway->ice_oneway());
#ifdef ICEE_HAS_BATCH
@@ -68,99 +68,99 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
char c = EOF;
do
{
- try
- {
- printf("==> ");
- do
- {
- c = getchar();
- }
- while(c != EOF && c == '\n');
- if(c == 't')
- {
- twoway->sayHello(delay);
- }
- else if(c == 'o')
- {
- oneway->sayHello(delay);
- }
+ try
+ {
+ printf("==> ");
+ do
+ {
+ c = getchar();
+ }
+ while(c != EOF && c == '\n');
+ if(c == 't')
+ {
+ twoway->sayHello(delay);
+ }
+ else if(c == 'o')
+ {
+ oneway->sayHello(delay);
+ }
#ifdef ICEE_HAS_BATCH
- else if(c == 'O')
- {
- batchOneway->sayHello(delay);
- }
- else if(c == 'f')
- {
- communicator->flushBatchRequests();
- }
+ else if(c == 'O')
+ {
+ batchOneway->sayHello(delay);
+ }
+ else if(c == 'f')
+ {
+ communicator->flushBatchRequests();
+ }
#endif
- else if(c == 'T')
- {
- if(timeout == -1)
- {
- timeout = 2000;
- }
- else
- {
- timeout = -1;
- }
-
- twoway = HelloPrx::uncheckedCast(twoway->ice_timeout(timeout));
- oneway = HelloPrx::uncheckedCast(oneway->ice_timeout(timeout));
+ else if(c == 'T')
+ {
+ if(timeout == -1)
+ {
+ timeout = 2000;
+ }
+ else
+ {
+ timeout = -1;
+ }
+
+ twoway = HelloPrx::uncheckedCast(twoway->ice_timeout(timeout));
+ oneway = HelloPrx::uncheckedCast(oneway->ice_timeout(timeout));
#ifdef ICEE_HAS_BATCH
- batchOneway = HelloPrx::uncheckedCast(batchOneway->ice_timeout(timeout));
-#endif
- if(timeout == -1)
- {
- printf("timeout is now switched off\n");
- }
- else
- {
- printf("timeout is now set to 2000ms\n");
- }
- }
- else if(c == 'P')
- {
- if(delay == 0)
- {
- delay = 2500;
- }
- else
- {
- delay = 0;
- }
-
- if(delay == 0)
- {
- printf("server delay is now deactivated\n");
- }
- else
- {
- printf("server delay is now set to 2500ms\n");
- }
- }
- else if(c == 's')
- {
- twoway->shutdown();
- }
- else if(c == 'x')
- {
- // Nothing to do
- }
- else if(c == '?')
- {
- menu();
- }
- else
- {
- printf("unknown command `%c'\n", c);
- menu();
- }
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- }
+ batchOneway = HelloPrx::uncheckedCast(batchOneway->ice_timeout(timeout));
+#endif
+ if(timeout == -1)
+ {
+ printf("timeout is now switched off\n");
+ }
+ else
+ {
+ printf("timeout is now set to 2000ms\n");
+ }
+ }
+ else if(c == 'P')
+ {
+ if(delay == 0)
+ {
+ delay = 2500;
+ }
+ else
+ {
+ delay = 0;
+ }
+
+ if(delay == 0)
+ {
+ printf("server delay is now deactivated\n");
+ }
+ else
+ {
+ printf("server delay is now set to 2500ms\n");
+ }
+ }
+ else if(c == 's')
+ {
+ twoway->shutdown();
+ }
+ else if(c == 'x')
+ {
+ // Nothing to do
+ }
+ else if(c == '?')
+ {
+ menu();
+ }
+ else
+ {
+ printf("unknown command `%c'\n", c);
+ menu();
+ }
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ }
}
while(c != EOF && c != 'x');
@@ -175,29 +175,29 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->load("config");
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties();
+ initData.properties->load("config.client");
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/hello/Server.cpp b/cppe/demo/IceE/hello/Server.cpp
index e428c1c9dfa..313cb6a9948 100644
--- a/cppe/demo/IceE/hello/Server.cpp
+++ b/cppe/demo/IceE/hello/Server.cpp
@@ -22,7 +22,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Hello");
- Ice::ObjectPtr object = new HelloI;
+ Demo::HelloPtr object = new HelloI;
adapter->add(object, communicator->stringToIdentity("hello"));
adapter->activate();
communicator->waitForShutdown();
@@ -38,29 +38,29 @@ main(int argc, char* argv[])
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->load("config");
- initData.properties->setProperty("Ice.Override.Timeout", "100");
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ initData.properties = Ice::createProperties();
+ initData.properties->load("config.server");
+ initData.properties->setProperty("Ice.Override.Timeout", "100");
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/hello/config b/cppe/demo/IceE/hello/config.client
index 99491820ac2..0cea3d3bc26 100644
--- a/cppe/demo/IceE/hello/config
+++ b/cppe/demo/IceE/hello/config.client
@@ -5,16 +5,9 @@
Hello.Proxy=hello:tcp -p 10000
#
-# The server creates one single object adapter with the name
-# "Hello". The following line sets the endpoints for this
-# adapter.
-#
-Hello.Endpoints=tcp -p 10000
-
-#
# Warn about connection exceptions
#
-#Ice.Warn.Connections=1
+Ice.Warn.Connections=1
#
# Network Tracing
@@ -24,7 +17,7 @@ Hello.Endpoints=tcp -p 10000
# 2 = like 1, but more detailed
# 3 = like 2, but also trace data transfer
#
-Ice.Trace.Network=0
+#Ice.Trace.Network=1
#
# Protocol Tracing
@@ -32,4 +25,4 @@ Ice.Trace.Network=0
# 0 = no protocol tracing
# 1 = trace protocol messages
#
-Ice.Trace.Protocol=0
+#Ice.Trace.Protocol=1
diff --git a/cppe/demo/IceE/minimal/config b/cppe/demo/IceE/hello/config.server
index 9a0c897c2d4..147d3c96ade 100644
--- a/cppe/demo/IceE/minimal/config
+++ b/cppe/demo/IceE/hello/config.server
@@ -1,10 +1,4 @@
#
-# The client reads this property to create the reference to the
-# "hello" object in the server.
-#
-Hello.Proxy=hello:tcp -p 10000
-
-#
# The server creates one single object adapter with the name
# "Hello". The following line sets the endpoints for this
# adapter.
@@ -24,7 +18,7 @@ Ice.Warn.Connections=1
# 2 = like 1, but more detailed
# 3 = like 2, but also trace data transfer
#
-Ice.Trace.Network=0
+#Ice.Trace.Network=1
#
# Protocol Tracing
@@ -32,4 +26,4 @@ Ice.Trace.Network=0
# 0 = no protocol tracing
# 1 = trace protocol messages
#
-Ice.Trace.Protocol=0
+#Ice.Trace.Protocol=1
diff --git a/cppe/demo/IceE/latency/Client.cpp b/cppe/demo/IceE/latency/Client.cpp
index 919ec2375bb..7d2230d259f 100644
--- a/cppe/demo/IceE/latency/Client.cpp
+++ b/cppe/demo/IceE/latency/Client.cpp
@@ -23,20 +23,20 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
Ice::PropertiesPtr properties = communicator->getProperties();
- const char* proxyProperty = "Latency.Proxy";
+ const char* proxyProperty = "Ping.Proxy";
string proxy = properties->getProperty(proxyProperty);
if(proxy.empty())
{
- fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
+ return EXIT_FAILURE;
}
Ice::ObjectPrx base = communicator->stringToProxy(proxy);
PingPrx ping = PingPrx::checkedCast(base);
if(!ping)
{
- fprintf(stderr, "%s: invalid proxy\n", argv[0]);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: invalid proxy\n", argv[0]);
+ return EXIT_FAILURE;
}
// Initial ping to setup the connection.
@@ -48,7 +48,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
printf("pinging server %d times (this may take a while)\n", repetitions);
for(int i = 0; i < repetitions; ++i)
{
- ping->ice_ping();
+ ping->ice_ping();
}
tm = IceUtil::Time::now() - tm;
@@ -68,28 +68,28 @@ main(int argc, char* argv[])
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->load("config");
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ initData.properties = Ice::createProperties();
+ initData.properties->load("config.client");
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/latency/Server.cpp b/cppe/demo/IceE/latency/Server.cpp
index d2abde441e3..c588ba75985 100644
--- a/cppe/demo/IceE/latency/Server.cpp
+++ b/cppe/demo/IceE/latency/Server.cpp
@@ -13,12 +13,6 @@
using namespace std;
using namespace Demo;
-class PingI : public Ping
-{
-public:
- // no methods.
-};
-
int
run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
@@ -29,7 +23,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Latency");
- adapter->add(new PingI, communicator->stringToIdentity("ping"));
+ Ice::ObjectPtr object = new Ping;
+ adapter->add(object, communicator->stringToIdentity("ping"));
adapter->activate();
communicator->waitForShutdown();
return EXIT_SUCCESS;
@@ -44,28 +39,28 @@ main(int argc, char* argv[])
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->load("config");
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ initData.properties = Ice::createProperties();
+ initData.properties->load("config.server");
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/latency/WinCEClient.cpp b/cppe/demo/IceE/latency/WinCEClient.cpp
index 753150d5c9b..70542c2bd11 100644
--- a/cppe/demo/IceE/latency/WinCEClient.cpp
+++ b/cppe/demo/IceE/latency/WinCEClient.cpp
@@ -23,35 +23,35 @@ WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
- WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE,
- 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
- hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
- assert(editHwnd != NULL);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
+ WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE,
+ 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
+ hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
+ assert(editHwnd != NULL);
}
break;
case WM_SIZE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
}
break;
case WM_CLOSE:
- DestroyWindow(hWnd);
- break;
+ DestroyWindow(hWnd);
+ break;
case WM_DESTROY:
- wmDestroy = true;
- PostQuitMessage(0);
- break;
+ wmDestroy = true;
+ PostQuitMessage(0);
+ break;
default:
- return DefWindowProc(hWnd, msg, wParam, lParam);
+ return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
@@ -62,21 +62,21 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
static const TCHAR windowClassName[] = L"Latency Client";
WNDCLASS wc;
- wc.style = CS_HREDRAW|CS_VREDRAW;
- wc.lpfnWndProc = (WNDPROC)WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(NULL, 0);
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
+ wc.style = CS_HREDRAW|CS_VREDRAW;
+ wc.lpfnWndProc = (WNDPROC)WndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = LoadIcon(NULL, 0);
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = windowClassName;
if(!RegisterClass(&wc))
{
- MessageBox(NULL, L"Window Registration Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Registration Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
RECT rect;
@@ -84,20 +84,20 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
int width = rect.right - rect.left;
if(width > 320)
{
- width = 320;
+ width = 320;
}
int height = rect.bottom - rect.top;
if(height > 200)
{
- height = 200;
+ height = 200;
}
HWND mainWnd = CreateWindow(windowClassName, L"Latency Client", WS_VISIBLE|WS_OVERLAPPED|WS_SYSMENU|WS_SIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, width, height,
- NULL, NULL, hInstance, NULL);
+ CW_USEDEFAULT, CW_USEDEFAULT, width, height,
+ NULL, NULL, hInstance, NULL);
if(mainWnd == NULL)
{
- MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
ShowWindow(mainWnd, SW_SHOW);
@@ -109,110 +109,110 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
-
- //
- // Set a default value for Latency.Proxy so that the demo will
- // run without a configuration file.
- //
- initData.properties->setProperty("Latency.Proxy", "ping:tcp -p 10000");
-
- //
- // Now, load the configuration file if present. Under WinCE we
- // use "config.txt" since it can be edited with pocket word.
- //
- try
- {
- initData.properties->load("config.txt");
- }
- catch(const Ice::FileException&)
- {
- }
-
- communicator = Ice::initialize(__argc, __argv, initData);
-
- const char* proxyProperty = "Latency.Proxy";
- string proxy = initData.properties->getProperty(proxyProperty);
-
- PingPrx ping = PingPrx::checkedCast(communicator->stringToProxy(proxy));
- if(!ping)
- {
- MessageBox(NULL, L"invalid proxy", L"Latency Client", MB_ICONEXCLAMATION | MB_OK);
- return EXIT_FAILURE;
- }
-
- // Initial ping to setup the connection.
- ping->ice_ping();
-
- IceUtil::Time tm = IceUtil::Time::now();
-
- const int repetitions = 10000;
- wchar_t buf[1000];
- wsprintf(buf, L"pinging server %d times (this may take a while)\r\n", repetitions);
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
- for(int i = 0; i < repetitions; ++i)
- {
- ping->ice_ping();
- if((i % 100) == 0)
- {
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)L".");
- //
- // Run the message pump just in case the user tries to close the app.
- //
- MSG Msg;
- while(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
- if(wmDestroy)
- {
- break;
- }
- }
- }
-
- tm = IceUtil::Time::now() - tm;
-
- wsprintf(buf, L"\r\ntime for %d pings: %fms\r\ntime per ping: %fms\r\n",
- repetitions, tm.toMilliSecondsDouble(), tm.toMilliSecondsDouble() / repetitions);
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
-
- //
- // Run the message pump.
- //
- MSG Msg;
- while(GetMessage(&Msg, NULL, 0, 0) > 0)
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
+ initData.properties = Ice::createProperties();
+
+ //
+ // Set a default value for Ping.Proxy so that the demo will
+ // run without a configuration file.
+ //
+ initData.properties->setProperty("Ping.Proxy", "ping:tcp -p 10000");
+
+ //
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
+ //
+ try
+ {
+ initData.properties->load("config.txt");
+ }
+ catch(const Ice::FileException&)
+ {
+ }
+
+ communicator = Ice::initialize(__argc, __argv, initData);
+
+ const char* proxyProperty = "Ping.Proxy";
+ string proxy = initData.properties->getProperty(proxyProperty);
+
+ PingPrx ping = PingPrx::checkedCast(communicator->stringToProxy(proxy));
+ if(!ping)
+ {
+ MessageBox(NULL, L"invalid proxy", L"Latency Client", MB_ICONEXCLAMATION | MB_OK);
+ return EXIT_FAILURE;
+ }
+
+ // Initial ping to setup the connection.
+ ping->ice_ping();
+
+ IceUtil::Time tm = IceUtil::Time::now();
+
+ const int repetitions = 10000;
+ wchar_t buf[1000];
+ wsprintf(buf, L"pinging server %d times (this may take a while)\r\n", repetitions);
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
+ for(int i = 0; i < repetitions; ++i)
+ {
+ ping->ice_ping();
+ if((i % 100) == 0)
+ {
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)L".");
+ //
+ // Run the message pump just in case the user tries to close the app.
+ //
+ MSG Msg;
+ while(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
+ if(wmDestroy)
+ {
+ break;
+ }
+ }
+ }
+
+ tm = IceUtil::Time::now() - tm;
+
+ wsprintf(buf, L"\r\ntime for %d pings: %fms\r\ntime per ping: %fms\r\n",
+ repetitions, tm.toMilliSecondsDouble(), tm.toMilliSecondsDouble() / repetitions);
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
+
+ //
+ // Run the message pump.
+ //
+ MSG Msg;
+ while(GetMessage(&Msg, NULL, 0, 0) > 0)
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
}
catch(const Ice::Exception& ex)
{
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
- status = EXIT_FAILURE;
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
-
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/latency/WinCEServer.cpp b/cppe/demo/IceE/latency/WinCEServer.cpp
index 4e40dcb27ef..3b9b27ddc9c 100644
--- a/cppe/demo/IceE/latency/WinCEServer.cpp
+++ b/cppe/demo/IceE/latency/WinCEServer.cpp
@@ -13,12 +13,6 @@
using namespace std;
using namespace Demo;
-class PingI : public Ping
-{
-public:
- // no methods.
-};
-
static HWND editHwnd;
static LRESULT CALLBACK
@@ -28,34 +22,34 @@ WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
- WS_CHILD | WS_VISIBLE | WS_VSCROLL /*| WS_HSCROLL*/ | ES_MULTILINE,
- 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
- hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
- assert(editHwnd != NULL);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
+ WS_CHILD | WS_VISIBLE | WS_VSCROLL /*| WS_HSCROLL*/ | ES_MULTILINE,
+ 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
+ hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
+ assert(editHwnd != NULL);
}
break;
case WM_SIZE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
}
break;
case WM_CLOSE:
- DestroyWindow(hWnd);
- break;
+ DestroyWindow(hWnd);
+ break;
case WM_DESTROY:
- PostQuitMessage(0);
- break;
+ PostQuitMessage(0);
+ break;
default:
- return DefWindowProc(hWnd, msg, wParam, lParam);
+ return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
@@ -66,22 +60,22 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
static const TCHAR windowClassName[] = L"Latency Server";
WNDCLASS wc;
- wc.style = CS_HREDRAW|CS_VREDRAW;
- wc.lpfnWndProc = (WNDPROC)WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(NULL, 0);
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
+ wc.style = CS_HREDRAW|CS_VREDRAW;
+ wc.lpfnWndProc = (WNDPROC)WndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = LoadIcon(NULL, 0);
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = windowClassName;
if(!RegisterClass(&wc))
{
- MessageBox(NULL, L"Window Registration Failed!", L"Error!",
- MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Registration Failed!", L"Error!",
+ MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
RECT rect;
@@ -89,20 +83,20 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
int width = rect.right - rect.left;
if(width > 320)
{
- width = 320;
+ width = 320;
}
int height = rect.bottom - rect.top;
if(height > 200)
{
- height = 200;
+ height = 200;
}
HWND mainWnd = CreateWindow(windowClassName, L"Latency Server", WS_VISIBLE|WS_OVERLAPPED|WS_SYSMENU|WS_SIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, width, height,
- NULL, NULL, hInstance, NULL);
+ CW_USEDEFAULT, CW_USEDEFAULT, width, height,
+ NULL, NULL, hInstance, NULL);
if(mainWnd == NULL)
{
- MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
ShowWindow(mainWnd, SW_SHOW);
@@ -118,72 +112,73 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- //
- // Set a default value for Latency.Endpoints so that the demo
- // will run without a configuration file.
- //
- initData.properties->setProperty("Latency.Endpoints","tcp -p 10000");
-
- //
- // Now, load the configuration file if present. Under WinCE we
- // use "config.txt" since it can be edited with pocket word.
- //
- try
- {
- initData.properties->load("config.txt");
- }
- catch(const Ice::FileException&)
- {
- }
-
- communicator = Ice::initialize(__argc, __argv, initData);
-
- Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Latency");
- adapter->add(new PingI, communicator->stringToIdentity("ping"));
- adapter->activate();
-
- //
- // Display a helpful message to the user.
- //
- ::SendMessage(editHwnd, EM_REPLACESEL,
- (WPARAM)FALSE, (LPARAM)L"Close the window to terminate the server.\r\n");
-
- //
- // Run the message pump.
- //
- MSG Msg;
- while(GetMessage(&Msg, NULL, 0, 0) > 0)
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
+ initData.properties = Ice::createProperties();
+ //
+ // Set a default value for Latency.Endpoints so that the demo
+ // will run without a configuration file.
+ //
+ initData.properties->setProperty("Latency.Endpoints", "tcp -p 10000");
+
+ //
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
+ //
+ try
+ {
+ initData.properties->load("config.txt");
+ }
+ catch(const Ice::FileException&)
+ {
+ }
+
+ communicator = Ice::initialize(__argc, __argv, initData);
+
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Latency");
+ Ice::ObjectPtr object = new Ping;
+ adapter->add(object, communicator->stringToIdentity("ping"));
+ adapter->activate();
+
+ //
+ // Display a helpful message to the user.
+ //
+ ::SendMessage(editHwnd, EM_REPLACESEL,
+ (WPARAM)FALSE, (LPARAM)L"Close the window to terminate the server.\r\n");
+
+ //
+ // Run the message pump.
+ //
+ MSG Msg;
+ while(GetMessage(&Msg, NULL, 0, 0) > 0)
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
}
catch(const Ice::Exception& ex)
{
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
- status = EXIT_FAILURE;
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
-
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+
+ status = EXIT_FAILURE;
+ }
}
return status;
}
diff --git a/cppe/demo/IceE/latency/config b/cppe/demo/IceE/latency/config
deleted file mode 100644
index cb4786fad59..00000000000
--- a/cppe/demo/IceE/latency/config
+++ /dev/null
@@ -1,7 +0,0 @@
-Latency.Proxy=ping:default -p 10000 -h 127.0.0.1
-Latency.Endpoints=default -p 10000 -h 127.0.0.1
-
-#
-# Use faster blocking client side model by default.
-#
-Ice.Blocking=1
diff --git a/cppe/demo/IceE/latency/config.client b/cppe/demo/IceE/latency/config.client
new file mode 100644
index 00000000000..efede8629e4
--- /dev/null
+++ b/cppe/demo/IceE/latency/config.client
@@ -0,0 +1,5 @@
+#
+# The client reads this property to create the reference to the "Ping"
+# object in the server.
+#
+Ping.Proxy=ping:default -p 10000 -h 127.0.0.1
diff --git a/cppe/demo/IceE/latency/config.server b/cppe/demo/IceE/latency/config.server
new file mode 100644
index 00000000000..75e3479d6fe
--- /dev/null
+++ b/cppe/demo/IceE/latency/config.server
@@ -0,0 +1,10 @@
+#
+# The server creates one single object adapter with the name
+# "Latency". The following line sets the endpoints for this adapter.
+#
+Latency.Endpoints=default -p 10000 -h 127.0.0.1
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
diff --git a/cppe/demo/IceE/minimal/Client.cpp b/cppe/demo/IceE/minimal/Client.cpp
index a44b0ffeb55..4ab546b0d36 100644
--- a/cppe/demo/IceE/minimal/Client.cpp
+++ b/cppe/demo/IceE/minimal/Client.cpp
@@ -13,111 +13,48 @@
using namespace std;
using namespace Demo;
-void
-menu()
-{
- printf("usage:\nh: say hello\nx: exit\n?: help\n");
-}
-
-int
-run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
-{
- if(argc > 1)
- {
- fprintf(stderr, "%s: too many arguments\n", argv[0]);
- return EXIT_FAILURE;
- }
-
- Ice::PropertiesPtr properties = communicator->getProperties();
- const char* proxyProperty = "Hello.Proxy";
- string proxy = properties->getProperty(proxyProperty);
- if(proxy.empty())
- {
- fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
- return EXIT_FAILURE;
- }
-
- HelloPrx hello = HelloPrx::checkedCast(communicator->stringToProxy(proxy));
- if(!hello)
- {
-
- fprintf(stderr, "%s: invalid proxy\n", argv[0]);
- return EXIT_FAILURE;
- }
-
- menu();
-
- char c = EOF;
- do
- {
- try
- {
- printf("==> ");
- do
- {
- c = getchar();
- }
- while(c != EOF && c == '\n');
- if(c == 'h')
- {
- hello->sayHello();
- }
- else if(c == 'x')
- {
- // Nothing to do
- }
- else if(c == '?')
- {
- menu();
- }
- else
- {
- printf("unknown command `%c'\n", c);
- menu();
- }
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- }
- }
- while(c != EOF && c != 'x');
-
- return EXIT_SUCCESS;
-}
-
int
main(int argc, char* argv[])
{
-
- int status;
+ int status = EXIT_SUCCESS;
Ice::CommunicatorPtr communicator;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->load("config");
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ communicator = Ice::initialize(argc, argv);
+ if(argc > 1)
+ {
+ fprintf(stderr, "%s: too many arguments\n", argv[0]);
+ return EXIT_FAILURE;
+ }
+ HelloPrx hello = HelloPrx::checkedCast(communicator->stringToProxy("hello:tcp -p 10000"));
+ if(!hello)
+ {
+ fprintf(stderr, "%s: invalid proxy\n", argv[0]);
+ status = EXIT_FAILURE;
+ }
+ else
+ {
+ hello->sayHello();
+ }
}
catch(const Ice::Exception& ex)
{
fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/minimal/Server.cpp b/cppe/demo/IceE/minimal/Server.cpp
index be0e478fd19..efd5afe33de 100644
--- a/cppe/demo/IceE/minimal/Server.cpp
+++ b/cppe/demo/IceE/minimal/Server.cpp
@@ -20,59 +20,47 @@ public:
virtual void
sayHello(const Ice::Current&) const
{
- printf("Hello World!\n");
+ printf("Hello World!\n");
}
};
int
-run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
-{
- if(argc > 1)
- {
- fprintf(stderr, "%s: too many arguments\n", argv[0]);
- return EXIT_FAILURE;
- }
-
- Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Hello");
- Ice::ObjectPtr object = new HelloI;
- adapter->add(object, communicator->stringToIdentity("hello"));
- adapter->activate();
- communicator->waitForShutdown();
-
- return EXIT_SUCCESS;
-}
-
-int
main(int argc, char* argv[])
{
- int status;
+ int status = EXIT_SUCCESS;
Ice::CommunicatorPtr communicator;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->load("config");
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ communicator = Ice::initialize(argc, argv);
+ if(argc > 1)
+ {
+ fprintf(stderr, "%s: too many arguments\n", argv[0]);
+ return EXIT_FAILURE;
+ }
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("Hello", "tcp -p 10000");
+ Demo::HelloPtr object = new HelloI;
+ adapter->add(object, communicator->stringToIdentity("hello"));
+ adapter->activate();
+ communicator->waitForShutdown();
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/minimal/WinCEClient.cpp b/cppe/demo/IceE/minimal/WinCEClient.cpp
index b53c29c6f36..8d88664baf2 100644
--- a/cppe/demo/IceE/minimal/WinCEClient.cpp
+++ b/cppe/demo/IceE/minimal/WinCEClient.cpp
@@ -25,64 +25,64 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ initData.properties = Ice::createProperties();
- //
- // Set a default value for "Hello.Proxy" so that the demo will
- // run without a configuration file.
- //
- initData.properties->setProperty("Hello.Proxy", "hello:tcp -p 10000");
+ //
+ // Set a default value for "Hello.Proxy" so that the demo will
+ // run without a configuration file.
+ //
+ initData.properties->setProperty("Hello.Proxy", "hello:tcp -p 10000");
- //
- // Now, load the configuration file if present. Under WinCE we
- // use "config.txt" since it can be edited with pocket word.
- //
- try
- {
- initData.properties->load("config.txt");
- }
- catch(const Ice::FileException&)
- {
- }
+ //
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
+ //
+ try
+ {
+ initData.properties->load("config.txt");
+ }
+ catch(const Ice::FileException&)
+ {
+ }
- communicator = Ice::initialize(__argc, __argv, initData);
+ communicator = Ice::initialize(__argc, __argv, initData);
- HelloPrx hello =
- HelloPrx::checkedCast(communicator->stringToProxy(initData.properties->getProperty("Hello.Proxy")));
- if(!hello)
- {
- MessageBox(NULL, L"invalid proxy", L"Minimal Client", MB_ICONEXCLAMATION | MB_OK);
- return EXIT_FAILURE;
- }
+ HelloPrx hello =
+ HelloPrx::checkedCast(communicator->stringToProxy(initData.properties->getProperty("Hello.Proxy")));
+ if(!hello)
+ {
+ MessageBox(NULL, L"invalid proxy", L"Minimal Client", MB_ICONEXCLAMATION | MB_OK);
+ return EXIT_FAILURE;
+ }
- hello->sayHello();
- MessageBox(NULL, L"Sent \"sayHello()\" message", L"Minimal Client", MB_ICONEXCLAMATION | MB_OK);
+ hello->sayHello();
+ MessageBox(NULL, L"Sent \"sayHello()\" message", L"Minimal Client", MB_ICONEXCLAMATION | MB_OK);
}
catch(const Ice::Exception& ex)
{
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
- status = EXIT_FAILURE;
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
- status = EXIT_FAILURE;
- }
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/minimal/WinCEServer.cpp b/cppe/demo/IceE/minimal/WinCEServer.cpp
index 8228e59aecf..970e02c3b4b 100644
--- a/cppe/demo/IceE/minimal/WinCEServer.cpp
+++ b/cppe/demo/IceE/minimal/WinCEServer.cpp
@@ -18,21 +18,21 @@ class HelloI : public Hello
public:
HelloI(HWND wnd)
- : _wnd(wnd)
+ : _wnd(wnd)
{
}
virtual void
sayHello(const Ice::Current&) const
{
- //
- // Its not legal to write to windows controls in a thread
- // other than main, so we post a custom message to the main
- // thread which will cause the message to be written to the
- // edit control.
- //
- static wchar_t* hello = L"Hello World\r\n";
- ::PostMessage(_wnd, WM_USER, (WPARAM)FALSE, (LPARAM)_wcsdup(hello));
+ //
+ // Its not legal to write to windows controls in a thread
+ // other than main, so we post a custom message to the main
+ // thread which will cause the message to be written to the
+ // edit control.
+ //
+ static wchar_t* hello = L"Hello World\r\n";
+ ::PostMessage(_wnd, WM_USER, (WPARAM)FALSE, (LPARAM)_wcsdup(hello));
}
private:
@@ -49,42 +49,42 @@ WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_USER:
{
- // tprint from a thread other than main. lParam holds a pointer to the text.
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)wParam, (LPARAM)lParam);
- free((wchar_t*)lParam);
+ // tprint from a thread other than main. lParam holds a pointer to the text.
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)wParam, (LPARAM)lParam);
+ free((wchar_t*)lParam);
}
break;
case WM_CREATE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
- WS_CHILD | WS_VISIBLE | WS_VSCROLL /*| WS_HSCROLL*/ | ES_MULTILINE,
- 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
- hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
- assert(editHwnd != NULL);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
+ WS_CHILD | WS_VISIBLE | WS_VSCROLL /*| WS_HSCROLL*/ | ES_MULTILINE,
+ 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
+ hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
+ assert(editHwnd != NULL);
}
break;
case WM_SIZE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
}
break;
case WM_CLOSE:
- DestroyWindow(hWnd);
- break;
+ DestroyWindow(hWnd);
+ break;
case WM_DESTROY:
- PostQuitMessage(0);
- break;
+ PostQuitMessage(0);
+ break;
default:
- return DefWindowProc(hWnd, msg, wParam, lParam);
+ return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
@@ -95,22 +95,22 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
static const TCHAR windowClassName[] = L"Minimal Server";
WNDCLASS wc;
- wc.style = CS_HREDRAW|CS_VREDRAW;
- wc.lpfnWndProc = (WNDPROC)WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(NULL, 0);
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
+ wc.style = CS_HREDRAW|CS_VREDRAW;
+ wc.lpfnWndProc = (WNDPROC)WndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = LoadIcon(NULL, 0);
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = windowClassName;
if(!RegisterClass(&wc))
{
- MessageBox(NULL, L"Window Registration Failed!", L"Error!",
- MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Registration Failed!", L"Error!",
+ MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
RECT rect;
@@ -118,20 +118,20 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
int width = rect.right - rect.left;
if(width > 320)
{
- width = 320;
+ width = 320;
}
int height = rect.bottom - rect.top;
if(height > 200)
{
- height = 200;
+ height = 200;
}
HWND mainWnd = CreateWindow(windowClassName, L"Minimal Server", WS_VISIBLE|WS_OVERLAPPED|WS_SYSMENU|WS_SIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, width, height,
- NULL, NULL, hInstance, NULL);
+ CW_USEDEFAULT, CW_USEDEFAULT, width, height,
+ NULL, NULL, hInstance, NULL);
if(mainWnd == NULL)
{
- MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
ShowWindow(mainWnd, SW_SHOW);
@@ -147,72 +147,73 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- //
- // Set a default value for Hello.Endpoints so that the demo
- // will run without a configuration file.
- //
- initData.properties->setProperty("Hello.Endpoints","tcp -p 10000");
-
- //
- // Now, load the configuration file if present. Under WinCE we
- // use "config.txt" since it can be edited with pocket word.
- //
- try
- {
- initData.properties->load("config.txt");
- }
- catch(const Ice::FileException&)
- {
- }
-
- communicator = Ice::initialize(__argc, __argv, initData);
-
- Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Hello");
- adapter->add(new HelloI(mainWnd), communicator->stringToIdentity("hello"));
- adapter->activate();
-
- //
- // Display a helpful message to the user.
- //
- ::SendMessage(editHwnd, EM_REPLACESEL,
- (WPARAM)FALSE, (LPARAM)L"Close the window to terminate the server.\r\n");
-
- //
- // Run the message pump.
- //
- MSG Msg;
- while(GetMessage(&Msg, NULL, 0, 0) > 0)
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
+ initData.properties = Ice::createProperties();
+ //
+ // Set a default value for Hello.Endpoints so that the demo
+ // will run without a configuration file.
+ //
+ initData.properties->setProperty("Hello.Endpoints","tcp -p 10000");
+
+ //
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
+ //
+ try
+ {
+ initData.properties->load("config.txt");
+ }
+ catch(const Ice::FileException&)
+ {
+ }
+
+ communicator = Ice::initialize(__argc, __argv, initData);
+
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Hello");
+ HelloPtr hello = new HelloI(mainWnd);
+ adapter->add(hello, communicator->stringToIdentity("hello"));
+ adapter->activate();
+
+ //
+ // Display a helpful message to the user.
+ //
+ ::SendMessage(editHwnd, EM_REPLACESEL,
+ (WPARAM)FALSE, (LPARAM)L"Close the window to terminate the server.\r\n");
+
+ //
+ // Run the message pump.
+ //
+ MSG Msg;
+ while(GetMessage(&Msg, NULL, 0, 0) > 0)
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
}
catch(const Ice::Exception& ex)
{
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
- status = EXIT_FAILURE;
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
-
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+
+ status = EXIT_FAILURE;
+ }
}
return status;
}
diff --git a/cppe/demo/IceE/throughput/Client.cpp b/cppe/demo/IceE/throughput/Client.cpp
index 00f2b168708..953a3f0dd2f 100644
--- a/cppe/demo/IceE/throughput/Client.cpp
+++ b/cppe/demo/IceE/throughput/Client.cpp
@@ -57,17 +57,18 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
std::string proxy = properties->getProperty(proxyProperty);
if(proxy.empty())
{
- fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: property `%s' not set\n", argv[0], proxyProperty);
+ return EXIT_FAILURE;
}
Ice::ObjectPrx base = communicator->stringToProxy(proxy);
ThroughputPrx throughput = ThroughputPrx::checkedCast(base);
if(!throughput)
{
- fprintf(stderr, "%s: invalid proxy\n", argv[0]);
- return EXIT_FAILURE;
+ fprintf(stderr, "%s: invalid proxy\n", argv[0]);
+ return EXIT_FAILURE;
}
+
ThroughputPrx throughputOneway = ThroughputPrx::uncheckedCast(throughput->ice_oneway());
ByteSeq byteSeq(ByteSeqSize / reduce, 0);
@@ -81,7 +82,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
for(i = 0; i < StringDoubleSeqSize / reduce; ++i)
{
structSeq[i].s = "hello";
- structSeq[i].d = 3.14;
+ structSeq[i].d = 3.14;
}
FixedSeq fixedSeq(FixedSeqSize / reduce);
@@ -92,9 +93,61 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
fixedSeq[i].d = 0;
}
- menu();
+ //
+ // To allow cross-language tests we may need to "warm up" the
+ // server. The warm up is to ensure that any JIT compiler will
+ // have converted any hotspots to native code. This ensures an
+ // accurate throughput measurement.
+ //
+ if(throughput->needsWarmup())
+ {
+ throughput->startWarmup();
+
+ ByteSeq emptyBytesBuf(1);
+ emptyBytesBuf.resize(1);
+ pair<const Ice::Byte*, const Ice::Byte*> emptyBytes;
+ emptyBytes.first = &emptyBytesBuf[0];
+ emptyBytes.second = emptyBytes.first + emptyBytesBuf.size();
+
+ StringSeq emptyStrings(1);
+ emptyStrings.resize(1);
+
+ StringDoubleSeq emptyStructs(1);
+ emptyStructs.resize(1);
+
+ FixedSeq emptyFixed(1);
+ emptyFixed.resize(1);
+
+ printf("warming up the server...");
+ fflush(stdout);
+ for(int i = 0; i < 10000; i++)
+ {
+ throughput->sendByteSeq(emptyBytes);
+ throughput->sendStringSeq(emptyStrings);
+ throughput->sendStructSeq(emptyStructs);
+ throughput->sendFixedSeq(emptyFixed);
+
+ throughput->recvByteSeq();
+ throughput->recvStringSeq();
+ throughput->recvStructSeq();
+ throughput->recvFixedSeq();
+
+ throughput->echoByteSeq(emptyBytesBuf);
+ throughput->echoStringSeq(emptyStrings);
+ throughput->echoStructSeq(emptyStructs);
+ throughput->echoFixedSeq(emptyFixed);
+ }
+
+ throughput->endWarmup();
- throughput->ice_ping(); // Initial ping to setup the connection.
+ printf(" ok\n");
+ }
+ else
+ {
+ throughput->ice_ping(); // Initial ping to setup the connection.
+ }
+
+ menu();
//
// By default use byte sequence.
@@ -105,300 +158,300 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
char c = EOF;
do
{
- try
- {
- printf("==> ");
- do
- {
- c = getchar();
- }
- while(c != EOF && c == '\n');
-
- IceUtil::Time tm = IceUtil::Time::now();
- const int repetitions = 1000;
-
- if(c == '1' || c == '2' || c == '3' || c == '4')
- {
- currentType = c;
- switch(c)
- {
- case '1':
- {
- printf("using byte sequences\n");
- seqSize = ByteSeqSize / reduce;
- break;
- }
-
- case '2':
- {
- printf("using string sequences\n");
- seqSize = StringSeqSize / reduce;
- break;
- }
-
- case '3':
- {
- printf("using variable-length struct sequences\n");
- seqSize = StringDoubleSeqSize / reduce;
- break;
- }
-
- case '4':
- {
- printf("using fixed-length struct sequences\n");
- seqSize = FixedSeqSize / reduce;
- break;
- }
- }
- }
- else if(c == 't' || c == 'o' || c == 'r' || c == 'e')
- {
- switch(c)
- {
- case 't':
- case 'o':
- {
- printf("sending");
- break;
- }
-
- case 'r':
- {
- printf("receiving");
- break;
- }
-
- case 'e':
- {
- printf("sending and receiving");
- break;
- }
- }
-
- printf(" %d", repetitions);
- switch(currentType)
- {
- case '1':
- {
- printf(" byte");
- break;
- }
-
- case '2':
- {
- printf(" string");
- break;
- }
-
- case '3':
- {
- printf(" variable-length struct");
- break;
- }
-
- case '4':
- {
- printf(" fixed-length struct");
- break;
- }
- }
- printf(" sequences of size %d", seqSize);
-
-
- if(c == 'o')
- {
- printf(" as oneway");
- }
-
- printf("...\n");
-
- for(int i = 0; i < repetitions; ++i)
- {
- switch(currentType)
- {
- case '1':
- {
- switch(c)
- {
- case 't':
- {
- throughput->sendByteSeq(byteArr);
- break;
- }
-
- case 'o':
- {
- throughputOneway->sendByteSeq(byteArr);
- break;
- }
-
- case 'r':
- {
- throughput->recvByteSeq();
- break;
- }
-
- case 'e':
- {
- throughput->echoByteSeq(byteSeq);
- break;
- }
- }
- break;
- }
-
- case '2':
- {
- switch(c)
- {
- case 't':
- {
- throughput->sendStringSeq(stringSeq);
- break;
- }
-
- case 'o':
- {
- throughputOneway->sendStringSeq(stringSeq);
- break;
- }
-
- case 'r':
- {
- throughput->recvStringSeq();
- break;
- }
-
- case 'e':
- {
- throughput->echoStringSeq(stringSeq);
- break;
- }
- }
- break;
- }
-
- case '3':
- {
- switch(c)
- {
- case 't':
- {
- throughput->sendStructSeq(structSeq);
- break;
- }
-
- case 'o':
- {
- throughputOneway->sendStructSeq(structSeq);
- break;
- }
-
- case 'r':
- {
- throughput->recvStructSeq();
- break;
- }
-
- case 'e':
- {
- throughput->echoStructSeq(structSeq);
- break;
- }
- }
- break;
- }
-
- case '4':
- {
- switch(c)
- {
- case 't':
- {
- throughput->sendFixedSeq(fixedSeq);
- break;
- }
-
- case 'o':
- {
- throughputOneway->sendFixedSeq(fixedSeq);
- break;
- }
-
- case 'r':
- {
- throughput->recvFixedSeq();
- break;
- }
-
- case 'e':
- {
- throughput->echoFixedSeq(fixedSeq);
- break;
- }
- }
- break;
- }
- }
- }
-
- tm = IceUtil::Time::now() - tm;
- printf("time for %d sequences: %lfms\n", repetitions, tm.toMilliSecondsDouble());
- printf("time per sequence: %lfms\n", tm.toMilliSecondsDouble() / repetitions);
- int wireSize = 0;
- switch(currentType)
- {
- case '1':
- {
- wireSize = 1;
- break;
- }
- case '2':
- {
- wireSize = static_cast<int>(stringSeq[0].size());
- break;
- }
- case '3':
- {
- wireSize = static_cast<int>(structSeq[0].s.size());
- wireSize += 8; // Size of double on the wire.
- break;
- }
- case '4':
- {
- wireSize = 16; // Size of two ints and a double on the wire.
- break;
- }
- }
- double mbit = repetitions * seqSize * wireSize * 8.0 / tm.toMicroSeconds();
- if(c == 'e')
- {
- mbit *= 2;
- }
- printf("throughput: %.2lfMbps\n", mbit);
- }
- else if(c == 's')
- {
- throughput->shutdown();
- }
- else if(c == 'x')
- {
- // Nothing to do
- }
- else if(c == '?')
- {
- menu();
- }
- else
- {
- printf("unknown command `%c'\n", c);
- menu();
- }
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- }
+ try
+ {
+ printf("==> ");
+ do
+ {
+ c = getchar();
+ }
+ while(c != EOF && c == '\n');
+
+ IceUtil::Time tm = IceUtil::Time::now();
+ const int repetitions = 1000;
+
+ if(c == '1' || c == '2' || c == '3' || c == '4')
+ {
+ currentType = c;
+ switch(c)
+ {
+ case '1':
+ {
+ printf("using byte sequences\n");
+ seqSize = ByteSeqSize / reduce;
+ break;
+ }
+
+ case '2':
+ {
+ printf("using string sequences\n");
+ seqSize = StringSeqSize / reduce;
+ break;
+ }
+
+ case '3':
+ {
+ printf("using variable-length struct sequences\n");
+ seqSize = StringDoubleSeqSize / reduce;
+ break;
+ }
+
+ case '4':
+ {
+ printf("using fixed-length struct sequences\n");
+ seqSize = FixedSeqSize / reduce;
+ break;
+ }
+ }
+ }
+ else if(c == 't' || c == 'o' || c == 'r' || c == 'e')
+ {
+ switch(c)
+ {
+ case 't':
+ case 'o':
+ {
+ printf("sending");
+ break;
+ }
+
+ case 'r':
+ {
+ printf("receiving");
+ break;
+ }
+
+ case 'e':
+ {
+ printf("sending and receiving");
+ break;
+ }
+ }
+
+ printf(" %d", repetitions);
+ switch(currentType)
+ {
+ case '1':
+ {
+ printf(" byte");
+ break;
+ }
+
+ case '2':
+ {
+ printf(" string");
+ break;
+ }
+
+ case '3':
+ {
+ printf(" variable-length struct");
+ break;
+ }
+
+ case '4':
+ {
+ printf(" fixed-length struct");
+ break;
+ }
+ }
+ printf(" sequences of size %d", seqSize);
+
+
+ if(c == 'o')
+ {
+ printf(" as oneway");
+ }
+
+ printf("...\n");
+
+ for(int i = 0; i < repetitions; ++i)
+ {
+ switch(currentType)
+ {
+ case '1':
+ {
+ switch(c)
+ {
+ case 't':
+ {
+ throughput->sendByteSeq(byteArr);
+ break;
+ }
+
+ case 'o':
+ {
+ throughputOneway->sendByteSeq(byteArr);
+ break;
+ }
+
+ case 'r':
+ {
+ throughput->recvByteSeq();
+ break;
+ }
+
+ case 'e':
+ {
+ throughput->echoByteSeq(byteSeq);
+ break;
+ }
+ }
+ break;
+ }
+
+ case '2':
+ {
+ switch(c)
+ {
+ case 't':
+ {
+ throughput->sendStringSeq(stringSeq);
+ break;
+ }
+
+ case 'o':
+ {
+ throughputOneway->sendStringSeq(stringSeq);
+ break;
+ }
+
+ case 'r':
+ {
+ throughput->recvStringSeq();
+ break;
+ }
+
+ case 'e':
+ {
+ throughput->echoStringSeq(stringSeq);
+ break;
+ }
+ }
+ break;
+ }
+
+ case '3':
+ {
+ switch(c)
+ {
+ case 't':
+ {
+ throughput->sendStructSeq(structSeq);
+ break;
+ }
+
+ case 'o':
+ {
+ throughputOneway->sendStructSeq(structSeq);
+ break;
+ }
+
+ case 'r':
+ {
+ throughput->recvStructSeq();
+ break;
+ }
+
+ case 'e':
+ {
+ throughput->echoStructSeq(structSeq);
+ break;
+ }
+ }
+ break;
+ }
+
+ case '4':
+ {
+ switch(c)
+ {
+ case 't':
+ {
+ throughput->sendFixedSeq(fixedSeq);
+ break;
+ }
+
+ case 'o':
+ {
+ throughputOneway->sendFixedSeq(fixedSeq);
+ break;
+ }
+
+ case 'r':
+ {
+ throughput->recvFixedSeq();
+ break;
+ }
+
+ case 'e':
+ {
+ throughput->echoFixedSeq(fixedSeq);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ tm = IceUtil::Time::now() - tm;
+ printf("time for %d sequences: %lfms\n", repetitions, tm.toMilliSecondsDouble());
+ printf("time per sequence: %lfms\n", tm.toMilliSecondsDouble() / repetitions);
+ int wireSize = 0;
+ switch(currentType)
+ {
+ case '1':
+ {
+ wireSize = 1;
+ break;
+ }
+ case '2':
+ {
+ wireSize = static_cast<int>(stringSeq[0].size());
+ break;
+ }
+ case '3':
+ {
+ wireSize = static_cast<int>(structSeq[0].s.size());
+ wireSize += 8; // Size of double on the wire.
+ break;
+ }
+ case '4':
+ {
+ wireSize = 16; // Size of two ints and a double on the wire.
+ break;
+ }
+ }
+ double mbit = repetitions * seqSize * wireSize * 8.0 / tm.toMicroSeconds();
+ if(c == 'e')
+ {
+ mbit *= 2;
+ }
+ printf("throughput: %.2lfMbps\n", mbit);
+ }
+ else if(c == 's')
+ {
+ throughput->shutdown();
+ }
+ else if(c == 'x')
+ {
+ // Nothing to do
+ }
+ else if(c == '?')
+ {
+ menu();
+ }
+ else
+ {
+ printf("unknown command `%c'\n", c);
+ menu();
+ }
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ }
}
while(c != EOF && c != 'x');
@@ -414,28 +467,28 @@ main(int argc, char* argv[])
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->load("config");
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ initData.properties = Ice::createProperties();
+ initData.properties->load("config.client");
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/throughput/Server.cpp b/cppe/demo/IceE/throughput/Server.cpp
index 2c22baf53b0..99790cc758b 100644
--- a/cppe/demo/IceE/throughput/Server.cpp
+++ b/cppe/demo/IceE/throughput/Server.cpp
@@ -22,14 +22,14 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
for(int i = 0; i < argc; ++i)
{
if(strcmp(argv[i], "--small") == 0)
- {
- reduce = 100;
- }
+ {
+ reduce = 100;
+ }
}
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Throughput");
- Ice::ObjectPtr object = new ThroughputI(reduce);
- adapter->add(object, communicator->stringToIdentity("throughput"));
+ Demo::ThroughputPtr servant = new ThroughputI(reduce);
+ adapter->add(servant, communicator->stringToIdentity("throughput"));
adapter->activate();
communicator->waitForShutdown();
return EXIT_SUCCESS;
@@ -44,29 +44,29 @@ main(int argc, char* argv[])
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->load("config");
- initData.properties->setProperty("Ice.Override.Timeout", "100");
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ initData.properties = Ice::createProperties();
+ initData.properties->load("config.server");
+ initData.properties->setProperty("Ice.Override.Timeout", "100");
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- fprintf(stderr, "%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/throughput/Throughput.ice b/cppe/demo/IceE/throughput/Throughput.ice
index 180b0fcea2b..c2aabb7fd04 100644
--- a/cppe/demo/IceE/throughput/Throughput.ice
+++ b/cppe/demo/IceE/throughput/Throughput.ice
@@ -38,6 +38,10 @@ const int FixedSeqSize = 50000;
interface Throughput
{
+ bool needsWarmup();
+ void startWarmup();
+ void endWarmup();
+
void sendByteSeq(["cpp:array"] ByteSeq seq);
ByteSeq recvByteSeq();
ByteSeq echoByteSeq(ByteSeq seq);
diff --git a/cppe/demo/IceE/throughput/ThroughputI.cpp b/cppe/demo/IceE/throughput/ThroughputI.cpp
index f2e8c6ba6b5..a51a30e8a4e 100644
--- a/cppe/demo/IceE/throughput/ThroughputI.cpp
+++ b/cppe/demo/IceE/throughput/ThroughputI.cpp
@@ -17,22 +17,42 @@ ThroughputI::ThroughputI(int reduce) :
_byteSeq(ByteSeqSize / reduce, 0),
_stringSeq(StringSeqSize / reduce, "hello"),
_structSeq(StringDoubleSeqSize / reduce),
- _fixedSeq(FixedSeqSize / reduce)
+ _fixedSeq(FixedSeqSize / reduce),
+ _warmup(false)
{
int i;
for(i = 0; i < StringDoubleSeqSize / reduce; ++i)
{
- _structSeq[i].s = "hello";
- _structSeq[i].d = 3.14;
+ _structSeq[i].s = "hello";
+ _structSeq[i].d = 3.14;
}
for(i = 0; i < FixedSeqSize / reduce; ++i)
{
- _fixedSeq[i].i = 0;
- _fixedSeq[i].j = 0;
- _fixedSeq[i].d = 0;
+ _fixedSeq[i].i = 0;
+ _fixedSeq[i].j = 0;
+ _fixedSeq[i].d = 0;
}
}
+bool
+ThroughputI::needsWarmup(const Ice::Current&)
+{
+ _warmup = false;
+ return false;
+}
+
+void
+ThroughputI::startWarmup(const Ice::Current&)
+{
+ _warmup = true;
+}
+
+void
+ThroughputI::endWarmup(const Ice::Current&)
+{
+ _warmup = false;
+}
+
void
ThroughputI::sendByteSeq(const pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&)
{
@@ -41,7 +61,14 @@ ThroughputI::sendByteSeq(const pair<const Ice::Byte*, const Ice::Byte*>&, const
ByteSeq
ThroughputI::recvByteSeq(const Ice::Current&)
{
- return _byteSeq;
+ if(_warmup)
+ {
+ return Demo::ByteSeq();
+ }
+ else
+ {
+ return _byteSeq;
+ }
}
ByteSeq
@@ -58,7 +85,14 @@ ThroughputI::sendStringSeq(const StringSeq&, const Ice::Current&)
StringSeq
ThroughputI::recvStringSeq(const Ice::Current&)
{
- return _stringSeq;
+ if(_warmup)
+ {
+ return Demo::StringSeq();
+ }
+ else
+ {
+ return _stringSeq;
+ }
}
StringSeq
@@ -75,7 +109,14 @@ ThroughputI::sendStructSeq(const StringDoubleSeq&, const Ice::Current&)
StringDoubleSeq
ThroughputI::recvStructSeq(const Ice::Current&)
{
- return _structSeq;
+ if(_warmup)
+ {
+ return Demo::StringDoubleSeq();
+ }
+ else
+ {
+ return _structSeq;
+ }
}
StringDoubleSeq
@@ -92,7 +133,14 @@ ThroughputI::sendFixedSeq(const FixedSeq&, const Ice::Current&)
FixedSeq
ThroughputI::recvFixedSeq(const Ice::Current&)
{
- return _fixedSeq;
+ if(_warmup)
+ {
+ return Demo::FixedSeq();
+ }
+ else
+ {
+ return _fixedSeq;
+ }
}
FixedSeq
diff --git a/cppe/demo/IceE/throughput/ThroughputI.h b/cppe/demo/IceE/throughput/ThroughputI.h
index f7192387dab..40bf1adea00 100644
--- a/cppe/demo/IceE/throughput/ThroughputI.h
+++ b/cppe/demo/IceE/throughput/ThroughputI.h
@@ -18,6 +18,9 @@ public:
ThroughputI(int);
+ virtual bool needsWarmup(const Ice::Current&);
+ virtual void startWarmup(const Ice::Current&);
+ virtual void endWarmup(const Ice::Current&);
virtual void sendByteSeq(const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&);
virtual Demo::ByteSeq recvByteSeq(const Ice::Current&);
virtual Demo::ByteSeq echoByteSeq(const Demo::ByteSeq&, const Ice::Current&);
@@ -38,6 +41,8 @@ private:
const Demo::StringSeq _stringSeq;
/*const*/ Demo::StringDoubleSeq _structSeq;
/*const*/ Demo::FixedSeq _fixedSeq;
+
+ bool _warmup;
};
#endif
diff --git a/cppe/demo/IceE/throughput/WinCEClient.cpp b/cppe/demo/IceE/throughput/WinCEClient.cpp
index dc15f3c6a4e..84ec30147d2 100644
--- a/cppe/demo/IceE/throughput/WinCEClient.cpp
+++ b/cppe/demo/IceE/throughput/WinCEClient.cpp
@@ -23,35 +23,35 @@ WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
- WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE,
- 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
- hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
- assert(editHwnd != NULL);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
+ WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE,
+ 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
+ hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
+ assert(editHwnd != NULL);
}
break;
case WM_SIZE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
}
break;
case WM_CLOSE:
- DestroyWindow(hWnd);
- break;
+ DestroyWindow(hWnd);
+ break;
case WM_DESTROY:
- wmDestroy = true;
- PostQuitMessage(0);
- break;
+ wmDestroy = true;
+ PostQuitMessage(0);
+ break;
default:
- return DefWindowProc(hWnd, msg, wParam, lParam);
+ return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
@@ -62,21 +62,21 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
static const TCHAR windowClassName[] = L"Throughput Client";
WNDCLASS wc;
- wc.style = CS_HREDRAW|CS_VREDRAW;
- wc.lpfnWndProc = (WNDPROC)WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(NULL, 0);
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
+ wc.style = CS_HREDRAW|CS_VREDRAW;
+ wc.lpfnWndProc = (WNDPROC)WndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = LoadIcon(NULL, 0);
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = windowClassName;
if(!RegisterClass(&wc))
{
- MessageBox(NULL, L"Window Registration Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Registration Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
RECT rect;
@@ -84,20 +84,20 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
int width = rect.right - rect.left;
if(width > 320)
{
- width = 320;
+ width = 320;
}
int height = rect.bottom - rect.top;
if(height > 200)
{
- height = 200;
+ height = 200;
}
HWND mainWnd = CreateWindow(windowClassName, L"Throughput Client", WS_VISIBLE|WS_OVERLAPPED|WS_SYSMENU|WS_SIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, width, height,
- NULL, NULL, hInstance, NULL);
+ CW_USEDEFAULT, CW_USEDEFAULT, width, height,
+ NULL, NULL, hInstance, NULL);
if(mainWnd == NULL)
{
- MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
ShowWindow(mainWnd, SW_SHOW);
@@ -108,134 +108,134 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
-
- //
- // Set a default value for Throughput.Proxy so that the demo will
- // run without a configuration file.
- //
- initData.properties->setProperty("Throughput.Proxy", "throughput:tcp -p 10000");
-
- //
- // Now, load the configuration file if present. Under WinCE we
- // use "config.txt" since it can be edited with pocket word.
- //
- try
- {
- initData.properties->load("config.txt");
- }
- catch(const Ice::FileException&)
- {
- }
-
- communicator = Ice::initialize(__argc, __argv, initData);
-
- const char* proxyProperty = "Throughput.Proxy";
- string proxy = initData.properties->getProperty(proxyProperty);
-
- ThroughputPrx throughput = ThroughputPrx::checkedCast(communicator->stringToProxy(proxy));
- if(!throughput)
- {
- MessageBox(NULL, L"invalid proxy", L"Throughput Client", MB_ICONEXCLAMATION | MB_OK);
- return EXIT_FAILURE;
- }
- ThroughputPrx throughputOneway = ThroughputPrx::uncheckedCast(throughput->ice_oneway());
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties();
+
+ //
+ // Set a default value for Throughput.Proxy so that the demo will
+ // run without a configuration file.
+ //
+ initData.properties->setProperty("Throughput.Proxy", "throughput:tcp -p 10000");
+
+ //
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
+ //
+ try
+ {
+ initData.properties->load("config.txt");
+ }
+ catch(const Ice::FileException&)
+ {
+ }
+
+ communicator = Ice::initialize(__argc, __argv, initData);
+
+ const char* proxyProperty = "Throughput.Proxy";
+ string proxy = initData.properties->getProperty(proxyProperty);
+
+ ThroughputPrx throughput = ThroughputPrx::checkedCast(communicator->stringToProxy(proxy));
+ if(!throughput)
+ {
+ MessageBox(NULL, L"invalid proxy", L"Throughput Client", MB_ICONEXCLAMATION | MB_OK);
+ return EXIT_FAILURE;
+ }
+ ThroughputPrx throughputOneway = ThroughputPrx::uncheckedCast(throughput->ice_oneway());
//
// The amount by which we reduce buffer sizes for CE runs
//
const int reduce = 100;
- //
- // Initialize data structures
- //
- ByteSeq byteSeq(ByteSeqSize / reduce, 0);
- pair<const Ice::Byte*, const Ice::Byte*> byteArr;
- byteArr.first = &byteSeq[0];
- byteArr.second = byteArr.first + byteSeq.size();
-
- StringSeq stringSeq(StringSeqSize / reduce, "hello");
-
- StringDoubleSeq structSeq(StringDoubleSeqSize / reduce);
- int i;
- for(i = 0; i < StringDoubleSeqSize / reduce; ++i)
- {
- structSeq[i].s = "hello";
- structSeq[i].d = 3.14;
- }
-
- FixedSeq fixedSeq(FixedSeqSize / reduce);
- for(i = 0; i < FixedSeqSize / reduce; ++i)
- {
- fixedSeq[i].i = 0;
- fixedSeq[i].j = 0;
- fixedSeq[i].d = 0;
- }
-
- const int repetitions = 1000;
-
- // Initial ping to setup the connection.
- throughput->ice_ping();
-
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE,
- (LPARAM)L"Running throughput tests (this may take a while)\r\n");
-
- for(int type = 0; type < 4; ++type)
- {
- wchar_t* data;
- int seqSize;
- if(type == 0)
- {
- data = L"byte";
- seqSize = ByteSeqSize / reduce;
- }
- else if(type == 1)
- {
- data = L"string";
- seqSize = StringSeqSize / reduce;
- }
- else if(type == 2)
- {
- data = L"variable-length struct";
- seqSize = StringDoubleSeqSize / reduce;
- }
- else if(type == 3)
- {
- data = L"fixed-length struct";
- seqSize = FixedSeqSize / reduce;
- }
-
- for(int mode = 0; mode < 4; ++mode)
- {
- wchar_t* action;
- wchar_t* qualifier = L"";
- if(mode == 0)
- {
- action = L"sending";
- }
- else if(mode == 1)
- {
- action = L"sending";
- qualifier = L" as oneway";
- }
- else if(mode == 2)
- {
- action = L"receiving";
- }
- else if(mode == 3)
- {
- action = L"sending and receiving";
- }
-
- wchar_t buf[1000];
- wsprintf(buf, L"\r\n%s %d %s sequences of size %d%s\r\n", action, repetitions, data, seqSize,
- qualifier);
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
-
- IceUtil::Time tm = IceUtil::Time::now();
- for(i = 0; i < repetitions; ++i)
- {
+ //
+ // Initialize data structures
+ //
+ ByteSeq byteSeq(ByteSeqSize / reduce, 0);
+ pair<const Ice::Byte*, const Ice::Byte*> byteArr;
+ byteArr.first = &byteSeq[0];
+ byteArr.second = byteArr.first + byteSeq.size();
+
+ StringSeq stringSeq(StringSeqSize / reduce, "hello");
+
+ StringDoubleSeq structSeq(StringDoubleSeqSize / reduce);
+ int i;
+ for(i = 0; i < StringDoubleSeqSize / reduce; ++i)
+ {
+ structSeq[i].s = "hello";
+ structSeq[i].d = 3.14;
+ }
+
+ FixedSeq fixedSeq(FixedSeqSize / reduce);
+ for(i = 0; i < FixedSeqSize / reduce; ++i)
+ {
+ fixedSeq[i].i = 0;
+ fixedSeq[i].j = 0;
+ fixedSeq[i].d = 0;
+ }
+
+ const int repetitions = 1000;
+
+ // Initial ping to setup the connection.
+ throughput->ice_ping();
+
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE,
+ (LPARAM)L"Running throughput tests (this may take a while)\r\n");
+
+ for(int type = 0; type < 4; ++type)
+ {
+ wchar_t* data;
+ int seqSize;
+ if(type == 0)
+ {
+ data = L"byte";
+ seqSize = ByteSeqSize / reduce;
+ }
+ else if(type == 1)
+ {
+ data = L"string";
+ seqSize = StringSeqSize / reduce;
+ }
+ else if(type == 2)
+ {
+ data = L"variable-length struct";
+ seqSize = StringDoubleSeqSize / reduce;
+ }
+ else if(type == 3)
+ {
+ data = L"fixed-length struct";
+ seqSize = FixedSeqSize / reduce;
+ }
+
+ for(int mode = 0; mode < 4; ++mode)
+ {
+ wchar_t* action;
+ wchar_t* qualifier = L"";
+ if(mode == 0)
+ {
+ action = L"sending";
+ }
+ else if(mode == 1)
+ {
+ action = L"sending";
+ qualifier = L" as oneway";
+ }
+ else if(mode == 2)
+ {
+ action = L"receiving";
+ }
+ else if(mode == 3)
+ {
+ action = L"sending and receiving";
+ }
+
+ wchar_t buf[1000];
+ wsprintf(buf, L"\r\n%s %d %s sequences of size %d%s\r\n", action, repetitions, data, seqSize,
+ qualifier);
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
+
+ IceUtil::Time tm = IceUtil::Time::now();
+ for(i = 0; i < repetitions; ++i)
+ {
switch(type)
{
case 0:
@@ -361,31 +361,31 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
}
break;
}
- }
-
- if((i % 100) == 0)
- {
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)L".");
- //
- // Run the message pump just in case the user tries to close the app.
- //
- MSG Msg;
- while(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
- if(wmDestroy)
- {
- break;
- }
- }
- }
- tm = IceUtil::Time::now() - tm;
-
- wsprintf(buf, L"\r\ntime for %d sequences: %.04fms\r\ntime per sequence: %.04fms\r\n",
- repetitions, tm.toMilliSecondsDouble(), tm.toMilliSecondsDouble() / repetitions);
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
+ }
+
+ if((i % 100) == 0)
+ {
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)L".");
+ //
+ // Run the message pump just in case the user tries to close the app.
+ //
+ MSG Msg;
+ while(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
+ if(wmDestroy)
+ {
+ break;
+ }
+ }
+ }
+ tm = IceUtil::Time::now() - tm;
+
+ wsprintf(buf, L"\r\ntime for %d sequences: %.04fms\r\ntime per sequence: %.04fms\r\n",
+ repetitions, tm.toMilliSecondsDouble(), tm.toMilliSecondsDouble() / repetitions);
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
int wireSize = 0;
switch(type)
@@ -417,22 +417,22 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
{
mbit *= 2;
}
- wsprintf(buf, L"throughput: %.04f MBit/s\r\n", mbit);
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
- }
- }
-
- ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)L"\r\nThroughput tests completed\r\n");
+ wsprintf(buf, L"throughput: %.04f MBit/s\r\n", mbit);
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)buf);
+ }
+ }
+
+ ::SendMessage(editHwnd, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)L"\r\nThroughput tests completed\r\n");
}
catch(const Ice::Exception& ex)
{
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
- status = EXIT_FAILURE;
+ status = EXIT_FAILURE;
}
//
@@ -441,25 +441,25 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
MSG Msg;
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
-
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(NULL, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+
+ status = EXIT_FAILURE;
+ }
}
return status;
diff --git a/cppe/demo/IceE/throughput/WinCEServer.cpp b/cppe/demo/IceE/throughput/WinCEServer.cpp
index b80eacc7fe5..a8d8c4a5b11 100644
--- a/cppe/demo/IceE/throughput/WinCEServer.cpp
+++ b/cppe/demo/IceE/throughput/WinCEServer.cpp
@@ -22,34 +22,34 @@ WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
- WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE,
- 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
- hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
- assert(editHwnd != NULL);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ editHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
+ WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE,
+ 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
+ hWnd, (HMENU)101, GetModuleHandle(NULL), NULL);
+ assert(editHwnd != NULL);
}
break;
case WM_SIZE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ SetWindowPos(editHwnd, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
}
break;
case WM_CLOSE:
- DestroyWindow(hWnd);
- break;
+ DestroyWindow(hWnd);
+ break;
case WM_DESTROY:
- PostQuitMessage(0);
- break;
+ PostQuitMessage(0);
+ break;
default:
- return DefWindowProc(hWnd, msg, wParam, lParam);
+ return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
@@ -60,22 +60,22 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
static const TCHAR windowClassName[] = L"Throughput Server";
WNDCLASS wc;
- wc.style = CS_HREDRAW|CS_VREDRAW;
- wc.lpfnWndProc = (WNDPROC)WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(NULL, 0);
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
+ wc.style = CS_HREDRAW|CS_VREDRAW;
+ wc.lpfnWndProc = (WNDPROC)WndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = LoadIcon(NULL, 0);
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = windowClassName;
if(!RegisterClass(&wc))
{
- MessageBox(NULL, L"Window Registration Failed!", L"Error!",
- MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Registration Failed!", L"Error!",
+ MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
RECT rect;
@@ -83,20 +83,20 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
int width = rect.right - rect.left;
if(width > 320)
{
- width = 320;
+ width = 320;
}
int height = rect.bottom - rect.top;
if(height > 200)
{
- height = 200;
+ height = 200;
}
HWND mainWnd = CreateWindow(windowClassName, L"Throughput Server", WS_VISIBLE|WS_OVERLAPPED|WS_SYSMENU|WS_SIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, width, height,
- NULL, NULL, hInstance, NULL);
+ CW_USEDEFAULT, CW_USEDEFAULT, width, height,
+ NULL, NULL, hInstance, NULL);
if(mainWnd == NULL)
{
- MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
ShowWindow(mainWnd, SW_SHOW);
@@ -112,74 +112,74 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
try
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
-
- //
- // Set a default value for Latency.Endpoints so that the demo
- // will run without a configuration file.
- //
- initData.properties->setProperty("Throughput.Endpoints","tcp -p 10000");
-
- //
- // Now, load the configuration file if present. Under WinCE we
- // use "config.txt" since it can be edited with pocket word.
- //
- try
- {
- initData.properties->load("config.txt");
- }
- catch(const Ice::FileException&)
- {
- }
-
- communicator = Ice::initialize(__argc, __argv, initData);
-
- Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Throughput");
- Ice::ObjectPtr object = new ThroughputI(100);
- adapter->add(object, communicator->stringToIdentity("throughput"));
- adapter->activate();
-
- //
- // Display a helpful message to the user.
- //
- ::SendMessage(editHwnd, EM_REPLACESEL,
- (WPARAM)FALSE, (LPARAM)L"Close the window to terminate the server.\r\n");
-
- //
- // Run the message pump.
- //
- MSG Msg;
- while(GetMessage(&Msg, NULL, 0, 0) > 0)
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
+ initData.properties = Ice::createProperties();
+
+ //
+ // Set a default value for Latency.Endpoints so that the demo
+ // will run without a configuration file.
+ //
+ initData.properties->setProperty("Throughput.Endpoints","tcp -p 10000");
+
+ //
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
+ //
+ try
+ {
+ initData.properties->load("config.txt");
+ }
+ catch(const Ice::FileException&)
+ {
+ }
+
+ communicator = Ice::initialize(__argc, __argv, initData);
+
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Throughput");
+ Demo::ThroughputPtr servant = new ThroughputI(100);
+ adapter->add(servant, communicator->stringToIdentity("throughput"));
+ adapter->activate();
+
+ //
+ // Display a helpful message to the user.
+ //
+ ::SendMessage(editHwnd, EM_REPLACESEL,
+ (WPARAM)FALSE, (LPARAM)L"Close the window to terminate the server.\r\n");
+
+ //
+ // Run the message pump.
+ //
+ MSG Msg;
+ while(GetMessage(&Msg, NULL, 0, 0) > 0)
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
}
catch(const Ice::Exception& ex)
{
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
- status = EXIT_FAILURE;
+ status = EXIT_FAILURE;
}
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- TCHAR wtext[1024];
- string err = ex.toString();
- mbstowcs(wtext, err.c_str(), err.size());
- MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
-
- status = EXIT_FAILURE;
- }
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ TCHAR wtext[1024];
+ string err = ex.toString();
+ mbstowcs(wtext, err.c_str(), err.size());
+ MessageBox(mainWnd, wtext, L"Error", MB_ICONEXCLAMATION | MB_OK);
+
+ status = EXIT_FAILURE;
+ }
}
return status;
}
diff --git a/cppe/demo/IceE/throughput/config b/cppe/demo/IceE/throughput/config
deleted file mode 100644
index cdc6b93326a..00000000000
--- a/cppe/demo/IceE/throughput/config
+++ /dev/null
@@ -1,7 +0,0 @@
-Throughput.Proxy=throughput:default -p 10000 -h 127.0.0.1
-Throughput.Endpoints=default -p 10000 -h 127.0.0.1
-
-#
-# Use faster blocking client side model by default.
-#
-Ice.Blocking=1
diff --git a/cppe/demo/IceE/throughput/config.client b/cppe/demo/IceE/throughput/config.client
new file mode 100644
index 00000000000..02ef8276f6c
--- /dev/null
+++ b/cppe/demo/IceE/throughput/config.client
@@ -0,0 +1,5 @@
+#
+# The client reads this property to create the reference to the
+# "Throughput" object in the server.
+#
+Throughput.Proxy=throughput:default -p 10000 -h 127.0.0.1
diff --git a/cppe/demo/IceE/throughput/config.server b/cppe/demo/IceE/throughput/config.server
new file mode 100644
index 00000000000..1a301bb3ed6
--- /dev/null
+++ b/cppe/demo/IceE/throughput/config.server
@@ -0,0 +1,11 @@
+#
+# The server creates one single object adapter with the name
+# "Throughput". The following line sets the endpoints for this
+# adapter.
+#
+Throughput.Endpoints=default -p 10000 -h 127.0.0.1
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
diff --git a/cppe/demo/IceE/workqueue/WorkQueue.cpp b/cppe/demo/IceE/workqueue/WorkQueue.cpp
index 0a209127e08..1bf33a30efe 100644
--- a/cppe/demo/IceE/workqueue/WorkQueue.cpp
+++ b/cppe/demo/IceE/workqueue/WorkQueue.cpp
@@ -24,28 +24,28 @@ public:
virtual void
run()
{
- while(1)
- {
- string item = nextItem();
- if(item == "destroy")
- {
- break;
- }
+ while(1)
+ {
+ string item = nextItem();
+ if(item == "destroy")
+ {
+ break;
+ }
- printf("work item: %s\n", item.c_str());
- IceUtil::ThreadControl::sleep(IceUtil::Time::seconds(1));
- }
+ printf("work item: %s\n", item.c_str());
+ IceUtil::ThreadControl::sleep(IceUtil::Time::seconds(1));
+ }
}
void
add(const string& item)
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_monitor);
- if(_queue.empty())
- {
- _monitor.notify();
- }
- _queue.push_back(item);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_monitor);
+ if(_queue.empty())
+ {
+ _monitor.notify();
+ }
+ _queue.push_back(item);
}
private:
@@ -53,15 +53,15 @@ private:
string
nextItem()
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_monitor);
- while(_queue.empty())
- {
- _monitor.wait();
- }
-
- string item = _queue.front();
- _queue.pop_front();
- return item;
+ IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_monitor);
+ while(_queue.empty())
+ {
+ _monitor.wait();
+ }
+
+ string item = _queue.front();
+ _queue.pop_front();
+ return item;
}
@@ -76,29 +76,29 @@ main()
{
try
{
- WorkQueuePtr h = new WorkQueue();
- IceUtil::ThreadControl control = h->start();
- printf("Pushing work items");
- printf("."); fflush(stdout);
- h->add("item1");
- printf("."); fflush(stdout);
- h->add("item2");
- printf("."); fflush(stdout);
- h->add("item3");
- printf("."); fflush(stdout);
- h->add("item4");
- printf("."); fflush(stdout);
- h->add("item5");
- printf("."); fflush(stdout);
- h->add("destroy");
- printf(" ok\n");
- printf("Waiting for WorkQueue to terminate\n");
- control.join();
+ WorkQueuePtr h = new WorkQueue();
+ IceUtil::ThreadControl control = h->start();
+ printf("Pushing work items");
+ printf("."); fflush(stdout);
+ h->add("item1");
+ printf("."); fflush(stdout);
+ h->add("item2");
+ printf("."); fflush(stdout);
+ h->add("item3");
+ printf("."); fflush(stdout);
+ h->add("item4");
+ printf("."); fflush(stdout);
+ h->add("item5");
+ printf("."); fflush(stdout);
+ h->add("destroy");
+ printf(" ok\n");
+ printf("Waiting for WorkQueue to terminate\n");
+ control.join();
}
catch(const IceUtil::Exception& ex)
{
- fprintf(stderr, "%s\n", ex.toString().c_str());
- return EXIT_FAILURE;
+ fprintf(stderr, "%s\n", ex.toString().c_str());
+ return EXIT_FAILURE;
}
return EXIT_SUCCESS;
diff --git a/cppe/include/IceE/AbstractMutex.h b/cppe/include/IceE/AbstractMutex.h
index e19a14178d6..77f54bed9df 100644
--- a/cppe/include/IceE/AbstractMutex.h
+++ b/cppe/include/IceE/AbstractMutex.h
@@ -38,17 +38,17 @@ public:
virtual void lock() const
{
- T::lock();
+ T::lock();
}
virtual void unlock() const
{
- T::unlock();
+ T::unlock();
}
virtual bool tryLock() const
{
- return T::tryLock();
+ return T::tryLock();
}
virtual ~AbstractMutexI()
@@ -65,17 +65,17 @@ public:
virtual void lock() const
{
- T::readLock();
+ T::readLock();
}
virtual void unlock() const
{
- T::unlock();
+ T::unlock();
}
virtual bool tryLock() const
{
- return T::tryReadLock();
+ return T::tryReadLock();
}
virtual ~AbstractMutexReadI()
@@ -92,17 +92,17 @@ public:
virtual void lock() const
{
- T::writeLock();
+ T::writeLock();
}
virtual void unlock() const
{
- T::unlock();
+ T::unlock();
}
virtual bool tryLock() const
{
- return T::tryWriteLock();
+ return T::tryWriteLock();
}
virtual ~AbstractMutexWriteI()
diff --git a/cppe/include/IceE/BasicStream.h b/cppe/include/IceE/BasicStream.h
index 2bc6cc488c1..a39c96aedf1 100644
--- a/cppe/include/IceE/BasicStream.h
+++ b/cppe/include/IceE/BasicStream.h
@@ -87,31 +87,31 @@ public:
const Ice::StringConverterPtr& stringConverter, const Ice::WstringConverterPtr& wstringConverter,
#endif
bool unlimited = false) :
- Buffer(messageSizeMax),
- _instance(instance),
- _currentReadEncaps(0),
- _currentWriteEncaps(0),
- _messageSizeMax(messageSizeMax),
+ Buffer(messageSizeMax),
+ _instance(instance),
+ _currentReadEncaps(0),
+ _currentWriteEncaps(0),
+ _messageSizeMax(messageSizeMax),
_unlimited(unlimited),
#ifdef ICEE_HAS_WSTRING
_stringConverter(stringConverter),
_wstringConverter(wstringConverter),
#endif
- _seqDataStack(0)
+ _seqDataStack(0)
{
- // Inlined for performance reasons.
+ // Inlined for performance reasons.
}
~BasicStream()
{
- // Inlined for performance reasons.
-
- if(_currentReadEncaps != &_preAllocatedReadEncaps ||
- _currentWriteEncaps != &_preAllocatedWriteEncaps ||
- _seqDataStack)
- {
- clear(); // Not inlined.
- }
+ // Inlined for performance reasons.
+
+ if(_currentReadEncaps != &_preAllocatedReadEncaps ||
+ _currentWriteEncaps != &_preAllocatedWriteEncaps ||
+ _seqDataStack)
+ {
+ clear(); // Not inlined.
+ }
}
ICE_API void clear();
@@ -126,168 +126,168 @@ public:
void resize(Container::size_type sz)
{
- if(!_unlimited && sz > _messageSizeMax)
- {
- Ice::throwMemoryLimitException(__FILE__, __LINE__);
- }
-
- b.resize(sz);
+ if(!_unlimited && sz > _messageSizeMax)
+ {
+ Ice::throwMemoryLimitException(__FILE__, __LINE__);
+ }
+
+ b.resize(sz);
}
void reset() // Inlined for performance reasons.
{
b.reset();
- i = b.begin();
+ i = b.begin();
}
ICE_API void startSeq(int, int);
void checkSeq()
{
- checkSeq(static_cast<int>(b.end() - i));
+ checkSeq(static_cast<int>(b.end() - i));
}
void checkSeq(int bytesLeft)
{
- //
- // Check, given the number of elements requested for this sequence,
- // that this sequence, plus the sum of the sizes of the remaining
- // number of elements of all enclosing sequences, would still fit
- // within the message.
- //
- int size = 0;
- SeqData* sd = _seqDataStack;
- do
- {
- size += (sd->numElements - 1) * sd->minSize;
- sd = sd->previous;
- }
- while(sd);
-
- if(size > bytesLeft)
- {
- Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
+ //
+ // Check, given the number of elements requested for this sequence,
+ // that this sequence, plus the sum of the sizes of the remaining
+ // number of elements of all enclosing sequences, would still fit
+ // within the message.
+ //
+ int size = 0;
+ SeqData* sd = _seqDataStack;
+ do
+ {
+ size += (sd->numElements - 1) * sd->minSize;
+ sd = sd->previous;
+ }
+ while(sd);
+
+ if(size > bytesLeft)
+ {
+ Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
}
ICE_API void checkFixedSeq(int, int); // For sequences of fixed-size types.
void endElement()
{
- assert(_seqDataStack);
- --_seqDataStack->numElements;
+ assert(_seqDataStack);
+ --_seqDataStack->numElements;
}
ICE_API void endSeq(int);
void startWriteEncaps()
{
- WriteEncaps* oldEncaps = _currentWriteEncaps;
- if(!oldEncaps) // First allocated encaps?
- {
- _currentWriteEncaps = &_preAllocatedWriteEncaps;
- }
- else
- {
- _currentWriteEncaps = new WriteEncaps();
- _currentWriteEncaps->previous = oldEncaps;
- }
- _currentWriteEncaps->start = b.size();
-
- write(Ice::Int(0)); // Placeholder for the encapsulation length.
- write(encodingMajor);
- write(encodingMinor);
+ WriteEncaps* oldEncaps = _currentWriteEncaps;
+ if(!oldEncaps) // First allocated encaps?
+ {
+ _currentWriteEncaps = &_preAllocatedWriteEncaps;
+ }
+ else
+ {
+ _currentWriteEncaps = new WriteEncaps();
+ _currentWriteEncaps->previous = oldEncaps;
+ }
+ _currentWriteEncaps->start = b.size();
+
+ write(Ice::Int(0)); // Placeholder for the encapsulation length.
+ write(encodingMajor);
+ write(encodingMinor);
}
void endWriteEncaps()
{
- assert(_currentWriteEncaps);
- Container::size_type start = _currentWriteEncaps->start;
- Ice::Int sz = static_cast<Ice::Int>(b.size() - start); // Size includes size and version.
- Ice::Byte* dest = &(*(b.begin() + start));
+ assert(_currentWriteEncaps);
+ Container::size_type start = _currentWriteEncaps->start;
+ Ice::Int sz = static_cast<Ice::Int>(b.size() - start); // Size includes size and version.
+ Ice::Byte* dest = &(*(b.begin() + start));
#ifdef ICE_BIG_ENDIAN
- const Ice::Byte* src = reinterpret_cast<const Ice::Byte*>(&sz) + sizeof(Ice::Int) - 1;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest = *src;
+ const Ice::Byte* src = reinterpret_cast<const Ice::Byte*>(&sz) + sizeof(Ice::Int) - 1;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest = *src;
#else
- const Ice::Byte* src = reinterpret_cast<const Ice::Byte*>(&sz);
- *dest++ = *src++;
- *dest++ = *src++;
- *dest++ = *src++;
- *dest = *src;
+ const Ice::Byte* src = reinterpret_cast<const Ice::Byte*>(&sz);
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest = *src;
#endif
- WriteEncaps* oldEncaps = _currentWriteEncaps;
- _currentWriteEncaps = _currentWriteEncaps->previous;
- if(oldEncaps == &_preAllocatedWriteEncaps)
- {
- oldEncaps->reset();
- }
- else
- {
- delete oldEncaps;
- }
+ WriteEncaps* oldEncaps = _currentWriteEncaps;
+ _currentWriteEncaps = _currentWriteEncaps->previous;
+ if(oldEncaps == &_preAllocatedWriteEncaps)
+ {
+ oldEncaps->reset();
+ }
+ else
+ {
+ delete oldEncaps;
+ }
}
void startReadEncaps()
{
- ReadEncaps* oldEncaps = _currentReadEncaps;
- if(!oldEncaps) // First allocated encaps?
- {
- _currentReadEncaps = &_preAllocatedReadEncaps;
- }
- else
- {
- _currentReadEncaps = new ReadEncaps();
- _currentReadEncaps->previous = oldEncaps;
- }
- _currentReadEncaps->start = i - b.begin();
-
- //
- // I don't use readSize() and writeSize() for encapsulations,
- // because when creating an encapsulation, I must know in advance
- // how many bytes the size information will require in the data
- // stream. If I use an Int, it is always 4 bytes. For
- // readSize()/writeSize(), it could be 1 or 5 bytes.
- //
- Ice::Int sz;
- read(sz);
- if(sz < 0)
- {
- Ice::throwNegativeSizeException(__FILE__, __LINE__);
- }
- if(i - sizeof(Ice::Int) + sz > b.end())
- {
- Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
- _currentReadEncaps->sz = sz;
-
- Ice::Byte eMajor;
- Ice::Byte eMinor;
- read(eMajor);
- read(eMinor);
- if(eMajor != encodingMajor
- || static_cast<unsigned char>(eMinor) > static_cast<unsigned char>(encodingMinor))
- {
- Ice::throwUnsupportedEncodingException(__FILE__, __LINE__, eMajor, eMinor, encodingMajor, encodingMinor);
- }
- _currentReadEncaps->encodingMajor = eMajor;
- _currentReadEncaps->encodingMinor = eMinor;
+ ReadEncaps* oldEncaps = _currentReadEncaps;
+ if(!oldEncaps) // First allocated encaps?
+ {
+ _currentReadEncaps = &_preAllocatedReadEncaps;
+ }
+ else
+ {
+ _currentReadEncaps = new ReadEncaps();
+ _currentReadEncaps->previous = oldEncaps;
+ }
+ _currentReadEncaps->start = i - b.begin();
+
+ //
+ // I don't use readSize() and writeSize() for encapsulations,
+ // because when creating an encapsulation, I must know in advance
+ // how many bytes the size information will require in the data
+ // stream. If I use an Int, it is always 4 bytes. For
+ // readSize()/writeSize(), it could be 1 or 5 bytes.
+ //
+ Ice::Int sz;
+ read(sz);
+ if(sz < 0)
+ {
+ Ice::throwNegativeSizeException(__FILE__, __LINE__);
+ }
+ if(i - sizeof(Ice::Int) + sz > b.end())
+ {
+ Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+ _currentReadEncaps->sz = sz;
+
+ Ice::Byte eMajor;
+ Ice::Byte eMinor;
+ read(eMajor);
+ read(eMinor);
+ if(eMajor != encodingMajor
+ || static_cast<unsigned char>(eMinor) > static_cast<unsigned char>(encodingMinor))
+ {
+ Ice::throwUnsupportedEncodingException(__FILE__, __LINE__, eMajor, eMinor, encodingMajor, encodingMinor);
+ }
+ _currentReadEncaps->encodingMajor = eMajor;
+ _currentReadEncaps->encodingMinor = eMinor;
}
void endReadEncaps()
{
- assert(_currentReadEncaps);
- Container::size_type start = _currentReadEncaps->start;
- Ice::Int sz = _currentReadEncaps->sz;
- i = b.begin() + start + sz;
-
- ReadEncaps* oldEncaps = _currentReadEncaps;
- _currentReadEncaps = _currentReadEncaps->previous;
- if(oldEncaps == &_preAllocatedReadEncaps)
- {
- oldEncaps->reset();
- }
- else
- {
- delete oldEncaps;
- }
+ assert(_currentReadEncaps);
+ Container::size_type start = _currentReadEncaps->start;
+ Ice::Int sz = _currentReadEncaps->sz;
+ i = b.begin() + start + sz;
+
+ ReadEncaps* oldEncaps = _currentReadEncaps;
+ _currentReadEncaps = _currentReadEncaps->previous;
+ if(oldEncaps == &_preAllocatedReadEncaps)
+ {
+ oldEncaps->reset();
+ }
+ else
+ {
+ delete oldEncaps;
+ }
}
ICE_API Ice::Int getReadEncapsSize();
ICE_API void skipEncaps();
@@ -301,16 +301,16 @@ public:
void writeSize(Ice::Int v) // Inlined for performance reasons.
{
- assert(v >= 0);
- if(v > 254)
- {
- write(Ice::Byte(255));
- write(v);
- }
- else
- {
- write(static_cast<Ice::Byte>(v));
- }
+ assert(v >= 0);
+ if(v > 254)
+ {
+ write(Ice::Byte(255));
+ write(v);
+ }
+ else
+ {
+ write(static_cast<Ice::Byte>(v));
+ }
}
void rewriteSize(Ice::Int v, Container::iterator dest)
@@ -342,21 +342,21 @@ public:
void
readSize(Ice::Int& v) // Inlined for performance reasons.
{
- Ice::Byte byte;
- read(byte);
- unsigned val = static_cast<unsigned char>(byte);
- if(val == 255)
- {
- read(v);
- if(v < 0)
- {
- Ice::throwNegativeSizeException(__FILE__, __LINE__);
- }
- }
- else
- {
- v = static_cast<Ice::Int>(static_cast<unsigned char>(byte));
- }
+ Ice::Byte byte;
+ read(byte);
+ unsigned val = static_cast<unsigned char>(byte);
+ if(val == 255)
+ {
+ read(v);
+ if(v < 0)
+ {
+ Ice::throwNegativeSizeException(__FILE__, __LINE__);
+ }
+ }
+ else
+ {
+ v = static_cast<Ice::Int>(static_cast<unsigned char>(byte));
+ }
}
ICE_API void writeBlob(const std::vector<Ice::Byte>&);
@@ -364,42 +364,42 @@ public:
void writeBlob(const Ice::Byte* v, Container::size_type sz)
{
- if(sz > 0)
- {
- Container::size_type pos = b.size();
- resize(pos + sz);
- memcpy(&b[pos], &v[0], sz);
- }
+ if(sz > 0)
+ {
+ Container::size_type pos = b.size();
+ resize(pos + sz);
+ memcpy(&b[pos], &v[0], sz);
+ }
}
void readBlob(const Ice::Byte*& v, Container::size_type sz)
{
- if(sz > 0)
- {
- v = i;
- if(static_cast<Container::size_type>(b.end() - i) < sz)
- {
- Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
- i += sz;
- }
- else
- {
- v = i;
- }
+ if(sz > 0)
+ {
+ v = i;
+ if(static_cast<Container::size_type>(b.end() - i) < sz)
+ {
+ Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+ i += sz;
+ }
+ else
+ {
+ v = i;
+ }
}
void write(Ice::Byte v) // Inlined for performance reasons.
{
- b.push_back(v);
+ b.push_back(v);
}
void read(Ice::Byte& v) // Inlined for performance reasons.
{
- if(i >= b.end())
- {
- Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
- v = *i++;
+ if(i >= b.end())
+ {
+ Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+ v = *i++;
}
ICE_API void write(const Ice::Byte*, const Ice::Byte*);
@@ -407,17 +407,17 @@ public:
void write(bool v) // Inlined for performance reasons.
{
- b.push_back(static_cast<Ice::Byte>(v));
+ b.push_back(static_cast<Ice::Byte>(v));
}
ICE_API void write(const std::vector<bool>&);
ICE_API void write(const bool*, const bool*);
void read(bool& v) // Inlined for performance reasons.
{
- if(i >= b.end())
- {
- Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
- v = *i++;
+ if(i >= b.end())
+ {
+ Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+ v = *i++;
}
ICE_API void read(std::vector<bool>&);
ICE_API bool* read(std::pair<const bool*, const bool*>&);
@@ -431,44 +431,44 @@ public:
void
write(Ice::Int v) // Inlined for performance reasons.
{
- Container::size_type pos = b.size();
- resize(pos + sizeof(Ice::Int));
- Ice::Byte* dest = &b[pos];
+ Container::size_type pos = b.size();
+ resize(pos + sizeof(Ice::Int));
+ Ice::Byte* dest = &b[pos];
#ifdef ICE_BIG_ENDIAN
- const Ice::Byte* src = reinterpret_cast<const Ice::Byte*>(&v) + sizeof(Ice::Int) - 1;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest = *src;
+ const Ice::Byte* src = reinterpret_cast<const Ice::Byte*>(&v) + sizeof(Ice::Int) - 1;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest = *src;
#else
- const Ice::Byte* src = reinterpret_cast<const Ice::Byte*>(&v);
- *dest++ = *src++;
- *dest++ = *src++;
- *dest++ = *src++;
- *dest = *src;
+ const Ice::Byte* src = reinterpret_cast<const Ice::Byte*>(&v);
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest = *src;
#endif
}
void read(Ice::Int& v) // Inlined for performance reasons.
{
- if(b.end() - i < static_cast<int>(sizeof(Ice::Int)))
- {
- Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
- const Ice::Byte* src = &(*i);
- i += sizeof(Ice::Int);
+ if(b.end() - i < static_cast<int>(sizeof(Ice::Int)))
+ {
+ Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+ const Ice::Byte* src = &(*i);
+ i += sizeof(Ice::Int);
#ifdef ICE_BIG_ENDIAN
- Ice::Byte* dest = reinterpret_cast<Ice::Byte*>(&v) + sizeof(Ice::Int) - 1;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest = *src;
+ Ice::Byte* dest = reinterpret_cast<Ice::Byte*>(&v) + sizeof(Ice::Int) - 1;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest = *src;
#else
- Ice::Byte* dest = reinterpret_cast<Ice::Byte*>(&v);
- *dest++ = *src++;
- *dest++ = *src++;
- *dest++ = *src++;
- *dest = *src;
+ Ice::Byte* dest = reinterpret_cast<Ice::Byte*>(&v);
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest = *src;
#endif
}
@@ -529,14 +529,14 @@ public:
ICE_API void write(const std::string*, const std::string*, bool = true);
void read(std::string& v, bool convert = true)
{
- Ice::Int sz;
- readSize(sz);
- if(sz > 0)
- {
- if(b.end() - i < sz)
- {
- Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
+ Ice::Int sz;
+ readSize(sz);
+ if(sz > 0)
+ {
+ if(b.end() - i < sz)
+ {
+ Ice::throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
#ifdef ICEE_HAS_WSTRING
if(convert && _stringConverter != 0)
{
@@ -548,12 +548,12 @@ public:
std::string(reinterpret_cast<const char*>(&*i), reinterpret_cast<const char*>(&*i) + sz).swap(v);
// v.assign(reinterpret_cast<const char*>(&(*i)), sz);
}
- i += sz;
- }
- else
- {
- v.clear();
- }
+ i += sz;
+ }
+ else
+ {
+ v.clear();
+ }
}
ICE_API void read(std::vector<std::string>&, bool = true);
@@ -600,36 +600,36 @@ private:
{
public:
- ReadEncaps() : previous(0) { } // Inlined for performance reasons.
- ~ReadEncaps() { } // Inlined for performance reasons.
+ ReadEncaps() : previous(0) { } // Inlined for performance reasons.
+ ~ReadEncaps() { } // Inlined for performance reasons.
- void reset() { previous = 0; } // Inlined for performance reasons.
- ICE_API void swap(ReadEncaps&);
+ void reset() { previous = 0; } // Inlined for performance reasons.
+ ICE_API void swap(ReadEncaps&);
- Container::size_type start;
- Ice::Int sz;
+ Container::size_type start;
+ Ice::Int sz;
- Ice::Byte encodingMajor;
- Ice::Byte encodingMinor;
+ Ice::Byte encodingMajor;
+ Ice::Byte encodingMinor;
- ReadEncaps* previous;
+ ReadEncaps* previous;
};
class WriteEncaps : private ::IceUtil::noncopyable
{
public:
- WriteEncaps() : writeIndex(0), previous(0) { } // Inlined for performance reasons.
- ~WriteEncaps() { } // Inlined for performance reasons.
+ WriteEncaps() : writeIndex(0), previous(0) { } // Inlined for performance reasons.
+ ~WriteEncaps() { } // Inlined for performance reasons.
- void reset() { writeIndex = 0; previous = 0; } // Inlined for performance reasons.
- ICE_API void swap(WriteEncaps&);
+ void reset() { writeIndex = 0; previous = 0; } // Inlined for performance reasons.
+ ICE_API void swap(WriteEncaps&);
- Container::size_type start;
+ Container::size_type start;
- Ice::Int writeIndex;
+ Ice::Int writeIndex;
- WriteEncaps* previous;
+ WriteEncaps* previous;
};
ReadEncaps* _currentReadEncaps;
@@ -651,10 +651,10 @@ private:
struct SeqData
{
- SeqData(int, int);
- int numElements;
- int minSize;
- SeqData* previous;
+ SeqData(int, int);
+ int numElements;
+ int minSize;
+ SeqData* previous;
};
SeqData* _seqDataStack;
};
diff --git a/cppe/include/IceE/Buffer.h b/cppe/include/IceE/Buffer.h
index 84d1d8b8893..196354d1685 100644
--- a/cppe/include/IceE/Buffer.h
+++ b/cppe/include/IceE/Buffer.h
@@ -32,156 +32,156 @@ public:
{
public:
- //
- // Standard vector-like operations.
- //
-
- typedef Ice::Byte value_type;
- typedef Ice::Byte* iterator;
- typedef const Ice::Byte* const_iterator;
- typedef Ice::Byte& reference;
- typedef const Ice::Byte& const_reference;
- typedef Ice::Byte* pointer;
- typedef int difference_type;
- typedef size_t size_type;
+ //
+ // Standard vector-like operations.
+ //
+
+ typedef Ice::Byte value_type;
+ typedef Ice::Byte* iterator;
+ typedef const Ice::Byte* const_iterator;
+ typedef Ice::Byte& reference;
+ typedef const Ice::Byte& const_reference;
+ typedef Ice::Byte* pointer;
+ typedef int difference_type;
+ typedef size_t size_type;
#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION
- Container(size_type maxCapacity) :
- _buf(_fixed),
- _size(0),
- _capacity(ICE_BUFFER_FIXED_SIZE),
- _maxCapacity(maxCapacity)
- {
- }
+ Container(size_type maxCapacity) :
+ _buf(_fixed),
+ _size(0),
+ _capacity(ICE_BUFFER_FIXED_SIZE),
+ _maxCapacity(maxCapacity)
+ {
+ }
#else
- Container(size_type maxCapacity) :
- _buf(0),
- _size(0),
- _capacity(0),
- _maxCapacity(maxCapacity)
- {
- }
+ Container(size_type maxCapacity) :
+ _buf(0),
+ _size(0),
+ _capacity(0),
+ _maxCapacity(maxCapacity)
+ {
+ }
#endif
- ~Container()
- {
+ ~Container()
+ {
#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION
- if(_buf != _fixed)
- {
- free(_buf);
- }
+ if(_buf != _fixed)
+ {
+ free(_buf);
+ }
#else
- free(_buf);
+ free(_buf);
#endif
- }
-
- iterator begin()
- {
- return _buf;
- }
-
- const_iterator begin() const
- {
- return _buf;
- }
-
- iterator end()
- {
- return _buf + _size;
- }
-
- const_iterator end() const
- {
- return _buf + _size;
- }
-
- size_type size() const
- {
- return _size;
- }
-
- bool empty() const
- {
- return !_size;
- }
-
- ICE_API void swap(Container&);
-
- ICE_API void clear();
-
- void resize(size_type n) // Inlined for performance reasons.
+ }
+
+ iterator begin()
+ {
+ return _buf;
+ }
+
+ const_iterator begin() const
+ {
+ return _buf;
+ }
+
+ iterator end()
+ {
+ return _buf + _size;
+ }
+
+ const_iterator end() const
+ {
+ return _buf + _size;
+ }
+
+ size_type size() const
+ {
+ return _size;
+ }
+
+ bool empty() const
+ {
+ return !_size;
+ }
+
+ ICE_API void swap(Container&);
+
+ ICE_API void clear();
+
+ void resize(size_type n) // Inlined for performance reasons.
+ {
+ if(n == 0)
+ {
+ clear();
+ }
+ else if(n > _capacity)
+ {
+ reserve(n);
+ }
+ _size = n;
+ }
+
+ void reset()
+ {
+ if(_size > 0 && _size * 2 < _capacity)
+ {
+ //
+ // If the current buffer size is smaller than the
+ // buffer capacity, we shrink the buffer memory to the
+ // current size. This is to avoid holding on too much
+ // memory if it's not needed anymore.
+ //
+ if(++_shrinkCounter > 2)
+ {
+ reserve(_size);
+ _shrinkCounter = 0;
+ }
+ }
+ else
+ {
+ _shrinkCounter = 0;
+ }
+ _size = 0;
+ }
+
+ void push_back(value_type v)
+ {
+ resize(_size + 1);
+ _buf[_size - 1] = v;
+ }
+
+ reference operator[](size_type n)
+ {
+ assert(n < _size);
+ return _buf[n];
+ }
+
+ const_reference operator[](size_type n) const
{
- if(n == 0)
- {
- clear();
- }
- else if(n > _capacity)
- {
- reserve(n);
- }
- _size = n;
- }
-
- void reset()
- {
- if(_size > 0 && _size * 2 < _capacity)
- {
- //
- // If the current buffer size is smaller than the
- // buffer capacity, we shrink the buffer memory to the
- // current size. This is to avoid holding on too much
- // memory if it's not needed anymore.
- //
- if(++_shrinkCounter > 2)
- {
- reserve(_size);
- _shrinkCounter = 0;
- }
- }
- else
- {
- _shrinkCounter = 0;
- }
- _size = 0;
- }
-
- void push_back(value_type v)
- {
- resize(_size + 1);
- _buf[_size - 1] = v;
- }
-
- reference operator[](size_type n)
- {
- assert(n < _size);
- return _buf[n];
- }
-
- const_reference operator[](size_type n) const
- {
- assert(n < _size);
- return _buf[n];
- }
+ assert(n < _size);
+ return _buf[n];
+ }
private:
- ICE_API Container(const Container&);
- ICE_API void operator=(const Container&);
- ICE_API void reserve(size_type);
+ ICE_API Container(const Container&);
+ ICE_API void operator=(const Container&);
+ ICE_API void reserve(size_type);
- pointer _buf;
- size_type _size;
- size_type _capacity;
- size_type _maxCapacity;
- int _shrinkCounter;
+ pointer _buf;
+ size_type _size;
+ size_type _capacity;
+ size_type _maxCapacity;
+ int _shrinkCounter;
#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION
- //
- // For small buffers, we stack-allocate the memory. Only when
- // a buffer size larger than _fixedSize is requested, we
- // allocate memory dynamically.
- //
- value_type _fixed[ICE_BUFFER_FIXED_SIZE];
+ //
+ // For small buffers, we stack-allocate the memory. Only when
+ // a buffer size larger than _fixedSize is requested, we
+ // allocate memory dynamically.
+ //
+ value_type _fixed[ICE_BUFFER_FIXED_SIZE];
#endif
};
diff --git a/cppe/include/IceE/Cond.h b/cppe/include/IceE/Cond.h
index b7a4810cc04..34b6b3b7152 100644
--- a/cppe/include/IceE/Cond.h
+++ b/cppe/include/IceE/Cond.h
@@ -87,11 +87,11 @@ public:
template <typename Lock> inline void
wait(const Lock& lock) const
{
- if(!lock.acquired())
- {
- throw ThreadLockedException(__FILE__, __LINE__);
- }
- waitImpl(lock._mutex);
+ if(!lock.acquired())
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
+ waitImpl(lock._mutex);
}
//
@@ -104,11 +104,11 @@ public:
template <typename Lock> inline bool
timedWait(const Lock& lock, const Time& timeout) const
{
- if(!lock.acquired())
- {
- throw ThreadLockedException(__FILE__, __LINE__);
- }
- return timedWaitImpl(lock._mutex, timeout);
+ if(!lock.acquired())
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
+ return timedWaitImpl(lock._mutex, timeout);
}
private:
@@ -204,7 +204,7 @@ Cond::waitImpl(const M& mutex) const
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -225,15 +225,15 @@ Cond::timedWaitImpl(const M& mutex, const Time& timeout) const
if(rc != 0)
{
- //
- // pthread_cond_timedwait returns ETIMEOUT in the event of a
- // timeout.
- //
- if(rc != ETIMEDOUT)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
- return false;
+ //
+ // pthread_cond_timedwait returns ETIMEOUT in the event of a
+ // timeout.
+ //
+ if(rc != ETIMEDOUT)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
+ return false;
}
return true;
}
diff --git a/cppe/include/IceE/Connection.h b/cppe/include/IceE/Connection.h
index 7a76ae59024..6479cc74c97 100644
--- a/cppe/include/IceE/Connection.h
+++ b/cppe/include/IceE/Connection.h
@@ -52,9 +52,9 @@ public:
enum DestructionReason
{
#ifndef ICEE_PURE_CLIENT
- ObjectAdapterDeactivated,
+ ObjectAdapterDeactivated,
#endif
- CommunicatorDestroyed
+ CommunicatorDestroyed
};
void activate();
@@ -104,10 +104,10 @@ private:
#ifndef ICEE_PURE_CLIENT
Connection(const IceInternal::InstancePtr&, const IceInternal::TransceiverPtr&,
- const IceInternal::EndpointPtr&, const ObjectAdapterPtr&);
+ const IceInternal::EndpointPtr&, const ObjectAdapterPtr&);
#else
Connection(const IceInternal::InstancePtr&, const IceInternal::TransceiverPtr&,
- const IceInternal::EndpointPtr&);
+ const IceInternal::EndpointPtr&);
#endif
~Connection();
@@ -118,13 +118,13 @@ private:
enum State
{
- StateNotValidated,
- StateActive,
+ StateNotValidated,
+ StateActive,
#ifndef ICEE_PURE_CLIENT
- StateHolding,
+ StateHolding,
#endif
- StateClosing,
- StateClosed
+ StateClosing,
+ StateClosed
};
void validate();
@@ -151,13 +151,13 @@ private:
class ThreadPerConnection : public IceUtil::Thread
{
public:
-
- ThreadPerConnection(const ConnectionPtr&);
- virtual void run();
+
+ ThreadPerConnection(const ConnectionPtr&);
+ virtual void run();
private:
-
- ConnectionPtr _connection;
+
+ ConnectionPtr _connection;
};
friend class ThreadPerConnection;
// Defined as mutable because "isFinished() const" sets this to 0.
diff --git a/cppe/include/IceE/DisableWarnings.h b/cppe/include/IceE/DisableWarnings.h
index 94cb4761451..d85290e9dcd 100644
--- a/cppe/include/IceE/DisableWarnings.h
+++ b/cppe/include/IceE/DisableWarnings.h
@@ -21,11 +21,11 @@
//
#if defined(_MSC_VER) && _MSC_VER >= 1400
-# define _CRT_SECURE_NO_DEPRECATE 1 // C4996 '<C function>' was declared deprecated/
+# define _CRT_SECURE_NO_DEPRECATE 1 // C4996 '<C function>' was declared deprecated/
#endif
#if defined(_MSC_VER) && _MSC_VER >= 1300
-# pragma warning( 4 : 4996 ) // C4996 'std::<function>' was declared deprecated
+# pragma warning( 4 : 4996 ) // C4996 'std::<function>' was declared deprecated
#endif
#endif
diff --git a/cppe/include/IceE/FactoryTable.h b/cppe/include/IceE/FactoryTable.h
index e10c6135d4a..d5a0cb26698 100644
--- a/cppe/include/IceE/FactoryTable.h
+++ b/cppe/include/IceE/FactoryTable.h
@@ -23,7 +23,7 @@ public:
~FactoryTable();
};
-static FactoryTable factoryTableInitializer; // Dummy variable to force initialization of factoryTable
+static FactoryTable factoryTableInitializer; // Dummy variable to force initialization of factoryTable
extern ICE_API FactoryTableDef* factoryTable;
diff --git a/cppe/include/IceE/Functional.h b/cppe/include/IceE/Functional.h
index a529a8be329..26179a389bc 100644
--- a/cppe/include/IceE/Functional.h
+++ b/cppe/include/IceE/Functional.h
@@ -32,7 +32,7 @@ public:
explicit MemFun(MemberFN p) : _mfn(p) { }
R operator()(H handle) const
{
- return (handle.get() ->* _mfn)();
+ return (handle.get() ->* _mfn)();
}
};
@@ -47,7 +47,7 @@ public:
explicit MemFun1(MemberFN p) : _mfn(p) { }
R operator()(H handle, A arg) const
{
- return (handle.get() ->* _mfn)(arg);
+ return (handle.get() ->* _mfn)(arg);
}
};
@@ -62,7 +62,7 @@ public:
explicit VoidMemFun(MemberFN p) : _mfn(p) { }
void operator()(H handle) const
{
- (handle.get() ->* _mfn)();
+ (handle.get() ->* _mfn)();
}
};
@@ -77,7 +77,7 @@ public:
explicit VoidMemFun1(MemberFN p) : _mfn(p) { }
void operator()(H handle, A arg) const
{
- (handle.get() ->* _mfn)(arg);
+ (handle.get() ->* _mfn)(arg);
}
};
@@ -92,7 +92,7 @@ public:
explicit SecondMemFun(MemberFN p) : _mfn(p) { }
R operator()(std::pair<K, H> pair) const
{
- return (pair.second.get() ->* _mfn)();
+ return (pair.second.get() ->* _mfn)();
}
};
@@ -107,7 +107,7 @@ public:
explicit SecondMemFun1(MemberFN p) : _mfn(p) { }
R operator()(std::pair<K, H> pair, A arg) const
{
- return (pair.second.get() ->* _mfn)(arg);
+ return (pair.second.get() ->* _mfn)(arg);
}
};
@@ -122,7 +122,7 @@ public:
explicit SecondVoidMemFun(MemberFN p) : _mfn(p) { }
void operator()(std::pair<K, H> pair) const
{
- (pair.second.get() ->* _mfn)();
+ (pair.second.get() ->* _mfn)();
}
};
@@ -137,7 +137,7 @@ public:
explicit SecondVoidMemFun1(MemberFN p) : _mfn(p) { }
void operator()(std::pair<K, H> pair, A arg) const
{
- (pair.second.get() ->* _mfn)(arg);
+ (pair.second.get() ->* _mfn)(arg);
}
};
@@ -152,7 +152,7 @@ public:
explicit ConstMemFun(MemberFN p) : _mfn(p) { }
R operator()(H handle) const
{
- return (handle.get() ->* _mfn)();
+ return (handle.get() ->* _mfn)();
}
};
@@ -167,7 +167,7 @@ public:
explicit ConstMemFun1(MemberFN p) : _mfn(p) { }
R operator()(H handle, A arg) const
{
- return (handle.get() ->* _mfn)(arg);
+ return (handle.get() ->* _mfn)(arg);
}
};
@@ -182,7 +182,7 @@ public:
explicit ConstVoidMemFun(MemberFN p) : _mfn(p) { }
void operator()(H handle) const
{
- (handle.get() ->* _mfn)();
+ (handle.get() ->* _mfn)();
}
};
@@ -197,7 +197,7 @@ public:
explicit ConstVoidMemFun1(MemberFN p) : _mfn(p) { }
void operator()(H handle, A arg) const
{
- (handle.get() ->* _mfn)(arg);
+ (handle.get() ->* _mfn)(arg);
}
};
@@ -212,7 +212,7 @@ public:
explicit SecondConstMemFun(MemberFN p) : _mfn(p) { }
R operator()(std::pair<K, H> pair) const
{
- return (pair.second.get() ->* _mfn)();
+ return (pair.second.get() ->* _mfn)();
}
};
@@ -227,7 +227,7 @@ public:
explicit SecondConstMemFun1(MemberFN p) : _mfn(p) { }
R operator()(std::pair<K, H> pair, A arg) const
{
- return (pair.second.get() ->* _mfn)(arg);
+ return (pair.second.get() ->* _mfn)(arg);
}
};
@@ -242,7 +242,7 @@ public:
explicit SecondConstVoidMemFun(MemberFN p) : _mfn(p) { }
void operator()(std::pair<K, H> pair) const
{
- (pair.second.get() ->* _mfn)();
+ (pair.second.get() ->* _mfn)();
}
};
@@ -257,7 +257,7 @@ public:
explicit SecondConstVoidMemFun1(MemberFN p) : _mfn(p) { }
void operator()(std::pair<K, H> pair, A arg) const
{
- (pair.second.get() ->* _mfn)(arg);
+ (pair.second.get() ->* _mfn)(arg);
}
};
diff --git a/cppe/include/IceE/Handle.h b/cppe/include/IceE/Handle.h
index f9947c09974..1f29a6290ab 100644
--- a/cppe/include/IceE/Handle.h
+++ b/cppe/include/IceE/Handle.h
@@ -29,51 +29,51 @@ public:
T* get() const
{
- return _ptr;
+ return _ptr;
}
T* operator->() const
{
- if(!_ptr)
- {
- //
- // We don't throw directly NullHandleException here to
- // keep the code size of this method to a minimun (the
- // assembly code for throwing an exception is much bigger
- // than just a function call). This maximises the chances
- // of inlining by compiler optimization.
- //
- throwNullHandleException(__FILE__, __LINE__);
- }
-
- return _ptr;
+ if(!_ptr)
+ {
+ //
+ // We don't throw directly NullHandleException here to
+ // keep the code size of this method to a minimun (the
+ // assembly code for throwing an exception is much bigger
+ // than just a function call). This maximises the chances
+ // of inlining by compiler optimization.
+ //
+ throwNullHandleException(__FILE__, __LINE__);
+ }
+
+ return _ptr;
}
T& operator*() const
{
- if(!_ptr)
- {
- //
- // We don't throw directly NullHandleException here to
- // keep the code size of this method to a minimun (the
- // assembly code for throwing an exception is much bigger
- // than just a function call). This maximises the chances
- // of inlining by compiler optimization.
- //
- throwNullHandleException(__FILE__, __LINE__);
- }
-
- return *_ptr;
+ if(!_ptr)
+ {
+ //
+ // We don't throw directly NullHandleException here to
+ // keep the code size of this method to a minimun (the
+ // assembly code for throwing an exception is much bigger
+ // than just a function call). This maximises the chances
+ // of inlining by compiler optimization.
+ //
+ throwNullHandleException(__FILE__, __LINE__);
+ }
+
+ return *_ptr;
}
operator bool() const
{
- return _ptr ? true : false;
+ return _ptr ? true : false;
}
void swap(HandleBase& other)
{
- std::swap(_ptr, other._ptr);
+ std::swap(_ptr, other._ptr);
}
T* _ptr;
@@ -96,12 +96,12 @@ inline bool operator==(const HandleBase<T>& lhs, const HandleBase<U>& rhs)
U* r = rhs.get();
if(l && r)
{
- return *l == *r;
+ return *l == *r;
}
else
{
- return !l && !r;
- }
+ return !l && !r;
+ }
}
template<typename T, typename U>
@@ -117,11 +117,11 @@ inline bool operator<(const HandleBase<T>& lhs, const HandleBase<U>& rhs)
U* r = rhs.get();
if(l && r)
{
- return *l < *r;
+ return *l < *r;
}
else
{
- return !l && r;
+ return !l && r;
}
}
@@ -150,114 +150,114 @@ public:
Handle(T* p = 0)
{
- this->_ptr = p;
+ this->_ptr = p;
- if(this->_ptr)
- {
- this->_ptr->__incRef();
- }
+ if(this->_ptr)
+ {
+ this->_ptr->__incRef();
+ }
}
template<typename Y>
Handle(const Handle<Y>& r)
{
- this->_ptr = r._ptr;
+ this->_ptr = r._ptr;
- if(this->_ptr)
- {
- this->_ptr->__incRef();
- }
+ if(this->_ptr)
+ {
+ this->_ptr->__incRef();
+ }
}
Handle(const Handle& r)
{
- this->_ptr = r._ptr;
+ this->_ptr = r._ptr;
- if(this->_ptr)
- {
- this->_ptr->__incRef();
- }
+ if(this->_ptr)
+ {
+ this->_ptr->__incRef();
+ }
}
~Handle()
{
- if(this->_ptr)
- {
- this->_ptr->__decRef();
- }
+ if(this->_ptr)
+ {
+ this->_ptr->__decRef();
+ }
}
Handle& operator=(T* p)
{
- if(this->_ptr != p)
- {
- if(p)
- {
- p->__incRef();
- }
-
- T* ptr = this->_ptr;
- this->_ptr = p;
-
- if(ptr)
- {
- ptr->__decRef();
- }
- }
- return *this;
+ if(this->_ptr != p)
+ {
+ if(p)
+ {
+ p->__incRef();
+ }
+
+ T* ptr = this->_ptr;
+ this->_ptr = p;
+
+ if(ptr)
+ {
+ ptr->__decRef();
+ }
+ }
+ return *this;
}
template<typename Y>
Handle& operator=(const Handle<Y>& r)
{
- if(this->_ptr != r._ptr)
- {
- if(r._ptr)
- {
- r._ptr->__incRef();
- }
-
- T* ptr = this->_ptr;
- this->_ptr = r._ptr;
-
- if(ptr)
- {
- ptr->__decRef();
- }
- }
- return *this;
+ if(this->_ptr != r._ptr)
+ {
+ if(r._ptr)
+ {
+ r._ptr->__incRef();
+ }
+
+ T* ptr = this->_ptr;
+ this->_ptr = r._ptr;
+
+ if(ptr)
+ {
+ ptr->__decRef();
+ }
+ }
+ return *this;
}
Handle& operator=(const Handle& r)
{
- if(this->_ptr != r._ptr)
- {
- if(r._ptr)
- {
- r._ptr->__incRef();
- }
-
- T* ptr = this->_ptr;
- this->_ptr = r._ptr;
-
- if(ptr)
- {
- ptr->__decRef();
- }
- }
- return *this;
+ if(this->_ptr != r._ptr)
+ {
+ if(r._ptr)
+ {
+ r._ptr->__incRef();
+ }
+
+ T* ptr = this->_ptr;
+ this->_ptr = r._ptr;
+
+ if(ptr)
+ {
+ ptr->__decRef();
+ }
+ }
+ return *this;
}
template<class Y>
static Handle dynamicCast(const HandleBase<Y>& r)
{
- return Handle(dynamic_cast<T*>(r._ptr));
+ return Handle(dynamic_cast<T*>(r._ptr));
}
template<class Y>
static Handle dynamicCast(Y* p)
{
- return Handle(dynamic_cast<T*>(p));
+ return Handle(dynamic_cast<T*>(p));
}
};
@@ -284,146 +284,146 @@ public:
Handle(T* p = 0)
{
- this->_ptr = p;
+ this->_ptr = p;
- if(this->_ptr)
- {
- upCast(this->_ptr)->__incRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__incRef();
+ }
}
template<typename Y>
Handle(const Handle<Y>& r)
{
- this->_ptr = r._ptr;
+ this->_ptr = r._ptr;
- if(this->_ptr)
- {
- upCast(this->_ptr)->__incRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__incRef();
+ }
}
template<typename Y>
Handle(const ::IceUtil::Handle<Y>& r)
{
- this->_ptr = r._ptr;
+ this->_ptr = r._ptr;
- if(this->_ptr)
- {
- upCast(this->_ptr)->__incRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__incRef();
+ }
}
Handle(const Handle& r)
{
- this->_ptr = r._ptr;
+ this->_ptr = r._ptr;
- if(this->_ptr)
- {
- upCast(this->_ptr)->__incRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__incRef();
+ }
}
~Handle()
{
- if(this->_ptr)
- {
- upCast(this->_ptr)->__decRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__decRef();
+ }
}
Handle& operator=(T* p)
{
- if(this->_ptr != p)
- {
- if(p)
- {
- upCast(p)->__incRef();
- }
-
- T* ptr = this->_ptr;
- this->_ptr = p;
-
- if(ptr)
- {
- upCast(ptr)->__decRef();
- }
- }
- return *this;
+ if(this->_ptr != p)
+ {
+ if(p)
+ {
+ upCast(p)->__incRef();
+ }
+
+ T* ptr = this->_ptr;
+ this->_ptr = p;
+
+ if(ptr)
+ {
+ upCast(ptr)->__decRef();
+ }
+ }
+ return *this;
}
template<typename Y>
Handle& operator=(const Handle<Y>& r)
{
- if(this->_ptr != r._ptr)
- {
- if(r._ptr)
- {
+ if(this->_ptr != r._ptr)
+ {
+ if(r._ptr)
+ {
upCast(r._ptr)->__incRef();
- }
+ }
- T* ptr = this->_ptr;
- this->_ptr = r._ptr;
+ T* ptr = this->_ptr;
+ this->_ptr = r._ptr;
- if(ptr)
- {
- upCast(ptr)->__decRef();
- }
- }
- return *this;
+ if(ptr)
+ {
+ upCast(ptr)->__decRef();
+ }
+ }
+ return *this;
}
template<typename Y>
Handle& operator=(const ::IceUtil::Handle<Y>& r)
{
- if(this->_ptr != r._ptr)
- {
- if(r._ptr)
- {
- upCast(r._ptr)->__incRef();
- }
-
- T* ptr = this->_ptr;
- this->_ptr = r._ptr;
-
- if(ptr)
- {
- upCast(ptr)->__decRef();
- }
- }
- return *this;
+ if(this->_ptr != r._ptr)
+ {
+ if(r._ptr)
+ {
+ upCast(r._ptr)->__incRef();
+ }
+
+ T* ptr = this->_ptr;
+ this->_ptr = r._ptr;
+
+ if(ptr)
+ {
+ upCast(ptr)->__decRef();
+ }
+ }
+ return *this;
}
Handle& operator=(const Handle& r)
{
- if(this->_ptr != r._ptr)
- {
- if(r._ptr)
- {
- upCast(r._ptr)->__incRef();
- }
-
- T* ptr = this->_ptr;
- this->_ptr = r._ptr;
-
- if(ptr)
- {
- upCast(ptr)->__decRef();
- }
- }
- return *this;
+ if(this->_ptr != r._ptr)
+ {
+ if(r._ptr)
+ {
+ upCast(r._ptr)->__incRef();
+ }
+
+ T* ptr = this->_ptr;
+ this->_ptr = r._ptr;
+
+ if(ptr)
+ {
+ upCast(ptr)->__decRef();
+ }
+ }
+ return *this;
}
template<class Y>
static Handle dynamicCast(const ::IceUtil::HandleBase<Y>& r)
{
- return Handle(dynamic_cast<T*>(r._ptr));
+ return Handle(dynamic_cast<T*>(r._ptr));
}
template<class Y>
static Handle dynamicCast(Y* p)
{
- return Handle(dynamic_cast<T*>(p));
+ return Handle(dynamic_cast<T*>(p));
}
};
diff --git a/cppe/include/IceE/Initialize.h b/cppe/include/IceE/Initialize.h
index 31f1d828ac8..d2c54a88706 100644
--- a/cppe/include/IceE/Initialize.h
+++ b/cppe/include/IceE/Initialize.h
@@ -55,10 +55,10 @@ struct InitializationData
};
ICE_API CommunicatorPtr initialize(int&, char*[], const InitializationData& = InitializationData(),
- Int = ICEE_INT_VERSION);
+ Int = ICEE_INT_VERSION);
ICE_API CommunicatorPtr initialize(StringSeq&, const InitializationData& = InitializationData(),
- Int = ICEE_INT_VERSION);
+ Int = ICEE_INT_VERSION);
ICE_API CommunicatorPtr initialize(const InitializationData& = InitializationData(), Int = ICEE_INT_VERSION);
diff --git a/cppe/include/IceE/Lock.h b/cppe/include/IceE/Lock.h
index e2e1baef852..36d754066cb 100644
--- a/cppe/include/IceE/Lock.h
+++ b/cppe/include/IceE/Lock.h
@@ -44,63 +44,63 @@ class LockT
public:
LockT(const T& mutex) :
- _mutex(mutex)
+ _mutex(mutex)
{
- _mutex.lock();
- _acquired = true;
+ _mutex.lock();
+ _acquired = true;
}
~LockT()
{
- if (_acquired)
- {
- _mutex.unlock();
- }
+ if (_acquired)
+ {
+ _mutex.unlock();
+ }
}
void acquire() const
{
- if (_acquired)
- {
- throw ThreadLockedException(__FILE__, __LINE__);
- }
- _mutex.lock();
- _acquired = true;
+ if (_acquired)
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
+ _mutex.lock();
+ _acquired = true;
}
bool tryAcquire() const
{
- if (_acquired)
- {
- throw ThreadLockedException(__FILE__, __LINE__);
- }
- _acquired = _mutex.tryLock();
- return _acquired;
+ if (_acquired)
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
+ _acquired = _mutex.tryLock();
+ return _acquired;
}
void release() const
{
- if (!_acquired)
- {
- throw ThreadLockedException(__FILE__, __LINE__);
- }
- _mutex.unlock();
- _acquired = false;
+ if (!_acquired)
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
+ _mutex.unlock();
+ _acquired = false;
}
bool acquired() const
{
- return _acquired;
+ return _acquired;
}
protected:
// TryLockT's contructor
LockT(const T& mutex, bool) :
- _mutex(mutex)
+ _mutex(mutex)
{
- _acquired = _mutex.tryLock();
+ _acquired = _mutex.tryLock();
}
private:
@@ -126,7 +126,7 @@ class TryLockT : public LockT<T>
public:
TryLockT(const T& mutex) :
- LockT<T>(mutex, true)
+ LockT<T>(mutex, true)
{}
};
diff --git a/cppe/include/IceE/Monitor.h b/cppe/include/IceE/Monitor.h
index 6d83ce18ffd..54993ec3c69 100644
--- a/cppe/include/IceE/Monitor.h
+++ b/cppe/include/IceE/Monitor.h
@@ -89,11 +89,11 @@ IceUtil::Monitor<T>::lock() const
_mutex.lock();
if(_mutex.willUnlock())
{
- //
- // On the first mutex acquisition reset the number pending
- // notifications.
- //
- _nnotify = 0;
+ //
+ // On the first mutex acquisition reset the number pending
+ // notifications.
+ //
+ _nnotify = 0;
}
}
@@ -102,13 +102,13 @@ IceUtil::Monitor<T>::unlock() const
{
if(_mutex.willUnlock())
{
- //
- // Perform any pending notifications.
- //
- if(_nnotify != 0)
- {
- notifyImpl(_nnotify);
- }
+ //
+ // Perform any pending notifications.
+ //
+ if(_nnotify != 0)
+ {
+ notifyImpl(_nnotify);
+ }
}
_mutex.unlock();
@@ -116,12 +116,12 @@ IceUtil::Monitor<T>::unlock() const
int nnotify = _nnotify;
if(_mutex.unlock())
{
- //
- // Perform any pending notifications.
- //
- if(nnotify != 0)
+ //
+ // Perform any pending notifications.
+ //
+ if(nnotify != 0)
{
- notifyImpl(nnotify);
+ notifyImpl(nnotify);
}
}
*/
@@ -133,11 +133,11 @@ IceUtil::Monitor<T>::tryLock() const
bool result = _mutex.tryLock();
if(result && _mutex.willUnlock())
{
- //
- // On the first mutex acquisition reset the number pending
- // notifications.
- //
- _nnotify = 0;
+ //
+ // On the first mutex acquisition reset the number pending
+ // notifications.
+ //
+ _nnotify = 0;
}
return result;
}
@@ -150,7 +150,7 @@ IceUtil::Monitor<T>::wait() const
//
if(_nnotify != 0)
{
- notifyImpl(_nnotify);
+ notifyImpl(_nnotify);
}
//
@@ -158,15 +158,15 @@ IceUtil::Monitor<T>::wait() const
//
try
{
- _cond.waitImpl(_mutex);
- //
- // Reset the nnotify count once wait() returns.
- //
+ _cond.waitImpl(_mutex);
+ //
+ // Reset the nnotify count once wait() returns.
+ //
}
catch(...)
{
- _nnotify = 0;
- throw;
+ _nnotify = 0;
+ throw;
}
_nnotify = 0;
@@ -180,7 +180,7 @@ IceUtil::Monitor<T>::timedWait(const Time& timeout) const
//
if(_nnotify != 0)
{
- notifyImpl(_nnotify);
+ notifyImpl(_nnotify);
}
bool rc;
@@ -189,16 +189,16 @@ IceUtil::Monitor<T>::timedWait(const Time& timeout) const
//
try
{
- rc = _cond.timedWaitImpl(_mutex, timeout);
+ rc = _cond.timedWaitImpl(_mutex, timeout);
- //
- // Reset the nnotify count once wait() returns.
- //
+ //
+ // Reset the nnotify count once wait() returns.
+ //
}
catch(...)
{
- _nnotify = 0;
- throw;
+ _nnotify = 0;
+ throw;
}
_nnotify = 0;
@@ -214,7 +214,7 @@ IceUtil::Monitor<T>::notify()
//
if(_nnotify != -1)
{
- ++_nnotify;
+ ++_nnotify;
}
}
@@ -236,19 +236,19 @@ IceUtil::Monitor<T>::notifyImpl(int nnotify) const
//
if(nnotify == -1)
{
- _cond.broadcast();
- return;
+ _cond.broadcast();
+ return;
}
else
{
- //
- // Otherwise notify n times.
- //
- while(nnotify > 0)
- {
- _cond.signal();
- --nnotify;
- }
+ //
+ // Otherwise notify n times.
+ //
+ while(nnotify > 0)
+ {
+ _cond.signal();
+ --nnotify;
+ }
}
}
diff --git a/cppe/include/IceE/Mutex.h b/cppe/include/IceE/Mutex.h
index 67d131abcde..08a80bec3c0 100644
--- a/cppe/include/IceE/Mutex.h
+++ b/cppe/include/IceE/Mutex.h
@@ -87,7 +87,7 @@ private:
#else
struct LockState
{
- pthread_mutex_t* mutex;
+ pthread_mutex_t* mutex;
};
#endif
@@ -140,11 +140,11 @@ Mutex::tryLock() const
{
if(!TryEnterCriticalSection(&_mutex))
{
- return false;
+ return false;
}
if(_mutex.RecursionCount > 1)
{
- LeaveCriticalSection(&_mutex);
+ LeaveCriticalSection(&_mutex);
throw ThreadLockedException(__FILE__, __LINE__);
}
return true;
@@ -178,7 +178,7 @@ Mutex::Mutex() :
_mutex = CreateMutex(0, false, 0);
if(_mutex == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -188,7 +188,7 @@ Mutex::~Mutex()
BOOL rc = CloseHandle(_mutex);
if(rc == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -198,14 +198,14 @@ Mutex::lock() const
DWORD rc = WaitForSingleObject(_mutex, INFINITE);
if(rc != WAIT_OBJECT_0)
{
- if(rc == WAIT_FAILED)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
- }
- else
- {
- throw ThreadSyscallException(__FILE__, __LINE__, 0);
- }
+ if(rc == WAIT_FAILED)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ }
+ else
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, 0);
+ }
}
_recursionCount++;
}
@@ -216,18 +216,18 @@ Mutex::tryLock() const
DWORD rc = WaitForSingleObject(_mutex, 0);
if(rc != WAIT_OBJECT_0)
{
- return false;
+ return false;
}
else if(_recursionCount == 1)
{
- _recursionCount++;
- unlock();
+ _recursionCount++;
+ unlock();
throw ThreadLockedException(__FILE__, __LINE__);
}
else
{
- _recursionCount++;
- return true;
+ _recursionCount++;
+ return true;
}
}
@@ -238,7 +238,7 @@ Mutex::unlock() const
BOOL rc = ReleaseMutex(_mutex);
if(rc == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -287,7 +287,7 @@ Mutex::Mutex()
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -340,7 +340,7 @@ Mutex::unlock() const
int rc = pthread_mutex_unlock(&_mutex);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
diff --git a/cppe/include/IceE/Object.h b/cppe/include/IceE/Object.h
index 11fe467c968..b8cd0bf0727 100644
--- a/cppe/include/IceE/Object.h
+++ b/cppe/include/IceE/Object.h
@@ -65,10 +65,10 @@ protected:
static void __checkMode(OperationMode expected, OperationMode received) // Inline for performance reasons.
{
- if(expected != received)
- {
- __invalidMode(expected, received); // Not inlined.
- }
+ if(expected != received)
+ {
+ __invalidMode(expected, received); // Not inlined.
+ }
}
static void __invalidMode(OperationMode, OperationMode);
};
diff --git a/cppe/include/IceE/ObjectAdapter.h b/cppe/include/IceE/ObjectAdapter.h
index 5d44274bd3b..3eb4d4a226f 100644
--- a/cppe/include/IceE/ObjectAdapter.h
+++ b/cppe/include/IceE/ObjectAdapter.h
@@ -91,11 +91,11 @@ public:
private:
ObjectAdapter(const IceInternal::InstancePtr&, const CommunicatorPtr&, const IceInternal::ObjectAdapterFactoryPtr&,
- const std::string&, const std::string&
+ const std::string&, const std::string&
#ifdef ICEE_HAS_ROUTER
- , const RouterPrx&
+ , const RouterPrx&
#endif
- );
+ );
~ObjectAdapter();
friend class IceInternal::ObjectAdapterFactory;
diff --git a/cppe/include/IceE/Outgoing.h b/cppe/include/IceE/Outgoing.h
index 55ae1f42094..3e52544a35f 100644
--- a/cppe/include/IceE/Outgoing.h
+++ b/cppe/include/IceE/Outgoing.h
@@ -61,11 +61,11 @@ public:
enum State
{
- StateUnsent,
- StateInProgress,
- StateOK,
- StateUserException,
- StateLocalException
+ StateUnsent,
+ StateInProgress,
+ StateOK,
+ StateUserException,
+ StateLocalException
};
Outgoing(Ice::Connection*, Reference*, const std::string&, Ice::OperationMode, const Ice::Context*);
diff --git a/cppe/include/IceE/Proxy.h b/cppe/include/IceE/Proxy.h
index 99439e0f359..74c88f220a3 100644
--- a/cppe/include/IceE/Proxy.h
+++ b/cppe/include/IceE/Proxy.h
@@ -97,13 +97,13 @@ public:
ICE_DEPRECATED_API ::Ice::Int ice_hash() const
{
- return ice_getHash();
+ return ice_getHash();
}
ICE_API ::Ice::Int ice_getHash() const;
ICE_DEPRECATED_API ::Ice::CommunicatorPtr ice_communicator() const
{
- return ice_getCommunicator();
+ return ice_getCommunicator();
}
ICE_API ::Ice::CommunicatorPtr ice_getCommunicator() const;
@@ -148,21 +148,21 @@ public:
ICE_API ::Ice::Identity ice_getIdentity() const;
ICE_DEPRECATED_API ::Ice::ObjectPrx ice_newIdentity(const ::Ice::Identity& id) const
{
- return ice_identity(id);
+ return ice_identity(id);
}
ICE_API ::Ice::ObjectPrx ice_identity(const ::Ice::Identity&) const;
ICE_API ::Ice::Context ice_getContext() const;
ICE_DEPRECATED_API ::Ice::ObjectPrx ice_newContext(const ::Ice::Context& ctx) const
{
- return ice_context(ctx);
+ return ice_context(ctx);
}
ICE_API ::Ice::ObjectPrx ice_context(const ::Ice::Context&) const;
ICE_API const ::std::string& ice_getFacet() const;
ICE_DEPRECATED_API ::Ice::ObjectPrx ice_newFacet(const ::std::string& facet) const
{
- return ice_facet(facet);
+ return ice_facet(facet);
}
ICE_API ::Ice::ObjectPrx ice_facet(const ::std::string&) const;
@@ -226,14 +226,14 @@ public:
ICE_DEPRECATED_API ::Ice::ConnectionPtr ice_connection()
{
- return ice_getConnection();
+ return ice_getConnection();
}
ICE_API ::Ice::ConnectionPtr ice_getConnection();
ICE_API ::Ice::ConnectionPtr ice_getCachedConnection() const;
::IceInternal::ReferencePtr __reference() const
{
- return _reference;
+ return _reference;
}
ICE_API void __copyFrom(const ::Ice::ObjectPrx&);
@@ -258,15 +258,15 @@ private:
void setup(const ::IceInternal::ReferencePtr& ref)
{
- //
- // No need to synchronize "*this", as this operation is only
- // called upon initialization.
- //
-
- assert(!_reference);
- assert(!_connection);
-
- _reference = ref;
+ //
+ // No need to synchronize "*this", as this operation is only
+ // called upon initialization.
+ //
+
+ assert(!_reference);
+ assert(!_connection);
+
+ _reference = ref;
}
friend class ::IceInternal::ProxyFactory;
@@ -288,7 +288,7 @@ struct ProxyIdentityLess : std::binary_function<bool, ObjectPrx&, ObjectPrx&>
{
bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const
{
- return proxyIdentityLess(lhs, rhs);
+ return proxyIdentityLess(lhs, rhs);
}
};
@@ -296,7 +296,7 @@ struct ProxyIdentityEqual : std::binary_function<bool, ObjectPrx&, ObjectPrx&>
{
bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const
{
- return proxyIdentityEqual(lhs, rhs);
+ return proxyIdentityEqual(lhs, rhs);
}
};
@@ -304,7 +304,7 @@ struct ProxyIdentityAndFacetLess : std::binary_function<bool, ObjectPrx&, Object
{
bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const
{
- return proxyIdentityAndFacetLess(lhs, rhs);
+ return proxyIdentityAndFacetLess(lhs, rhs);
}
};
@@ -312,7 +312,7 @@ struct ProxyIdentityAndFacetEqual : std::binary_function<bool, ObjectPrx&, Objec
{
bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const
{
- return proxyIdentityAndFacetEqual(lhs, rhs);
+ return proxyIdentityAndFacetEqual(lhs, rhs);
}
};
@@ -391,14 +391,14 @@ checkedCastImpl(const ::Ice::ObjectPrx& b)
P d = 0;
if(b.get())
{
- typedef typename P::element_type T;
+ typedef typename P::element_type T;
- d = dynamic_cast<T*>(b.get());
- if(!d && b->ice_isA(T::ice_staticId()))
- {
- d = new T;
- d->__copyFrom(b);
- }
+ d = dynamic_cast<T*>(b.get());
+ if(!d && b->ice_isA(T::ice_staticId()))
+ {
+ d = new T;
+ d->__copyFrom(b);
+ }
}
return d;
}
@@ -409,14 +409,14 @@ checkedCastImpl(const ::Ice::ObjectPrx& b, const ::Ice::Context& ctx)
P d = 0;
if(b.get())
{
- typedef typename P::element_type T;
+ typedef typename P::element_type T;
- d = dynamic_cast<T*>(b.get());
- if(!d && b->ice_isA(T::ice_staticId(), ctx))
- {
- d = new T;
- d->__copyFrom(b);
- }
+ d = dynamic_cast<T*>(b.get());
+ if(!d && b->ice_isA(T::ice_staticId(), ctx))
+ {
+ d = new T;
+ d->__copyFrom(b);
+ }
}
return d;
}
@@ -427,14 +427,14 @@ uncheckedCastImpl(const ::Ice::ObjectPrx& b)
P d = 0;
if(b)
{
- typedef typename P::element_type T;
+ typedef typename P::element_type T;
- d = dynamic_cast<T*>(b.get());
- if(!d)
- {
- d = new T;
- d->__copyFrom(b);
- }
+ d = dynamic_cast<T*>(b.get());
+ if(!d)
+ {
+ d = new T;
+ d->__copyFrom(b);
+ }
}
return d;
}
@@ -473,7 +473,7 @@ uncheckedCastImpl< ::Ice::ObjectPrx>(const ::Ice::ObjectPrx& b, const std::strin
::Ice::ObjectPrx d = 0;
if(b)
{
- d = b->ice_facet(f);
+ d = b->ice_facet(f);
}
return d;
}
@@ -488,8 +488,8 @@ checkedCastImpl(const ::Ice::ObjectPrx& b, const std::string& f)
if(bb)
{
- d = new T;
- d->__copyFrom(bb);
+ d = new T;
+ d->__copyFrom(bb);
}
return d;
}
@@ -504,8 +504,8 @@ checkedCastImpl(const ::Ice::ObjectPrx& b, const std::string& f, const ::Ice::Co
if(bb)
{
- d = new T;
- d->__copyFrom(bb);
+ d = new T;
+ d->__copyFrom(bb);
}
return d;
}
@@ -516,11 +516,11 @@ uncheckedCastImpl(const ::Ice::ObjectPrx& b, const std::string& f)
P d = 0;
if(b)
{
- typedef typename P::element_type T;
+ typedef typename P::element_type T;
- ::Ice::ObjectPrx bb = b->ice_facet(f);
- d = new T;
- d->__copyFrom(bb);
+ ::Ice::ObjectPrx bb = b->ice_facet(f);
+ d = new T;
+ d->__copyFrom(bb);
}
return d;
}
diff --git a/cppe/include/IceE/ProxyHandle.h b/cppe/include/IceE/ProxyHandle.h
index 1dbf3743dea..3c04cf444d5 100644
--- a/cppe/include/IceE/ProxyHandle.h
+++ b/cppe/include/IceE/ProxyHandle.h
@@ -131,130 +131,130 @@ public:
ProxyHandle(T* p = 0)
{
- this->_ptr = p;
+ this->_ptr = p;
- if(this->_ptr)
- {
- upCast(this->_ptr)->__incRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__incRef();
+ }
}
template<typename Y>
ProxyHandle(const ProxyHandle<Y>& r)
{
- this->_ptr = r._ptr;
+ this->_ptr = r._ptr;
- if(this->_ptr)
- {
- upCast(this->_ptr)->__incRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__incRef();
+ }
}
template<typename Y>
ProxyHandle(const ::IceUtil::Handle<Y>& r)
{
- this->_ptr = r._ptr;
+ this->_ptr = r._ptr;
- if(this->_ptr)
- {
- upCast(this->_ptr)->__incRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__incRef();
+ }
}
ProxyHandle(const ProxyHandle& r)
{
- this->_ptr = r._ptr;
+ this->_ptr = r._ptr;
- if(this->_ptr)
- {
- upCast(this->_ptr)->__incRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__incRef();
+ }
}
~ProxyHandle()
{
- if(this->_ptr)
- {
- upCast(this->_ptr)->__decRef();
- }
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__decRef();
+ }
}
ProxyHandle& operator=(T* p)
{
- if(this->_ptr != p)
- {
- if(p)
- {
- upCast(p)->__incRef();
- }
-
- if(this->_ptr)
- {
- upCast(this->_ptr)->__decRef();
- }
-
- this->_ptr = p;
- }
- return *this;
+ if(this->_ptr != p)
+ {
+ if(p)
+ {
+ upCast(p)->__incRef();
+ }
+
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__decRef();
+ }
+
+ this->_ptr = p;
+ }
+ return *this;
}
template<typename Y>
ProxyHandle& operator=(const ProxyHandle<Y>& r)
{
- if(this->_ptr != r._ptr)
- {
- if(r._ptr)
- {
- upCast(r._ptr)->__incRef();
- }
-
- if(this->_ptr)
- {
- upCast(this->_ptr)->__decRef();
- }
-
- this->_ptr = r._ptr;
- }
- return *this;
+ if(this->_ptr != r._ptr)
+ {
+ if(r._ptr)
+ {
+ upCast(r._ptr)->__incRef();
+ }
+
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__decRef();
+ }
+
+ this->_ptr = r._ptr;
+ }
+ return *this;
}
template<typename Y>
ProxyHandle& operator=(const ::IceUtil::Handle<Y>& r)
{
- if(this->_ptr != r._ptr)
- {
- if(r._ptr)
- {
- upCast(r._ptr)->__incRef();
- }
-
- if(this->_ptr)
- {
- upCast(this->_ptr)->__decRef();
- }
-
- this->_ptr = r._ptr;
- }
- return *this;
+ if(this->_ptr != r._ptr)
+ {
+ if(r._ptr)
+ {
+ upCast(r._ptr)->__incRef();
+ }
+
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__decRef();
+ }
+
+ this->_ptr = r._ptr;
+ }
+ return *this;
}
ProxyHandle& operator=(const ProxyHandle& r)
{
- if(this->_ptr != r._ptr)
- {
- if(r._ptr)
- {
- upCast(r._ptr)->__incRef();
- }
-
- if(this->_ptr)
- {
- upCast(this->_ptr)->__decRef();
- }
-
- this->_ptr = r._ptr;
- }
- return *this;
+ if(this->_ptr != r._ptr)
+ {
+ if(r._ptr)
+ {
+ upCast(r._ptr)->__incRef();
+ }
+
+ if(this->_ptr)
+ {
+ upCast(this->_ptr)->__decRef();
+ }
+
+ this->_ptr = r._ptr;
+ }
+ return *this;
}
::IceProxy::Ice::Object* __upCast() const
@@ -265,39 +265,39 @@ public:
template<class Y>
static ProxyHandle checkedCast(const ProxyHandle<Y>& r)
{
- Y* tag = 0;
- return ::IceInternal::checkedCastHelper<T>(r, tag);
+ Y* tag = 0;
+ return ::IceInternal::checkedCastHelper<T>(r, tag);
}
template<class Y>
static ProxyHandle checkedCast(const ProxyHandle<Y>& r, const std::string& f)
{
- return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f);
+ return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f);
}
template<class Y>
static ProxyHandle checkedCast(const ProxyHandle<Y>& r, const ::Ice::Context& ctx)
{
- return ::IceInternal::checkedCastHelper<T>(r, ctx);
+ return ::IceInternal::checkedCastHelper<T>(r, ctx);
}
template<class Y>
static ProxyHandle checkedCast(const ProxyHandle<Y>& r, const std::string& f, const ::Ice::Context& ctx)
{
- return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f, ctx);
+ return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f, ctx);
}
template<class Y>
static ProxyHandle uncheckedCast(const ProxyHandle<Y>& r)
{
- Y* tag = 0;
- return::IceInternal::uncheckedCastHelper<T>(r, tag);
+ Y* tag = 0;
+ return::IceInternal::uncheckedCastHelper<T>(r, tag);
}
template<class Y>
static ProxyHandle uncheckedCast(const ProxyHandle<Y>& r, const std::string& f)
{
- return ::IceInternal::uncheckedCastImpl<ProxyHandle>(r, f);
+ return ::IceInternal::uncheckedCastImpl<ProxyHandle>(r, f);
}
};
diff --git a/cppe/include/IceE/RecMutex.h b/cppe/include/IceE/RecMutex.h
index 20cc59b9eb4..48cee28f5b8 100644
--- a/cppe/include/IceE/RecMutex.h
+++ b/cppe/include/IceE/RecMutex.h
@@ -77,13 +77,13 @@ private:
#ifdef _WIN32
struct LockState
{
- int count;
+ int count;
};
#else
struct LockState
{
- pthread_mutex_t* mutex;
- int count;
+ pthread_mutex_t* mutex;
+ int count;
};
#endif
diff --git a/cppe/include/IceE/ScopedArray.h b/cppe/include/IceE/ScopedArray.h
index 7b40d3736a6..5d8a72b99ea 100644
--- a/cppe/include/IceE/ScopedArray.h
+++ b/cppe/include/IceE/ScopedArray.h
@@ -28,25 +28,25 @@ public:
~ScopedArray()
{
if(_ptr != 0)
- {
- delete[] _ptr;
- }
+ {
+ delete[] _ptr;
+ }
}
void reset(T* ptr = 0)
{
- assert(ptr == 0 || ptr != _ptr);
+ assert(ptr == 0 || ptr != _ptr);
if(_ptr != 0)
- {
- delete[] _ptr;
- }
- _ptr = ptr;
+ {
+ delete[] _ptr;
+ }
+ _ptr = ptr;
}
T& operator[](size_t i) const
{
- assert(_ptr != 0);
- assert(i >= 0);
+ assert(_ptr != 0);
+ assert(i >= 0);
return _ptr[i];
}
@@ -58,8 +58,8 @@ public:
void swap(ScopedArray& a)
{
T* tmp = a._ptr;
- a._ptr = _ptr;
- _ptr = tmp;
+ a._ptr = _ptr;
+ _ptr = tmp;
}
private:
diff --git a/cppe/include/IceE/Shared.h b/cppe/include/IceE/Shared.h
index 7df23f2214a..6db635520ea 100644
--- a/cppe/include/IceE/Shared.h
+++ b/cppe/include/IceE/Shared.h
@@ -61,9 +61,9 @@ inline void ice_atomic_set(ice_atomic_t* v, int i)
inline void ice_atomic_inc(ice_atomic_t *v)
{
__asm__ __volatile__(
- "lock ; incl %0"
- :"=m" (v->counter)
- :"m" (v->counter));
+ "lock ; incl %0"
+ :"=m" (v->counter)
+ :"m" (v->counter));
}
/**
@@ -80,9 +80,9 @@ inline int ice_atomic_dec_and_test(ice_atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
- "lock ; decl %0; sete %1"
- :"=m" (v->counter), "=qm" (c)
- :"m" (v->counter) : "memory");
+ "lock ; decl %0; sete %1"
+ :"=m" (v->counter), "=qm" (c)
+ :"m" (v->counter) : "memory");
return c != 0;
}
@@ -97,10 +97,10 @@ inline int ice_atomic_exchange_add(int i, ice_atomic_t* v)
{
int tmp = i;
__asm__ __volatile__(
- "lock ; xadd %0,(%2)"
- :"+r"(tmp), "=m"(v->counter)
- :"r"(v), "m"(v->counter)
- : "memory");
+ "lock ; xadd %0,(%2)"
+ :"+r"(tmp), "=m"(v->counter)
+ :"r"(v), "m"(v->counter)
+ : "memory");
return tmp + i;
}
@@ -147,31 +147,31 @@ public:
void __incRef()
{
- assert(_ref >= 0);
- ++_ref;
+ assert(_ref >= 0);
+ ++_ref;
}
void __decRef()
{
- assert(_ref > 0);
- if(--_ref == 0)
- {
- if(!_noDelete)
- {
- _noDelete = true;
- delete this;
- }
- }
+ assert(_ref > 0);
+ if(--_ref == 0)
+ {
+ if(!_noDelete)
+ {
+ _noDelete = true;
+ delete this;
+ }
+ }
}
int __getRef() const
{
- return _ref;
+ return _ref;
}
void __setNoDelete(bool b)
{
- _noDelete = b;
+ _noDelete = b;
}
private:
@@ -199,49 +199,49 @@ public:
void __incRef()
{
#if defined(_WIN32)
- assert(InterlockedExchangeAdd(&_ref, 0) >= 0);
- InterlockedIncrement(&_ref);
+ assert(InterlockedExchangeAdd(&_ref, 0) >= 0);
+ InterlockedIncrement(&_ref);
#elif defined(ICEE_HAS_ATOMIC_FUNCTIONS)
- assert(ice_atomic_exchange_add(0, &_ref) >= 0);
- ice_atomic_inc(&_ref);
+ assert(ice_atomic_exchange_add(0, &_ref) >= 0);
+ ice_atomic_inc(&_ref);
#else
- _mutex.lock();
- assert(_ref >= 0);
- ++_ref;
- _mutex.unlock();
+ _mutex.lock();
+ assert(_ref >= 0);
+ ++_ref;
+ _mutex.unlock();
#endif
}
void __decRef()
{
#if defined(_WIN32)
- assert(InterlockedExchangeAdd(&_ref, 0) > 0);
- if(InterlockedDecrement(&_ref) == 0 && !_noDelete)
- {
- _noDelete = true;
- delete this;
- }
+ assert(InterlockedExchangeAdd(&_ref, 0) > 0);
+ if(InterlockedDecrement(&_ref) == 0 && !_noDelete)
+ {
+ _noDelete = true;
+ delete this;
+ }
#elif defined(ICEE_HAS_ATOMIC_FUNCTIONS)
- assert(ice_atomic_exchange_add(0, &_ref) > 0);
- if(ice_atomic_dec_and_test(&_ref) && !_noDelete)
- {
- _noDelete = true;
- delete this;
- }
+ assert(ice_atomic_exchange_add(0, &_ref) > 0);
+ if(ice_atomic_dec_and_test(&_ref) && !_noDelete)
+ {
+ _noDelete = true;
+ delete this;
+ }
#else
- _mutex.lock();
- bool doDelete = false;
- assert(_ref > 0);
- if(--_ref == 0)
- {
- doDelete = !_noDelete;
- _noDelete = true;
- }
- _mutex.unlock();
- if(doDelete)
- {
- delete this;
- }
+ _mutex.lock();
+ bool doDelete = false;
+ assert(_ref > 0);
+ if(--_ref == 0)
+ {
+ doDelete = !_noDelete;
+ _noDelete = true;
+ }
+ _mutex.unlock();
+ if(doDelete)
+ {
+ delete this;
+ }
#endif
}
diff --git a/cppe/include/IceE/StaticMutex.h b/cppe/include/IceE/StaticMutex.h
index a30fd67a90f..b69c7fadc03 100644
--- a/cppe/include/IceE/StaticMutex.h
+++ b/cppe/include/IceE/StaticMutex.h
@@ -88,7 +88,7 @@ private:
#else
struct LockState
{
- pthread_mutex_t* mutex;
+ pthread_mutex_t* mutex;
};
#endif
@@ -141,7 +141,7 @@ StaticMutex::lock() const
{
if(!initialized())
{
- initialize();
+ initialize();
}
EnterCriticalSection(_mutex);
#ifndef _WIN32_WCE
@@ -154,16 +154,16 @@ StaticMutex::tryLock() const
{
if(!initialized())
{
- initialize();
+ initialize();
}
if(!TryEnterCriticalSection(_mutex))
{
- return false;
+ return false;
}
#ifndef _WIN32_WCE
if(_mutex->RecursionCount > 1)
{
- LeaveCriticalSection(_mutex);
+ LeaveCriticalSection(_mutex);
throw ThreadLockedException(__FILE__, __LINE__);
}
#endif
@@ -195,7 +195,7 @@ StaticMutex::lock(LockState&) const
{
if(!initialized())
{
- initialize();
+ initialize();
}
EnterCriticalSection(_mutex);
}
@@ -243,7 +243,7 @@ StaticMutex::unlock() const
int rc = pthread_mutex_unlock(&_mutex);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
diff --git a/cppe/include/IceE/StringConverter.h b/cppe/include/IceE/StringConverter.h
index 649bd65c6af..d2e2f7eaec1 100644
--- a/cppe/include/IceE/StringConverter.h
+++ b/cppe/include/IceE/StringConverter.h
@@ -50,13 +50,13 @@ public:
// past the last byte returned by getMoreBytes).
//
virtual Byte* toUTF8(const charT* sourceStart, const charT* sourceEnd,
- UTF8Buffer&) const = 0;
+ UTF8Buffer&) const = 0;
//
// Unmarshals a UTF-8 sequence into a basic_string
//
virtual void fromUTF8(const Byte* sourceStart, const Byte* sourceEnd,
- std::basic_string<charT>& target) const = 0;
+ std::basic_string<charT>& target) const = 0;
};
typedef BasicStringConverter<char> StringConverter;
diff --git a/cppe/include/IceE/Thread.h b/cppe/include/IceE/Thread.h
index 24320757bbf..bb8f2bdd7a4 100644
--- a/cppe/include/IceE/Thread.h
+++ b/cppe/include/IceE/Thread.h
@@ -140,8 +140,8 @@ protected:
#endif
private:
- Thread(const Thread&); // Copying is forbidden
- void operator=(const Thread&); // Assignment is forbidden
+ Thread(const Thread&); // Copying is forbidden
+ void operator=(const Thread&); // Assignment is forbidden
};
typedef Handle<Thread> ThreadPtr;
diff --git a/cppe/include/IceE/Time.h b/cppe/include/IceE/Time.h
index 754fdcab135..991acffa63d 100644
--- a/cppe/include/IceE/Time.h
+++ b/cppe/include/IceE/Time.h
@@ -44,142 +44,142 @@ public:
Time operator-() const
{
- return Time(-_usec);
+ return Time(-_usec);
}
Time operator-(const Time& rhs) const
{
- return Time(_usec - rhs._usec);
+ return Time(_usec - rhs._usec);
}
Time operator+(const Time& rhs) const
{
- return Time(_usec + rhs._usec);
+ return Time(_usec + rhs._usec);
}
Time& operator+=(const Time& rhs)
{
- _usec += rhs._usec;
- return *this;
+ _usec += rhs._usec;
+ return *this;
}
Time& operator-=(const Time& rhs)
{
- _usec -= rhs._usec;
- return *this;
+ _usec -= rhs._usec;
+ return *this;
}
bool operator<(const Time& rhs) const
{
- return _usec < rhs._usec;
+ return _usec < rhs._usec;
}
bool operator<=(const Time& rhs) const
{
- return _usec <= rhs._usec;
+ return _usec <= rhs._usec;
}
bool operator>(const Time& rhs) const
{
- return _usec > rhs._usec;
+ return _usec > rhs._usec;
}
bool operator>=(const Time& rhs) const
{
- return _usec >= rhs._usec;
+ return _usec >= rhs._usec;
}
bool operator==(const Time& rhs) const
{
- return _usec == rhs._usec;
+ return _usec == rhs._usec;
}
bool operator!=(const Time& rhs) const
{
- return _usec != rhs._usec;
+ return _usec != rhs._usec;
}
double operator/(const Time& rhs) const
{
- return (double)_usec / (double)rhs._usec;
+ return (double)_usec / (double)rhs._usec;
}
Time& operator*=(int rhs)
{
- _usec *= rhs;
- return *this;
+ _usec *= rhs;
+ return *this;
}
Time operator*(int rhs) const
{
- Time t;
- t._usec = _usec * rhs;
- return t;
+ Time t;
+ t._usec = _usec * rhs;
+ return t;
}
Time& operator/=(int rhs)
{
- _usec /= rhs;
- return *this;
+ _usec /= rhs;
+ return *this;
}
Time operator/(int rhs) const
{
- Time t;
- t._usec = _usec / rhs;
- return t;
+ Time t;
+ t._usec = _usec / rhs;
+ return t;
}
Time& operator*=(Int64 rhs)
{
- _usec *= rhs;
- return *this;
+ _usec *= rhs;
+ return *this;
}
Time operator*(Int64 rhs) const
{
- Time t;
- t._usec = _usec * rhs;
- return t;
+ Time t;
+ t._usec = _usec * rhs;
+ return t;
}
Time& operator/=(Int64 rhs)
{
- _usec /= rhs;
- return *this;
+ _usec /= rhs;
+ return *this;
}
Time operator/(Int64 rhs) const
{
- Time t;
- t._usec = _usec / rhs;
- return t;
+ Time t;
+ t._usec = _usec / rhs;
+ return t;
}
Time& operator*=(double rhs)
{
- _usec = static_cast<Int64>(static_cast<double>(_usec) * rhs);
- return *this;
+ _usec = static_cast<Int64>(static_cast<double>(_usec) * rhs);
+ return *this;
}
Time operator*(double rhs) const
{
- Time t;
- t._usec = static_cast<Int64>(static_cast<double>(_usec) * rhs);
- return t;
+ Time t;
+ t._usec = static_cast<Int64>(static_cast<double>(_usec) * rhs);
+ return t;
}
Time& operator/=(double rhs)
{
- _usec = static_cast<Int64>(static_cast<double>(_usec) / rhs);
- return *this;
+ _usec = static_cast<Int64>(static_cast<double>(_usec) / rhs);
+ return *this;
}
Time operator/(double rhs) const
{
- Time t;
- t._usec = static_cast<Int64>(static_cast<double>(_usec) / rhs);
- return t;
+ Time t;
+ t._usec = static_cast<Int64>(static_cast<double>(_usec) / rhs);
+ return t;
}
private:
diff --git a/cppe/include/IceE/Unicode.h b/cppe/include/IceE/Unicode.h
index 5f225fe6605..f42c25b3f3c 100644
--- a/cppe/include/IceE/Unicode.h
+++ b/cppe/include/IceE/Unicode.h
@@ -97,10 +97,10 @@ ICE_API std::wstring stringToWstring(const std::string&);
enum ConversionResult
{
- conversionOK, /* conversion successful */
- sourceExhausted, /* partial character in source, but hit end */
- targetExhausted, /* insuff. room in target for conversion */
- sourceIllegal /* source sequence is illegal/malformed */
+ conversionOK, /* conversion successful */
+ sourceExhausted, /* partial character in source, but hit end */
+ targetExhausted, /* insuff. room in target for conversion */
+ sourceIllegal /* source sequence is illegal/malformed */
};
@@ -117,15 +117,15 @@ isLegalUTF8Sequence(const Byte* source, const Byte* end);
ICE_API ConversionResult
convertUTFWstringToUTF8(const wchar_t*& sourceStart, const wchar_t* sourceEnd,
- Byte*& targetStart, Byte* targetEnd, ConversionFlags flags);
+ Byte*& targetStart, Byte* targetEnd, ConversionFlags flags);
ICE_API ConversionResult
convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd,
- wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags);
+ wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags);
ICE_API ConversionResult
convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd,
- std::wstring& target, ConversionFlags flags);
+ std::wstring& target, ConversionFlags flags);
diff --git a/cppe/slice/IceE/Locator.ice b/cppe/slice/IceE/Locator.ice
index 086f2d3a0cd..1018140af1e 100644
--- a/cppe/slice/IceE/Locator.ice
+++ b/cppe/slice/IceE/Locator.ice
@@ -91,7 +91,7 @@ interface Locator
*
**/
["nonmutating", "cpp:const"] idempotent Object* findObjectById(Ice::Identity id)
- throws ObjectNotFoundException;
+ throws ObjectNotFoundException;
/**
*
@@ -107,7 +107,7 @@ interface Locator
*
**/
["nonmutating", "cpp:const"] idempotent Object* findAdapterById(string id)
- throws AdapterNotFoundException;
+ throws AdapterNotFoundException;
/**
*
@@ -152,7 +152,7 @@ interface LocatorRegistry
*
**/
idempotent void setAdapterDirectProxy(string id, Object* proxy)
- throws AdapterNotFoundException, AdapterAlreadyActiveException;
+ throws AdapterNotFoundException, AdapterAlreadyActiveException;
/**
*
@@ -180,7 +180,7 @@ interface LocatorRegistry
*
**/
["amd"] idempotent void setReplicatedAdapterDirectProxy(string adapterId, string replicaGroupId, Object* proxy)
- throws AdapterNotFoundException, AdapterAlreadyActiveException, InvalidReplicaGroupIdException;
+ throws AdapterNotFoundException, AdapterAlreadyActiveException, InvalidReplicaGroupIdException;
};
};
diff --git a/cppe/src/IceE/BasicStream.cpp b/cppe/src/IceE/BasicStream.cpp
index 62424ac4afd..32a01112f7a 100644
--- a/cppe/src/IceE/BasicStream.cpp
+++ b/cppe/src/IceE/BasicStream.cpp
@@ -27,23 +27,23 @@ IceInternal::BasicStream::clear()
{
while(_currentReadEncaps && _currentReadEncaps != &_preAllocatedReadEncaps)
{
- ReadEncaps* oldEncaps = _currentReadEncaps;
- _currentReadEncaps = _currentReadEncaps->previous;
- delete oldEncaps;
+ ReadEncaps* oldEncaps = _currentReadEncaps;
+ _currentReadEncaps = _currentReadEncaps->previous;
+ delete oldEncaps;
}
while(_currentWriteEncaps && _currentWriteEncaps != &_preAllocatedWriteEncaps)
{
- WriteEncaps* oldEncaps = _currentWriteEncaps;
- _currentWriteEncaps = _currentWriteEncaps->previous;
- delete oldEncaps;
+ WriteEncaps* oldEncaps = _currentWriteEncaps;
+ _currentWriteEncaps = _currentWriteEncaps->previous;
+ delete oldEncaps;
}
while(_seqDataStack)
{
- SeqData* oldSeqData = _seqDataStack;
- _seqDataStack = _seqDataStack->previous;
- delete oldSeqData;
+ SeqData* oldSeqData = _seqDataStack;
+ _seqDataStack = _seqDataStack->previous;
+ delete oldSeqData;
}
}
@@ -65,34 +65,34 @@ IceInternal::BasicStream::swap(BasicStream& other)
if(_currentReadEncaps || other._currentReadEncaps)
{
- _preAllocatedReadEncaps.swap(other._preAllocatedReadEncaps);
+ _preAllocatedReadEncaps.swap(other._preAllocatedReadEncaps);
- if(!_currentReadEncaps)
- {
- _currentReadEncaps = &_preAllocatedReadEncaps;
- other._currentReadEncaps = 0;
- }
- else if(!other._currentReadEncaps)
- {
- other._currentReadEncaps = &other._preAllocatedReadEncaps;
- _currentReadEncaps = 0;
- }
+ if(!_currentReadEncaps)
+ {
+ _currentReadEncaps = &_preAllocatedReadEncaps;
+ other._currentReadEncaps = 0;
+ }
+ else if(!other._currentReadEncaps)
+ {
+ other._currentReadEncaps = &other._preAllocatedReadEncaps;
+ _currentReadEncaps = 0;
+ }
}
if(_currentWriteEncaps || other._currentWriteEncaps)
{
- _preAllocatedWriteEncaps.swap(other._preAllocatedWriteEncaps);
+ _preAllocatedWriteEncaps.swap(other._preAllocatedWriteEncaps);
- if(!_currentWriteEncaps)
- {
- _currentWriteEncaps = &_preAllocatedWriteEncaps;
- other._currentWriteEncaps = 0;
- }
- else if(!other._currentWriteEncaps)
- {
- other._currentWriteEncaps = &other._preAllocatedWriteEncaps;
- _currentWriteEncaps = 0;
- }
+ if(!_currentWriteEncaps)
+ {
+ _currentWriteEncaps = &_preAllocatedWriteEncaps;
+ other._currentWriteEncaps = 0;
+ }
+ else if(!other._currentWriteEncaps)
+ {
+ other._currentWriteEncaps = &other._preAllocatedWriteEncaps;
+ _currentWriteEncaps = 0;
+ }
}
std::swap(_seqDataStack, other._seqDataStack);
@@ -152,7 +152,7 @@ IceInternal::BasicStream::startSeq(int numElements, int minSize)
{
if(numElements == 0) // Optimization to avoid pushing a useless stack frame.
{
- return;
+ return;
}
//
@@ -165,17 +165,17 @@ IceInternal::BasicStream::startSeq(int numElements, int minSize)
int bytesLeft = static_cast<int>(b.end() - i);
if(_seqDataStack->previous == 0) // Outermost sequence
{
- //
- // The sequence must fit within the message.
- //
- if(numElements * minSize > bytesLeft)
- {
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
+ //
+ // The sequence must fit within the message.
+ //
+ if(numElements * minSize > bytesLeft)
+ {
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
}
else // Nested sequence
{
- checkSeq(bytesLeft);
+ checkSeq(bytesLeft);
}
}
@@ -185,17 +185,17 @@ IceInternal::BasicStream::checkFixedSeq(int numElements, int elemSize)
int bytesLeft = static_cast<int>(b.end() - i);
if(_seqDataStack == 0) // Outermost sequence
{
- //
- // The sequence must fit within the message.
- //
- if(numElements * elemSize > bytesLeft)
- {
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
+ //
+ // The sequence must fit within the message.
+ //
+ if(numElements * elemSize > bytesLeft)
+ {
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
}
else // Nested sequence
{
- checkSeq(bytesLeft - numElements * elemSize);
+ checkSeq(bytesLeft - numElements * elemSize);
}
}
@@ -204,7 +204,7 @@ IceInternal::BasicStream::endSeq(int sz)
{
if(sz == 0) // Pop only if something was pushed previously.
{
- return;
+ return;
}
//
@@ -251,11 +251,11 @@ IceInternal::BasicStream::skipEncaps()
read(sz);
if(sz < 0)
{
- throwNegativeSizeException(__FILE__, __LINE__);
+ throwNegativeSizeException(__FILE__, __LINE__);
}
if(i - sizeof(Int) + sz > b.end())
{
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
i += sz - sizeof(Int);
}
@@ -294,7 +294,7 @@ IceInternal::BasicStream::startReadSlice()
read(sz);
if(sz < 0)
{
- throwNegativeSizeException(__FILE__, __LINE__);
+ throwNegativeSizeException(__FILE__, __LINE__);
}
_readSlice = i - b.begin();
}
@@ -311,12 +311,12 @@ IceInternal::BasicStream::skipSlice()
read(sz);
if(sz < 0)
{
- throwNegativeSizeException(__FILE__, __LINE__);
+ throwNegativeSizeException(__FILE__, __LINE__);
}
i += sz - sizeof(Int);
if(i > b.end())
{
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
}
@@ -325,9 +325,9 @@ IceInternal::BasicStream::writeBlob(const vector<Byte>& v)
{
if(!v.empty())
{
- Container::size_type pos = b.size();
- resize(pos + v.size());
- memcpy(&b[pos], &v[0], v.size());
+ Container::size_type pos = b.size();
+ resize(pos + v.size());
+ memcpy(&b[pos], &v[0], v.size());
}
}
@@ -336,16 +336,16 @@ IceInternal::BasicStream::readBlob(vector<Byte>& v, Int sz)
{
if(sz > 0)
{
- if(b.end() - i < sz)
- {
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
- vector<Byte>(i, i + sz).swap(v);
- i += sz;
+ if(b.end() - i < sz)
+ {
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+ vector<Byte>(i, i + sz).swap(v);
+ i += sz;
}
else
{
- v.clear();
+ v.clear();
}
}
@@ -356,14 +356,14 @@ IceInternal::BasicStream::read(pair<const Byte*, const Byte*>& v)
readSize(sz);
if(sz > 0)
{
- checkFixedSeq(sz, 1);
- v.first = i;
- v.second = i + sz;
- i += sz;
+ checkFixedSeq(sz, 1);
+ v.first = i;
+ v.second = i + sz;
+ i += sz;
}
else
{
- v.first = v.second = i;
+ v.first = v.second = i;
}
}
@@ -374,9 +374,9 @@ IceInternal::BasicStream::write(const Byte* begin, const Byte* end)
writeSize(sz);
if(sz > 0)
{
- Container::size_type pos = b.size();
- resize(pos + sz);
- memcpy(&b[pos], begin, sz);
+ Container::size_type pos = b.size();
+ resize(pos + sz);
+ memcpy(&b[pos], begin, sz);
}
}
@@ -387,9 +387,9 @@ IceInternal::BasicStream::write(const vector<bool>& v)
writeSize(sz);
if(sz > 0)
{
- Container::size_type pos = b.size();
- resize(pos + sz);
- copy(v.begin(), v.end(), b.begin() + pos);
+ Container::size_type pos = b.size();
+ resize(pos + sz);
+ copy(v.begin(), v.end(), b.begin() + pos);
}
}
@@ -403,7 +403,7 @@ struct BasicStreamWriteBoolHelper
{
for(int idx = 0; idx < sz; ++idx)
{
- b[pos + idx] = static_cast<Ice::Byte>(*(begin + idx));
+ b[pos + idx] = static_cast<Ice::Byte>(*(begin + idx));
}
}
};
@@ -428,7 +428,7 @@ IceInternal::BasicStream::write(const bool* begin, const bool* end)
{
Container::size_type pos = b.size();
resize(pos + sz);
- BasicStreamWriteBoolHelper<sizeof(bool)>::write(begin, pos, b, sz);
+ BasicStreamWriteBoolHelper<sizeof(bool)>::write(begin, pos, b, sz);
}
}
@@ -461,11 +461,11 @@ struct BasicStreamReadBoolHelper
bool* array = new bool[sz];
for(int idx = 0; idx < sz; ++idx)
{
- array[idx] = static_cast<bool>(*(i + idx));
+ array[idx] = static_cast<bool>(*(i + idx));
}
v.first = array;
v.second = array + sz;
- return array;
+ return array;
}
};
@@ -476,7 +476,7 @@ struct BasicStreamReadBoolHelper<1>
{
v.first = reinterpret_cast<bool*>(i);
v.second = reinterpret_cast<bool*>(i) + sz;
- return 0;
+ return 0;
}
};
@@ -491,7 +491,7 @@ IceInternal::BasicStream::read(pair<const bool*, const bool*>& v)
if(sz > 0)
{
checkFixedSeq(sz, 1);
- result = BasicStreamReadBoolHelper<sizeof(bool)>::read(v, sz, i);
+ result = BasicStreamReadBoolHelper<sizeof(bool)>::read(v, sz, i);
i += sz;
}
else
@@ -524,7 +524,7 @@ IceInternal::BasicStream::read(Short& v)
{
if(b.end() - i < static_cast<int>(sizeof(Short)))
{
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
const Byte* src = &(*i);
i += sizeof(Short);
@@ -546,19 +546,19 @@ IceInternal::BasicStream::write(const Short* begin, const Short* end)
writeSize(sz);
if(sz > 0)
{
- Container::size_type pos = b.size();
- resize(pos + sz * sizeof(Short));
+ Container::size_type pos = b.size();
+ resize(pos + sz * sizeof(Short));
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Short) - 1;
- Byte* dest = &(*(b.begin() + pos));
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest++ = *src--;
- *dest++ = *src--;
- src += 2 * sizeof(Short);
- }
+ const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Short) - 1;
+ Byte* dest = &(*(b.begin() + pos));
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest++ = *src--;
+ *dest++ = *src--;
+ src += 2 * sizeof(Short);
+ }
#else
- memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Short));
+ memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Short));
#endif
}
}
@@ -570,26 +570,26 @@ IceInternal::BasicStream::read(vector<Short>& v)
readSize(sz);
if(sz > 0)
{
- checkFixedSeq(sz, static_cast<int>(sizeof(Short)));
- Container::iterator begin = i;
- i += sz * static_cast<int>(sizeof(Short));
- v.resize(sz);
+ checkFixedSeq(sz, static_cast<int>(sizeof(Short)));
+ Container::iterator begin = i;
+ i += sz * static_cast<int>(sizeof(Short));
+ v.resize(sz);
#ifdef ICE_BIG_ENDIAN
- const Byte* src = &(*begin);
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Short) - 1;
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest-- = *src++;
- *dest-- = *src++;
- dest += 2 * sizeof(Short);
- }
+ const Byte* src = &(*begin);
+ Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Short) - 1;
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest-- = *src++;
+ *dest-- = *src++;
+ dest += 2 * sizeof(Short);
+ }
#else
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
+ copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
#endif
}
else
{
- v.clear();
+ v.clear();
}
}
@@ -641,21 +641,21 @@ IceInternal::BasicStream::write(const Int* begin, const Int* end)
writeSize(sz);
if(sz > 0)
{
- Container::size_type pos = b.size();
- resize(pos + sz * sizeof(Int));
+ Container::size_type pos = b.size();
+ resize(pos + sz * sizeof(Int));
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Int) - 1;
- Byte* dest = &(*(b.begin() + pos));
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- src += 2 * sizeof(Int);
- }
+ const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Int) - 1;
+ Byte* dest = &(*(b.begin() + pos));
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ src += 2 * sizeof(Int);
+ }
#else
- memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Int));
+ memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Int));
#endif
}
}
@@ -667,28 +667,28 @@ IceInternal::BasicStream::read(vector<Int>& v)
readSize(sz);
if(sz > 0)
{
- checkFixedSeq(sz, static_cast<int>(sizeof(Int)));
- Container::iterator begin = i;
- i += sz * static_cast<int>(sizeof(Int));
- v.resize(sz);
+ checkFixedSeq(sz, static_cast<int>(sizeof(Int)));
+ Container::iterator begin = i;
+ i += sz * static_cast<int>(sizeof(Int));
+ v.resize(sz);
#ifdef ICE_BIG_ENDIAN
- const Byte* src = &(*begin);
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Int) - 1;
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- dest += 2 * sizeof(Int);
- }
+ const Byte* src = &(*begin);
+ Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Int) - 1;
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ dest += 2 * sizeof(Int);
+ }
#else
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
+ copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
#endif
}
else
{
- v.clear();
+ v.clear();
}
}
@@ -769,7 +769,7 @@ IceInternal::BasicStream::read(Long& v)
{
if(b.end() - i < static_cast<int>(sizeof(Long)))
{
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
const Byte* src = &(*i);
i += sizeof(Long);
@@ -803,25 +803,25 @@ IceInternal::BasicStream::write(const Long* begin, const Long* end)
writeSize(sz);
if(sz > 0)
{
- Container::size_type pos = b.size();
- resize(pos + sz * sizeof(Long));
+ Container::size_type pos = b.size();
+ resize(pos + sz * sizeof(Long));
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Long) - 1;
- Byte* dest = &(*(b.begin() + pos));
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- src += 2 * sizeof(Long);
- }
+ const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Long) - 1;
+ Byte* dest = &(*(b.begin() + pos));
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ src += 2 * sizeof(Long);
+ }
#else
- memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Long));
+ memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Long));
#endif
}
}
@@ -833,32 +833,32 @@ IceInternal::BasicStream::read(vector<Long>& v)
readSize(sz);
if(sz > 0)
{
- checkFixedSeq(sz, static_cast<int>(sizeof(Long)));
- Container::iterator begin = i;
- i += sz * static_cast<int>(sizeof(Long));
- v.resize(sz);
+ checkFixedSeq(sz, static_cast<int>(sizeof(Long)));
+ Container::iterator begin = i;
+ i += sz * static_cast<int>(sizeof(Long));
+ v.resize(sz);
#ifdef ICE_BIG_ENDIAN
- const Byte* src = &(*begin);
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Long) - 1;
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- dest += 2 * sizeof(Long);
- }
+ const Byte* src = &(*begin);
+ Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Long) - 1;
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ dest += 2 * sizeof(Long);
+ }
#else
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
+ copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
#endif
}
else
{
- v.clear();
+ v.clear();
}
}
@@ -935,7 +935,7 @@ IceInternal::BasicStream::read(Float& v)
{
if(b.end() - i < static_cast<int>(sizeof(Float)))
{
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
const Byte* src = &(*i);
i += sizeof(Float);
@@ -961,21 +961,21 @@ IceInternal::BasicStream::write(const Float* begin, const Float* end)
writeSize(sz);
if(sz > 0)
{
- Container::size_type pos = b.size();
- resize(pos + sz * sizeof(Float));
+ Container::size_type pos = b.size();
+ resize(pos + sz * sizeof(Float));
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Float) - 1;
- Byte* dest = &(*(b.begin() + pos));
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- src += 2 * sizeof(Float);
- }
+ const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Float) - 1;
+ Byte* dest = &(*(b.begin() + pos));
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ src += 2 * sizeof(Float);
+ }
#else
- memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Float));
+ memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Float));
#endif
}
}
@@ -987,28 +987,28 @@ IceInternal::BasicStream::read(vector<Float>& v)
readSize(sz);
if(sz > 0)
{
- checkFixedSeq(sz, static_cast<int>(sizeof(Float)));
- Container::iterator begin = i;
- i += sz * static_cast<int>(sizeof(Float));
- v.resize(sz);
+ checkFixedSeq(sz, static_cast<int>(sizeof(Float)));
+ Container::iterator begin = i;
+ i += sz * static_cast<int>(sizeof(Float));
+ v.resize(sz);
#ifdef ICE_BIG_ENDIAN
- const Byte* src = &(*begin);
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Float) - 1;
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- dest += 2 * sizeof(Float);
- }
+ const Byte* src = &(*begin);
+ Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Float) - 1;
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ dest += 2 * sizeof(Float);
+ }
#else
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
+ copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
#endif
}
else
{
- v.clear();
+ v.clear();
}
}
@@ -1100,7 +1100,7 @@ IceInternal::BasicStream::read(Double& v)
{
if(b.end() - i < static_cast<int>(sizeof(Double)))
{
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
const Byte* src = &(*i);
i += sizeof(Double);
@@ -1145,28 +1145,28 @@ IceInternal::BasicStream::write(const Double* begin, const Double* end)
writeSize(sz);
if(sz > 0)
{
- Container::size_type pos = b.size();
- resize(pos + sz * sizeof(Double));
+ Container::size_type pos = b.size();
+ resize(pos + sz * sizeof(Double));
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Double) - 1;
- Byte* dest = &(*(b.begin() + pos));
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- src += 2 * sizeof(Double);
- }
+ const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Double) - 1;
+ Byte* dest = &(*(b.begin() + pos));
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ src += 2 * sizeof(Double);
+ }
#elif defined(__arm__) && defined(__linux)
- const Byte* src = reinterpret_cast<const Byte*>(begin);
- Byte* dest = &(*(b.begin() + pos));
- for(int j = 0 ; j < sz ; ++j)
- {
+ const Byte* src = reinterpret_cast<const Byte*>(begin);
+ Byte* dest = &(*(b.begin() + pos));
+ for(int j = 0 ; j < sz ; ++j)
+ {
dest[4] = *src++;
dest[5] = *src++;
dest[6] = *src++;
@@ -1176,9 +1176,9 @@ IceInternal::BasicStream::write(const Double* begin, const Double* end)
dest[2] = *src++;
dest[3] = *src++;
dest += sizeof(Double);
- }
+ }
#else
- memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Double));
+ memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Double));
#endif
}
}
@@ -1190,47 +1190,47 @@ IceInternal::BasicStream::read(vector<Double>& v)
readSize(sz);
if(sz > 0)
{
- checkFixedSeq(sz, static_cast<int>(sizeof(Double)));
- Container::iterator begin = i;
- i += sz * static_cast<int>(sizeof(Double));
- v.resize(sz);
+ checkFixedSeq(sz, static_cast<int>(sizeof(Double)));
+ Container::iterator begin = i;
+ i += sz * static_cast<int>(sizeof(Double));
+ v.resize(sz);
#ifdef ICE_BIG_ENDIAN
- const Byte* src = &(*begin);
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Double) - 1;
- for(int j = 0 ; j < sz ; ++j)
- {
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- *dest-- = *src++;
- dest += 2 * sizeof(Double);
- }
+ const Byte* src = &(*begin);
+ Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Double) - 1;
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ *dest-- = *src++;
+ dest += 2 * sizeof(Double);
+ }
#elif defined(__arm__) && defined(__linux)
- const Byte* src = &(*begin);
- Byte* dest = reinterpret_cast<Byte*>(&v[0]);
- for(int j = 0 ; j < sz ; ++j)
- {
- dest[4] = *src++;
- dest[5] = *src++;
- dest[6] = *src++;
- dest[7] = *src++;
- dest[0] = *src++;
- dest[1] = *src++;
- dest[2] = *src++;
- dest[3] = *src++;
- dest += sizeof(Double);
- }
+ const Byte* src = &(*begin);
+ Byte* dest = reinterpret_cast<Byte*>(&v[0]);
+ for(int j = 0 ; j < sz ; ++j)
+ {
+ dest[4] = *src++;
+ dest[5] = *src++;
+ dest[6] = *src++;
+ dest[7] = *src++;
+ dest[0] = *src++;
+ dest[1] = *src++;
+ dest[2] = *src++;
+ dest[3] = *src++;
+ dest += sizeof(Double);
+ }
#else
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
+ copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
#endif
}
else
{
- v.clear();
+ v.clear();
}
}
@@ -1381,10 +1381,10 @@ IceInternal::BasicStream::write(const string* begin, const string* end, bool con
writeSize(sz);
if(sz > 0)
{
- for(int i = 0; i < sz; ++i)
- {
- write(begin[i], convert);
- }
+ for(int i = 0; i < sz; ++i)
+ {
+ write(begin[i], convert);
+ }
}
}
@@ -1395,19 +1395,19 @@ IceInternal::BasicStream::read(vector<string>& v, bool convert)
readSize(sz);
if(sz > 0)
{
- startSeq(sz, 1);
- v.resize(sz);
- for(int i = 0; i < sz; ++i)
- {
- read(v[i], convert);
- checkSeq();
- endElement();
- }
- endSeq(sz);
+ startSeq(sz, 1);
+ v.resize(sz);
+ for(int i = 0; i < sz; ++i)
+ {
+ read(v[i], convert);
+ checkSeq();
+ endElement();
+ }
+ endSeq(sz);
}
else
{
- v.clear();
+ v.clear();
}
}
@@ -1510,7 +1510,7 @@ IceInternal::BasicStream::read(vector<wstring>& v)
}
else
{
- v.clear();
+ v.clear();
}
}
@@ -1545,33 +1545,33 @@ IceInternal::BasicStream::throwException()
read(id, false);
for(;;)
{
- //
- // Look for a factory for this ID.
- //
- UserExceptionFactoryPtr factory = factoryTable->getExceptionFactory(id);
- if(factory)
- {
- //
- // Got factory -- get the factory to instantiate the
- // exception, initialize the exception members, and throw
- // the exception.
- //
- try
- {
- factory->createAndThrow();
- }
- catch(UserException& ex)
- {
- ex.__read(this, false);
- assert(!usesClasses);
- ex.ice_throw();
- }
- }
- else
- {
- skipSlice(); // Slice off what we don't understand.
- read(id, false); // Read type id for next slice.
- }
+ //
+ // Look for a factory for this ID.
+ //
+ UserExceptionFactoryPtr factory = factoryTable->getExceptionFactory(id);
+ if(factory)
+ {
+ //
+ // Got factory -- get the factory to instantiate the
+ // exception, initialize the exception members, and throw
+ // the exception.
+ //
+ try
+ {
+ factory->createAndThrow();
+ }
+ catch(UserException& ex)
+ {
+ ex.__read(this, false);
+ assert(!usesClasses);
+ ex.ice_throw();
+ }
+ }
+ else
+ {
+ skipSlice(); // Slice off what we don't understand.
+ read(id, false); // Read type id for next slice.
+ }
}
//
diff --git a/cppe/src/IceE/Buffer.cpp b/cppe/src/IceE/Buffer.cpp
index 55ac2fb2fb6..94025d59d1e 100644
--- a/cppe/src/IceE/Buffer.cpp
+++ b/cppe/src/IceE/Buffer.cpp
@@ -35,32 +35,32 @@ IceInternal::Buffer::Container::swap(Container& other)
#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION
if(_buf == _fixed)
{
- if(other._buf == other._fixed)
- {
- value_type tmp[ICE_BUFFER_FIXED_SIZE];
- memcpy(tmp, _fixed, _size);
- memcpy(_fixed, other._fixed, other._size);
- memcpy(other._fixed, tmp, _size);
- }
- else
- {
- _buf = other._buf;
- memcpy(other._fixed, _fixed, _size);
- other._buf = other._fixed;
- }
+ if(other._buf == other._fixed)
+ {
+ value_type tmp[ICE_BUFFER_FIXED_SIZE];
+ memcpy(tmp, _fixed, _size);
+ memcpy(_fixed, other._fixed, other._size);
+ memcpy(other._fixed, tmp, _size);
+ }
+ else
+ {
+ _buf = other._buf;
+ memcpy(other._fixed, _fixed, _size);
+ other._buf = other._fixed;
+ }
}
else
{
- if(other._buf == other._fixed)
- {
- other._buf = _buf;
- memcpy(_fixed, other._fixed, other._size);
- _buf = _fixed;
- }
- else
- {
- std::swap(_buf, other._buf);
- }
+ if(other._buf == other._fixed)
+ {
+ other._buf = _buf;
+ memcpy(_fixed, other._fixed, other._size);
+ _buf = _fixed;
+ }
+ else
+ {
+ std::swap(_buf, other._buf);
+ }
}
#else
std::swap(_buf, other._buf);
@@ -77,8 +77,8 @@ IceInternal::Buffer::Container::clear()
#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION
if(_buf != _fixed)
{
- free(_buf);
- _buf = _fixed;
+ free(_buf);
+ _buf = _fixed;
}
_size = 0;
_capacity = ICE_BUFFER_FIXED_SIZE;
@@ -95,43 +95,43 @@ IceInternal::Buffer::Container::reserve(size_type n)
{
if(n > _capacity)
{
- _capacity = std::max<size_type>(n, std::min(2 * _capacity, _maxCapacity));
- _capacity = std::max<size_type>(static_cast<size_type>(240), _capacity);
+ _capacity = std::max<size_type>(n, std::min(2 * _capacity, _maxCapacity));
+ _capacity = std::max<size_type>(static_cast<size_type>(240), _capacity);
}
else if(n < _capacity)
{
- _capacity = n;
+ _capacity = n;
}
else
{
- return;
+ return;
}
#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION
if(_buf != _fixed)
{
- _buf = reinterpret_cast<pointer>(realloc(_buf, _capacity));
+ _buf = reinterpret_cast<pointer>(realloc(_buf, _capacity));
}
else if(_capacity > ICE_BUFFER_FIXED_SIZE)
{
- _buf = reinterpret_cast<pointer>(malloc(_capacity));
- memcpy(_buf, _fixed, _size);
+ _buf = reinterpret_cast<pointer>(malloc(_capacity));
+ memcpy(_buf, _fixed, _size);
}
#else
if(_buf)
{
- _buf = reinterpret_cast<pointer>(realloc(_buf, _capacity));
+ _buf = reinterpret_cast<pointer>(realloc(_buf, _capacity));
}
else
{
- _buf = reinterpret_cast<pointer>(malloc(_capacity));
+ _buf = reinterpret_cast<pointer>(malloc(_capacity));
}
#endif
-
+
if(!_buf)
{
- SyscallException ex(__FILE__, __LINE__);
- ex.error = getSystemErrno();
- throw ex;
+ SyscallException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
}
}
diff --git a/cppe/src/IceE/Communicator.cpp b/cppe/src/IceE/Communicator.cpp
index 2bfa0b04ee2..c25d2860d09 100644
--- a/cppe/src/IceE/Communicator.cpp
+++ b/cppe/src/IceE/Communicator.cpp
@@ -102,9 +102,9 @@ Ice::Communicator::createObjectAdapterWithEndpoints(const string& name, const st
{
return _instance->objectAdapterFactory()->createObjectAdapter(name, endpoints
#ifdef ICEE_HAS_ROUTER
- , 0
+ , 0
# endif
- );
+ );
}
#ifdef ICEE_HAS_ROUTER
@@ -178,12 +178,12 @@ Ice::Communicator::Communicator(const InitializationData& initData)
__setNoDelete(true);
try
{
- const_cast<InstancePtr&>(_instance) = new Instance(this, initData);
+ const_cast<InstancePtr&>(_instance) = new Instance(this, initData);
}
catch(...)
{
- __setNoDelete(false);
- throw;
+ __setNoDelete(false);
+ throw;
}
__setNoDelete(false);
}
@@ -192,8 +192,8 @@ Ice::Communicator::~Communicator()
{
if(!_instance->destroyed())
{
- Warning out(_instance->initializationData().logger);
- out << "Ice::Communicator::destroy() has not been called";
+ Warning out(_instance->initializationData().logger);
+ out << "Ice::Communicator::destroy() has not been called";
}
}
@@ -202,11 +202,11 @@ Ice::Communicator::finishSetup(int& argc, char* argv[])
{
try
{
- _instance->finishSetup(argc, argv);
+ _instance->finishSetup(argc, argv);
}
catch(...)
{
- _instance->destroy();
- throw;
+ _instance->destroy();
+ throw;
}
}
diff --git a/cppe/src/IceE/Cond.cpp b/cppe/src/IceE/Cond.cpp
index a761cb9f894..760cdd612d8 100644
--- a/cppe/src/IceE/Cond.cpp
+++ b/cppe/src/IceE/Cond.cpp
@@ -20,7 +20,7 @@ IceUtil::Semaphore::Semaphore(long initial)
_sem = CreateSemaphore(0, initial, 0x7fffffff, 0);
if(_sem == INVALID_HANDLE_VALUE)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -35,7 +35,7 @@ IceUtil::Semaphore::wait() const
int rc = WaitForSingleObject(_sem, INFINITE);
if(rc != WAIT_OBJECT_0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -47,7 +47,7 @@ IceUtil::Semaphore::timedWait(const Time& timeout) const
int rc = WaitForSingleObject(_sem, msec);
if(rc != WAIT_TIMEOUT && rc != WAIT_OBJECT_0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
return rc != WAIT_TIMEOUT;
}
@@ -58,7 +58,7 @@ IceUtil::Semaphore::post(int count) const
int rc = ReleaseSemaphore(_sem, count, 0);
if(rc == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -97,26 +97,26 @@ IceUtil::Cond::wake(bool broadcast)
if(_unblocked != 0)
{
- _blocked -= _unblocked;
- _unblocked = 0;
+ _blocked -= _unblocked;
+ _unblocked = 0;
}
if(_blocked > 0)
{
- //
- // Unblock some number of waiters.
- //
- _toUnblock = (broadcast) ? _blocked : 1;
- _internal.unlock();
- _queue.post();
+ //
+ // Unblock some number of waiters.
+ //
+ _toUnblock = (broadcast) ? _blocked : 1;
+ _internal.unlock();
+ _queue.post();
}
else
{
- //
- // Otherwise no blocked waiters, release gate & mutex.
- //
- _gate.post();
- _internal.unlock();
+ //
+ // Otherwise no blocked waiters, release gate & mutex.
+ //
+ _gate.post();
+ _internal.unlock();
}
}
@@ -136,26 +136,26 @@ IceUtil::Cond::postWait(bool timedOut) const
if(_toUnblock != 0)
{
- bool last = --_toUnblock == 0;
- _internal.unlock();
-
- if(timedOut)
- {
- _queue.wait();
- }
-
- if(last)
- {
- _gate.post();
- }
- else
- {
- _queue.post();
- }
+ bool last = --_toUnblock == 0;
+ _internal.unlock();
+
+ if(timedOut)
+ {
+ _queue.wait();
+ }
+
+ if(last)
+ {
+ _gate.post();
+ }
+ else
+ {
+ _queue.post();
+ }
}
else
{
- _internal.unlock();
+ _internal.unlock();
}
}
@@ -164,13 +164,13 @@ IceUtil::Cond::dowait() const
{
try
{
- _queue.wait();
- postWait(false);
+ _queue.wait();
+ postWait(false);
}
catch(...)
{
- postWait(false);
- throw;
+ postWait(false);
+ throw;
}
}
@@ -179,14 +179,14 @@ IceUtil::Cond::timedDowait(const Time& timeout) const
{
try
{
- bool rc = _queue.timedWait(timeout);
- postWait(!rc);
- return rc;
+ bool rc = _queue.timedWait(timeout);
+ postWait(!rc);
+ return rc;
}
catch(...)
{
- postWait(false);
- throw;
+ postWait(false);
+ throw;
}
}
@@ -201,19 +201,19 @@ IceUtil::Cond::Cond()
rc = pthread_condattr_init(&attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
rc = pthread_cond_init(&_cond, &attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
rc = pthread_condattr_destroy(&attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -230,7 +230,7 @@ IceUtil::Cond::signal()
int rc = pthread_cond_signal(&_cond);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -240,7 +240,7 @@ IceUtil::Cond::broadcast()
int rc = pthread_cond_broadcast(&_cond);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
diff --git a/cppe/src/IceE/Connection.cpp b/cppe/src/IceE/Connection.cpp
index 122f61a6aaf..f133b99f572 100644
--- a/cppe/src/IceE/Connection.cpp
+++ b/cppe/src/IceE/Connection.cpp
@@ -41,13 +41,13 @@ Ice::Connection::waitForValidation()
while(_state == StateNotValidated)
{
- wait();
+ wait();
}
if(_state >= StateClosing)
{
- assert(_exception.get());
- _exception->ice_throw();
+ assert(_exception.get());
+ _exception->ice_throw();
}
}
@@ -75,18 +75,18 @@ Ice::Connection::destroy(DestructionReason reason)
switch(reason)
{
#ifndef ICEE_PURE_CLIENT
- case ObjectAdapterDeactivated:
- {
- setState(StateClosing, ObjectAdapterDeactivatedException(__FILE__, __LINE__));
- break;
- }
+ case ObjectAdapterDeactivated:
+ {
+ setState(StateClosing, ObjectAdapterDeactivatedException(__FILE__, __LINE__));
+ break;
+ }
#endif
- case CommunicatorDestroyed:
- {
- setState(StateClosing, CommunicatorDestroyedException(__FILE__, __LINE__));
- break;
- }
+ case CommunicatorDestroyed:
+ {
+ setState(StateClosing, CommunicatorDestroyedException(__FILE__, __LINE__));
+ break;
+ }
}
}
@@ -97,25 +97,25 @@ Ice::Connection::close(bool force)
if(force)
{
- setState(StateClosed, ForcedCloseConnectionException(__FILE__, __LINE__));
+ setState(StateClosed, ForcedCloseConnectionException(__FILE__, __LINE__));
}
else
{
#ifndef ICEE_PURE_BLOCKING_CLIENT
- //
- // If we do a graceful shutdown, then we wait until all
- // outstanding requests have been completed. Otherwise, the
- // CloseConnectionException will cause all outstanding
- // requests to be retried, regardless of whether the server
- // has processed them or not.
- //
- while(!_requests.empty())
- {
- wait();
- }
+ //
+ // If we do a graceful shutdown, then we wait until all
+ // outstanding requests have been completed. Otherwise, the
+ // CloseConnectionException will cause all outstanding
+ // requests to be retried, regardless of whether the server
+ // has processed them or not.
+ //
+ while(!_requests.empty())
+ {
+ wait();
+ }
#endif
- setState(StateClosing, CloseConnectionException(__FILE__, __LINE__));
+ setState(StateClosing, CloseConnectionException(__FILE__, __LINE__));
}
}
@@ -140,32 +140,32 @@ Ice::Connection::isFinished() const
#endif
{
- //
- // We can use trylock here, because as long as there are still
- // threads operating in this connection object, connection
- // destruction is considered as not yet finished.
- //
- IceUtil::Monitor<IceUtil::Mutex>::TryLock sync(*this);
-
- if(!sync.acquired())
- {
- return false;
- }
+ //
+ // We can use trylock here, because as long as there are still
+ // threads operating in this connection object, connection
+ // destruction is considered as not yet finished.
+ //
+ IceUtil::Monitor<IceUtil::Mutex>::TryLock sync(*this);
+
+ if(!sync.acquired())
+ {
+ return false;
+ }
- if(_transceiver != 0
+ if(_transceiver != 0
#ifndef ICEE_PURE_BLOCKING_CLIENT
- || _dispatchCount != 0 || (_threadPerConnection && _threadPerConnection->isAlive())
+ || _dispatchCount != 0 || (_threadPerConnection && _threadPerConnection->isAlive())
#endif
- )
- {
- return false;
- }
+ )
+ {
+ return false;
+ }
- assert(_state == StateClosed);
+ assert(_state == StateClosed);
#ifndef ICEE_PURE_BLOCKING_CLIENT
- threadPerConnection = _threadPerConnection;
- _threadPerConnection = 0;
+ threadPerConnection = _threadPerConnection;
+ _threadPerConnection = 0;
#endif
}
@@ -200,7 +200,7 @@ Ice::Connection::waitUntilHolding() const
while(_state < StateHolding || _dispatchCount > 0)
{
- wait();
+ wait();
}
}
@@ -214,74 +214,74 @@ Ice::Connection::waitUntilFinished()
#endif
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- //
- // We wait indefinitely until connection closing has been
- // initiated. We also wait indefinitely until all outstanding
- // requests are completed. Otherwise we couldn't guarantee
- // that there are no outstanding calls when deactivate() is
- // called on the servant locators.
- //
- while(_state < StateClosing || _dispatchCount > 0)
- {
- wait();
- }
-
- //
- // Now we must wait until close() has been called on the
- // transceiver.
- //
- while(_transceiver)
- {
- if(_state != StateClosed && _endpoint->timeout() >= 0)
- {
- IceUtil::Time timeout = IceUtil::Time::milliSeconds(_endpoint->timeout());
- IceUtil::Time waitTime = _stateTime + timeout - IceUtil::Time::now();
-
- if(waitTime > IceUtil::Time())
- {
- //
- // We must wait a bit longer until we close this
- // connection.
- //
- if(!timedWait(waitTime))
- {
- setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__));
- }
- }
- else
- {
- //
- // We already waited long enough, so let's close this
- // connection!
- //
- setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__));
- }
-
- //
- // No return here, we must still wait until close() is
- // called on the _transceiver.
- //
- }
- else
- {
- wait();
- }
- }
-
- assert(_state == StateClosed);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ //
+ // We wait indefinitely until connection closing has been
+ // initiated. We also wait indefinitely until all outstanding
+ // requests are completed. Otherwise we couldn't guarantee
+ // that there are no outstanding calls when deactivate() is
+ // called on the servant locators.
+ //
+ while(_state < StateClosing || _dispatchCount > 0)
+ {
+ wait();
+ }
+
+ //
+ // Now we must wait until close() has been called on the
+ // transceiver.
+ //
+ while(_transceiver)
+ {
+ if(_state != StateClosed && _endpoint->timeout() >= 0)
+ {
+ IceUtil::Time timeout = IceUtil::Time::milliSeconds(_endpoint->timeout());
+ IceUtil::Time waitTime = _stateTime + timeout - IceUtil::Time::now();
+
+ if(waitTime > IceUtil::Time())
+ {
+ //
+ // We must wait a bit longer until we close this
+ // connection.
+ //
+ if(!timedWait(waitTime))
+ {
+ setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__));
+ }
+ }
+ else
+ {
+ //
+ // We already waited long enough, so let's close this
+ // connection!
+ //
+ setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__));
+ }
+
+ //
+ // No return here, we must still wait until close() is
+ // called on the _transceiver.
+ //
+ }
+ else
+ {
+ wait();
+ }
+ }
+
+ assert(_state == StateClosed);
#ifndef ICEE_PURE_BLOCKING_CLIENT
- threadPerConnection = _threadPerConnection;
- _threadPerConnection = 0;
+ threadPerConnection = _threadPerConnection;
+ _threadPerConnection = 0;
#endif
}
#ifndef ICEE_PURE_BLOCKING_CLIENT
if(threadPerConnection)
{
- threadPerConnection->getThreadControl().join();
+ threadPerConnection->getThreadControl().join();
}
#endif
}
@@ -292,194 +292,194 @@ Ice::Connection::sendRequest(BasicStream* os, Outgoing* out)
bool requestSent = false;
try
{
- Lock sendSync(_sendMonitor);
- if(!_transceiver)
- {
- assert(_exception.get());
- //
- // If the connection is closed before we even have a chance
- // to send our request, we always try to send the request
- // again.
- //
- throw LocalExceptionWrapper(*_exception.get(), true);
- }
-
- Int requestId;
- if(out)
- {
- //
- // Create a new unique request ID.
- //
- requestId = _nextRequestId++;
- if(requestId <= 0)
- {
- _nextRequestId = 1;
- requestId = _nextRequestId++;
- }
-
- //
- // Fill in the request ID.
- //
- Byte* dest = &(os->b[0]) + headerSize;
+ Lock sendSync(_sendMonitor);
+ if(!_transceiver)
+ {
+ assert(_exception.get());
+ //
+ // If the connection is closed before we even have a chance
+ // to send our request, we always try to send the request
+ // again.
+ //
+ throw LocalExceptionWrapper(*_exception.get(), true);
+ }
+
+ Int requestId;
+ if(out)
+ {
+ //
+ // Create a new unique request ID.
+ //
+ requestId = _nextRequestId++;
+ if(requestId <= 0)
+ {
+ _nextRequestId = 1;
+ requestId = _nextRequestId++;
+ }
+
+ //
+ // Fill in the request ID.
+ //
+ Byte* dest = &(os->b[0]) + headerSize;
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(&requestId) + sizeof(Ice::Int) - 1;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest = *src;
+ const Byte* src = reinterpret_cast<const Byte*>(&requestId) + sizeof(Ice::Int) - 1;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest = *src;
#else
- const Byte* src = reinterpret_cast<const Byte*>(&requestId);
- *dest++ = *src++;
- *dest++ = *src++;
- *dest++ = *src++;
- *dest = *src;
+ const Byte* src = reinterpret_cast<const Byte*>(&requestId);
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest = *src;
#endif
#ifndef ICEE_PURE_BLOCKING_CLIENT
- if(!_blocking)
- {
- _requestsHint = _requests.insert(_requests.end(), pair<const Int, Outgoing*>(requestId, out));
- }
+ if(!_blocking)
+ {
+ _requestsHint = _requests.insert(_requests.end(), pair<const Int, Outgoing*>(requestId, out));
+ }
#endif
- }
+ }
- //
- // Fill in the message size.
- //
- const Int sz = static_cast<Int>(os->b.size());
- Byte* dest = &(os->b[0]) + 10;
+ //
+ // Fill in the message size.
+ //
+ const Int sz = static_cast<Int>(os->b.size());
+ Byte* dest = &(os->b[0]) + 10;
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest = *src;
+ const Byte* src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest = *src;
#else
- const Byte* src = reinterpret_cast<const Byte*>(&sz);
- *dest++ = *src++;
- *dest++ = *src++;
- *dest++ = *src++;
- *dest = *src;
+ const Byte* src = reinterpret_cast<const Byte*>(&sz);
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest = *src;
#endif
-
- //
- // Send the request.
- //
- os->i = os->b.begin();
- if(_traceLevels->protocol >= 1)
- {
- traceRequest("sending request", *os, _logger, _traceLevels);
- }
- _transceiver->write(*os);
- requestSent = true;
-
- if(!out)
- {
- return;
- }
-
+
+ //
+ // Send the request.
+ //
+ os->i = os->b.begin();
+ if(_traceLevels->protocol >= 1)
+ {
+ traceRequest("sending request", *os, _logger, _traceLevels);
+ }
+ _transceiver->write(*os);
+ requestSent = true;
+
+ if(!out)
+ {
+ return;
+ }
+
#ifndef ICEE_PURE_BLOCKING_CLIENT
- if(_blocking)
- {
+ if(_blocking)
+ {
#endif
- //
- // Re-use the stream for reading the reply.
- //
- os->reset();
-
- Int receivedRequestId = 0;
+ //
+ // Re-use the stream for reading the reply.
+ //
+ os->reset();
+
+ Int receivedRequestId = 0;
#ifndef ICEE_PURE_CLIENT
- Int invokeNum = 0;
- readStreamAndParseMessage(*os, receivedRequestId, invokeNum);
- if(invokeNum > 0)
- {
- throwUnknownMessageException(__FILE__, __LINE__);
- }
- else if(requestId != receivedRequestId)
- {
- throwUnknownRequestIdException(__FILE__, __LINE__);
- }
+ Int invokeNum = 0;
+ readStreamAndParseMessage(*os, receivedRequestId, invokeNum);
+ if(invokeNum > 0)
+ {
+ throwUnknownMessageException(__FILE__, __LINE__);
+ }
+ else if(requestId != receivedRequestId)
+ {
+ throwUnknownRequestIdException(__FILE__, __LINE__);
+ }
#else
- readStreamAndParseMessage(*os, receivedRequestId);
- if(requestId != receivedRequestId)
- {
- throwUnknownRequestIdException(__FILE__, __LINE__);
- }
+ readStreamAndParseMessage(*os, receivedRequestId);
+ if(requestId != receivedRequestId)
+ {
+ throwUnknownRequestIdException(__FILE__, __LINE__);
+ }
#endif
- out->finished(*os);
+ out->finished(*os);
#ifndef ICEE_PURE_BLOCKING_CLIENT
- }
- else
- {
- //
- // Wait until the request has completed, or until the request times out.
- //
- Int tout = timeout();
- IceUtil::Time expireTime;
- if(tout > 0)
- {
- expireTime = IceUtil::Time::now() + IceUtil::Time::milliSeconds(tout);
- }
-
- while(out->state() == Outgoing::StateInProgress)
- {
- if(tout > 0)
- {
- IceUtil::Time now = IceUtil::Time::now();
- if(now < expireTime)
- {
- _sendMonitor.timedWait(expireTime - now);
- }
-
- //
- // Make sure we woke up because of timeout and not another response.
- //
- if(out->state() == Outgoing::StateInProgress && IceUtil::Time::now() > expireTime)
- {
- throw TimeoutException(__FILE__, __LINE__);
- }
- }
- else
- {
- _sendMonitor.wait();
- }
- }
- }
+ }
+ else
+ {
+ //
+ // Wait until the request has completed, or until the request times out.
+ //
+ Int tout = timeout();
+ IceUtil::Time expireTime;
+ if(tout > 0)
+ {
+ expireTime = IceUtil::Time::now() + IceUtil::Time::milliSeconds(tout);
+ }
+
+ while(out->state() == Outgoing::StateInProgress)
+ {
+ if(tout > 0)
+ {
+ IceUtil::Time now = IceUtil::Time::now();
+ if(now < expireTime)
+ {
+ _sendMonitor.timedWait(expireTime - now);
+ }
+
+ //
+ // Make sure we woke up because of timeout and not another response.
+ //
+ if(out->state() == Outgoing::StateInProgress && IceUtil::Time::now() > expireTime)
+ {
+ throw TimeoutException(__FILE__, __LINE__);
+ }
+ }
+ else
+ {
+ _sendMonitor.wait();
+ }
+ }
+ }
#endif
}
catch(const LocalException& ex)
{
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- setState(StateClosed, ex);
- assert(_exception.get());
- if(!requestSent)
- {
- _exception->ice_throw();
- }
- }
-
- //
- // If the request was already sent, we don't throw directly
- // but instead we set the Outgoing object exception with
- // finished(). Throwing directly would break "at-most-once"
- // (see also comment in Outgoing.invoke())
- //
- IceUtil::Monitor<IceUtil::Mutex>::Lock sendSync(_sendMonitor);
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ setState(StateClosed, ex);
+ assert(_exception.get());
+ if(!requestSent)
+ {
+ _exception->ice_throw();
+ }
+ }
+
+ //
+ // If the request was already sent, we don't throw directly
+ // but instead we set the Outgoing object exception with
+ // finished(). Throwing directly would break "at-most-once"
+ // (see also comment in Outgoing.invoke())
+ //
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sendSync(_sendMonitor);
#ifndef ICEE_PURE_BLOCKING_CLIENT
- if(_blocking)
- {
+ if(_blocking)
+ {
#endif
- out->finished(ex);
+ out->finished(ex);
#ifndef ICEE_PURE_BLOCKING_CLIENT
- }
- else
- {
- while(out->state() == Outgoing::StateInProgress)
- {
- _sendMonitor.wait(); // Wait for the thread to propagate the exception to the Outgoing object.
- }
- }
+ }
+ else
+ {
+ while(out->state() == Outgoing::StateInProgress)
+ {
+ _sendMonitor.wait(); // Wait for the thread to propagate the exception to the Outgoing object.
+ }
+ }
#endif
}
}
@@ -496,12 +496,12 @@ Ice::Connection::prepareBatchRequest(BasicStream* os)
//
while(_batchStreamInUse && !_exception.get())
{
- wait();
+ wait();
}
if(_exception.get())
{
- _exception->ice_throw();
+ _exception->ice_throw();
}
assert(_state > StateNotValidated);
@@ -509,15 +509,15 @@ Ice::Connection::prepareBatchRequest(BasicStream* os)
if(_batchStream.b.empty())
{
- try
- {
- _batchStream.writeBlob(requestBatchHdr, sizeof(requestBatchHdr));
- }
- catch(const LocalException& ex)
- {
- setState(StateClosed, ex);
- ex.ice_throw();
- }
+ try
+ {
+ _batchStream.writeBlob(requestBatchHdr, sizeof(requestBatchHdr));
+ }
+ catch(const LocalException& ex)
+ {
+ setState(StateClosed, ex);
+ ex.ice_throw();
+ }
}
_batchStreamInUse = true;
@@ -655,111 +655,111 @@ void
Ice::Connection::flushBatchRequestsInternal(bool ignoreInUse)
{
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
if(!ignoreInUse)
{
- while(_batchStreamInUse && !_exception.get())
- {
- wait();
- }
+ while(_batchStreamInUse && !_exception.get())
+ {
+ wait();
+ }
+ }
+
+ if(_exception.get())
+ {
+ _exception->ice_throw();
}
-
- if(_exception.get())
- {
- _exception->ice_throw();
- }
- if(_batchStream.b.empty())
- {
- return; // Nothing to do.
- }
+ if(_batchStream.b.empty())
+ {
+ return; // Nothing to do.
+ }
- assert(_state > StateNotValidated);
- assert(_state < StateClosing);
+ assert(_state > StateNotValidated);
+ assert(_state < StateClosing);
- _batchStream.i = _batchStream.b.begin();
+ _batchStream.i = _batchStream.b.begin();
- //
- // Prevent that new batch requests are added while we are
- // flushing.
- //
- _batchStreamInUse = true;
+ //
+ // Prevent that new batch requests are added while we are
+ // flushing.
+ //
+ _batchStreamInUse = true;
}
try
{
- Lock sendSync(_sendMonitor);
+ Lock sendSync(_sendMonitor);
- if(!_transceiver) // Has the transceiver already been closed?
- {
- assert(_exception.get());
- _exception->ice_throw(); // The exception is immutable at this point.
- }
+ if(!_transceiver) // Has the transceiver already been closed?
+ {
+ assert(_exception.get());
+ _exception->ice_throw(); // The exception is immutable at this point.
+ }
- //
- // Fill in the number of requests in the batch.
- //
- Byte* dest = &(_batchStream.b[0]) + headerSize;
+ //
+ // Fill in the number of requests in the batch.
+ //
+ Byte* dest = &(_batchStream.b[0]) + headerSize;
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(&_batchRequestNum) + sizeof(Ice::Int) - 1;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest = *src;
+ const Byte* src = reinterpret_cast<const Byte*>(&_batchRequestNum) + sizeof(Ice::Int) - 1;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest = *src;
#else
- const Byte* src = reinterpret_cast<const Byte*>(&_batchRequestNum);
- *dest++ = *src++;
- *dest++ = *src++;
- *dest++ = *src++;
- *dest = *src;
+ const Byte* src = reinterpret_cast<const Byte*>(&_batchRequestNum);
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest = *src;
#endif
-
- const Int sz = static_cast<Int>(_batchStream.b.size());
- dest = &(_batchStream.b[0]) + 10;
+
+ const Int sz = static_cast<Int>(_batchStream.b.size());
+ dest = &(_batchStream.b[0]) + 10;
#ifdef ICE_BIG_ENDIAN
- src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest = *src;
+ src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest = *src;
#else
- src = reinterpret_cast<const Byte*>(&sz);
- *dest++ = *src++;
- *dest++ = *src++;
- *dest++ = *src++;
- *dest = *src;
+ src = reinterpret_cast<const Byte*>(&sz);
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest = *src;
#endif
-
- //
- // Send the batch request.
- //
- _batchStream.i = _batchStream.b.begin();
- if(_traceLevels->protocol >= 1)
- {
- traceBatchRequest("sending batch request", _batchStream, _logger, _traceLevels);
- }
- _transceiver->write(_batchStream);
+
+ //
+ // Send the batch request.
+ //
+ _batchStream.i = _batchStream.b.begin();
+ if(_traceLevels->protocol >= 1)
+ {
+ traceBatchRequest("sending batch request", _batchStream, _logger, _traceLevels);
+ }
+ _transceiver->write(_batchStream);
}
catch(const LocalException& ex)
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- setState(StateClosed, ex);
- assert(_exception.get());
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ setState(StateClosed, ex);
+ assert(_exception.get());
- //
- // Since batch requests are all oneways, we
- // must report the exception to the caller.
- //
- _exception->ice_throw();
+ //
+ // Since batch requests are all oneways, we
+ // must report the exception to the caller.
+ //
+ _exception->ice_throw();
}
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- //
- // Reset the batch stream, and notify that flushing is over.
- //
+ //
+ // Reset the batch stream, and notify that flushing is over.
+ //
resetBatch(!ignoreInUse);
}
}
@@ -797,69 +797,69 @@ Ice::Connection::sendResponse(BasicStream* os)
{
try
{
- Lock sendSync(_sendMonitor);
+ Lock sendSync(_sendMonitor);
- if(!_transceiver) // Has the transceiver already been closed?
- {
- assert(_exception.get());
- _exception->ice_throw(); // The exception is immutable at this point.
- }
+ if(!_transceiver) // Has the transceiver already been closed?
+ {
+ assert(_exception.get());
+ _exception->ice_throw(); // The exception is immutable at this point.
+ }
- const Int sz = static_cast<Int>(os->b.size());
- Byte* dest = &(os->b[0]) + 10;
+ const Int sz = static_cast<Int>(os->b.size());
+ Byte* dest = &(os->b[0]) + 10;
#ifdef ICE_BIG_ENDIAN
- const Byte* src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest++ = *src--;
- *dest = *src;
+ const Byte* src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest++ = *src--;
+ *dest = *src;
#else
- const Byte* src = reinterpret_cast<const Byte*>(&sz);
- *dest++ = *src++;
- *dest++ = *src++;
- *dest++ = *src++;
- *dest = *src;
+ const Byte* src = reinterpret_cast<const Byte*>(&sz);
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest++ = *src++;
+ *dest = *src;
#endif
-
- //
- // Send the reply.
- //
- os->i = os->b.begin();
- if(_traceLevels->protocol >= 1)
- {
- traceReply("sending reply", *os, _logger, _traceLevels);
- }
- _transceiver->write(*os);
+
+ //
+ // Send the reply.
+ //
+ os->i = os->b.begin();
+ if(_traceLevels->protocol >= 1)
+ {
+ traceReply("sending reply", *os, _logger, _traceLevels);
+ }
+ _transceiver->write(*os);
}
catch(const LocalException& ex)
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- setState(StateClosed, ex);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ setState(StateClosed, ex);
}
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- assert(_state > StateNotValidated);
+ assert(_state > StateNotValidated);
- try
- {
- assert(_dispatchCount > 0);
- if(--_dispatchCount == 0)
- {
- notifyAll();
- }
-
- if(_state == StateClosing && _dispatchCount == 0)
- {
- initiateShutdown();
- }
- }
- catch(const LocalException& ex)
- {
- setState(StateClosed, ex);
- }
+ try
+ {
+ assert(_dispatchCount > 0);
+ if(--_dispatchCount == 0)
+ {
+ notifyAll();
+ }
+
+ if(_state == StateClosing && _dispatchCount == 0)
+ {
+ initiateShutdown();
+ }
+ }
+ catch(const LocalException& ex)
+ {
+ setState(StateClosed, ex);
+ }
}
}
@@ -872,20 +872,20 @@ Ice::Connection::sendNoResponse()
try
{
- assert(_dispatchCount > 0);
- if(--_dispatchCount == 0)
- {
- notifyAll();
- }
+ assert(_dispatchCount > 0);
+ if(--_dispatchCount == 0)
+ {
+ notifyAll();
+ }
- if(_state == StateClosing && _dispatchCount == 0)
- {
- initiateShutdown();
- }
+ if(_state == StateClosing && _dispatchCount == 0)
+ {
+ initiateShutdown();
+ }
}
catch(const LocalException& ex)
{
- setState(StateClosed, ex);
+ setState(StateClosed, ex);
}
}
@@ -916,12 +916,12 @@ Ice::Connection::setAdapter(const ObjectAdapterPtr& adapter)
//
while(_dispatchCount > 0)
{
- wait();
+ wait();
}
if(_exception.get())
{
- _exception->ice_throw();
+ _exception->ice_throw();
}
assert(_state < StateClosing);
@@ -946,7 +946,7 @@ Ice::Connection::createProxy(const Identity& ident) const
vector<ConnectionPtr> connections;
connections.push_back(const_cast<Connection*>(this));
ReferencePtr ref = _instance->referenceFactory()->create(ident, Ice::Context(), "", ReferenceModeTwoway,
- connections);
+ connections);
return _instance->proxyFactory()->referenceToProxy(ref);
}
@@ -972,28 +972,28 @@ Ice::Connection::toString() const
#ifndef ICEE_PURE_CLIENT
Ice::Connection::Connection(const InstancePtr& instance,
- const TransceiverPtr& transceiver,
- const EndpointPtr& endpoint,
- const ObjectAdapterPtr& adapter) :
+ const TransceiverPtr& transceiver,
+ const EndpointPtr& endpoint,
+ const ObjectAdapterPtr& adapter) :
#else
Ice::Connection::Connection(const InstancePtr& instance,
- const TransceiverPtr& transceiver,
- const EndpointPtr& endpoint) :
+ const TransceiverPtr& transceiver,
+ const EndpointPtr& endpoint) :
#endif
- _instance(instance),
- _transceiver(transceiver),
- _desc(transceiver->toString()),
- _type(transceiver->type()),
- _endpoint(endpoint),
- _logger(_instance->initializationData().logger), // Cached for better performance.
- _traceLevels(_instance->traceLevels()), // Cached for better performance.
- _warn(_instance->initializationData().properties->getPropertyAsInt("Ice.Warn.Connections") > 0),
+ _instance(instance),
+ _transceiver(transceiver),
+ _desc(transceiver->toString()),
+ _type(transceiver->type()),
+ _endpoint(endpoint),
+ _logger(_instance->initializationData().logger), // Cached for better performance.
+ _traceLevels(_instance->traceLevels()), // Cached for better performance.
+ _warn(_instance->initializationData().properties->getPropertyAsInt("Ice.Warn.Connections") > 0),
#ifndef ICEE_PURE_CLIENT
- _in(_instance.get(), this, _stream, adapter),
+ _in(_instance.get(), this, _stream, adapter),
#endif
#ifndef ICEE_PURE_BLOCKING_CLIENT
- _stream(_instance.get(), _instance->messageSizeMax()
+ _stream(_instance.get(), _instance->messageSizeMax()
#ifdef ICEE_HAS_WSTRING
, _instance->initializationData().stringConverter, _instance->initializationData().wstringConverter
#endif
@@ -1002,19 +1002,19 @@ Ice::Connection::Connection(const InstancePtr& instance,
#ifdef ICEE_HAS_BATCH
_batchAutoFlush(
_instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlush", 1) > 0),
- _batchStream(_instance.get(), _instance->messageSizeMax(),
+ _batchStream(_instance.get(), _instance->messageSizeMax(),
#ifdef ICEE_HAS_WSTRING
_instance->initializationData().stringConverter, _instance->initializationData().wstringConverter,
#endif
_batchAutoFlush),
- _batchStreamInUse(false),
- _batchRequestNum(0),
+ _batchStreamInUse(false),
+ _batchRequestNum(0),
_batchMarker(0),
#endif
- _dispatchCount(0),
- _state(StateNotValidated),
- _stateTime(IceUtil::Time::now()),
- _nextRequestId(1)
+ _dispatchCount(0),
+ _state(StateNotValidated),
+ _stateTime(IceUtil::Time::now()),
+ _nextRequestId(1)
#ifndef ICEE_PURE_BLOCKING_CLIENT
, _requestsHint(_requests.end())
#endif
@@ -1027,18 +1027,18 @@ Ice::Connection::Connection(const InstancePtr& instance,
# endif
if(_blocking)
{
- _transceiver->setTimeouts(_endpoint->timeout(), _endpoint->timeout());
+ _transceiver->setTimeouts(_endpoint->timeout(), _endpoint->timeout());
}
else
{
#ifdef _WIN32
- //
- // On Windows, the recv() call doesn't return if the socket is
- // shutdown. We use the timeout to not block indefinitely.
- //
- _transceiver->setTimeouts(_endpoint->timeout(), _endpoint->timeout());
+ //
+ // On Windows, the recv() call doesn't return if the socket is
+ // shutdown. We use the timeout to not block indefinitely.
+ //
+ _transceiver->setTimeouts(_endpoint->timeout(), _endpoint->timeout());
#else
- _transceiver->setTimeouts(-1, _endpoint->timeout());
+ _transceiver->setTimeouts(-1, _endpoint->timeout());
#endif
}
#else
@@ -1050,38 +1050,38 @@ Ice::Connection::Connection(const InstancePtr& instance,
#else
if(_blocking)
{
- validate();
+ validate();
}
else
{
__setNoDelete(true);
try
{
- //
- // If we are in thread per connection mode, create the thread
- // for this connection.
- //
- _threadPerConnection = new ThreadPerConnection(this);
- _threadPerConnection->start(_instance->threadPerConnectionStackSize());
+ //
+ // If we are in thread per connection mode, create the thread
+ // for this connection.
+ //
+ _threadPerConnection = new ThreadPerConnection(this);
+ _threadPerConnection->start(_instance->threadPerConnectionStackSize());
}
catch(const Ice::Exception& ex)
{
- {
- Error out(_logger);
- out << "cannot create thread for connection:\n" << ex.toString();
- }
-
- try
- {
- _transceiver->close();
- }
- catch(const LocalException&)
- {
- // Here we ignore any exceptions in close().
- }
-
- __setNoDelete(false);
- ex.ice_throw();
+ {
+ Error out(_logger);
+ out << "cannot create thread for connection:\n" << ex.toString();
+ }
+
+ try
+ {
+ _transceiver->close();
+ }
+ catch(const LocalException&)
+ {
+ // Here we ignore any exceptions in close().
+ }
+
+ __setNoDelete(false);
+ ex.ice_throw();
}
__setNoDelete(false);
}
@@ -1108,25 +1108,25 @@ Ice::Connection::validate()
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- //
- // The connection might already be closed (e.g.: the communicator
- // was destroyed or object adapter deactivated.)
- //
- assert(_state == StateNotValidated || _state == StateClosed);
- if(_state == StateClosed)
- {
- assert(_exception.get());
- _exception->ice_throw();
- }
+
+ //
+ // The connection might already be closed (e.g.: the communicator
+ // was destroyed or object adapter deactivated.)
+ //
+ assert(_state == StateNotValidated || _state == StateClosed);
+ if(_state == StateClosed)
+ {
+ assert(_exception.get());
+ _exception->ice_throw();
+ }
if(_in.getAdapter())
{
- active = true; // The server side has the active role for connection validation.
+ active = true; // The server side has the active role for connection validation.
}
else
{
- active = false; // The client side has the passive role for connection validation.
+ active = false; // The client side has the passive role for connection validation.
}
}
#endif
@@ -1136,111 +1136,111 @@ Ice::Connection::validate()
Int timeout;
if(_instance->defaultsAndOverrides()->overrideConnectTimeout)
{
- timeout = _instance->defaultsAndOverrides()->overrideConnectTimeoutValue;
+ timeout = _instance->defaultsAndOverrides()->overrideConnectTimeoutValue;
}
else
{
- timeout = _endpoint->timeout();
+ timeout = _endpoint->timeout();
}
#ifndef ICEE_PURE_CLIENT
if(active)
{
- BasicStream os(_instance.get(), _instance->messageSizeMax()
+ BasicStream os(_instance.get(), _instance->messageSizeMax()
#ifdef ICEE_HAS_WSTRING
, _instance->initializationData().stringConverter,
_instance->initializationData().wstringConverter
#endif
);
- os.write(magic[0]);
- os.write(magic[1]);
- os.write(magic[2]);
- os.write(magic[3]);
- os.write(protocolMajor);
- os.write(protocolMinor);
- os.write(encodingMajor);
- os.write(encodingMinor);
- os.write(validateConnectionMsg);
- os.write(static_cast<Byte>(0)); // Compression status (always zero for validate connection).
- os.write(headerSize); // Message size.
- os.i = os.b.begin();
- if(_traceLevels->protocol >= 1)
- {
- traceHeader("sending validate connection", os, _logger, _traceLevels);
- }
- try
- {
- _transceiver->writeWithTimeout(os, timeout);
- }
- catch(const TimeoutException&)
- {
- throw ConnectTimeoutException(__FILE__, __LINE__);
- }
+ os.write(magic[0]);
+ os.write(magic[1]);
+ os.write(magic[2]);
+ os.write(magic[3]);
+ os.write(protocolMajor);
+ os.write(protocolMinor);
+ os.write(encodingMajor);
+ os.write(encodingMinor);
+ os.write(validateConnectionMsg);
+ os.write(static_cast<Byte>(0)); // Compression status (always zero for validate connection).
+ os.write(headerSize); // Message size.
+ os.i = os.b.begin();
+ if(_traceLevels->protocol >= 1)
+ {
+ traceHeader("sending validate connection", os, _logger, _traceLevels);
+ }
+ try
+ {
+ _transceiver->writeWithTimeout(os, timeout);
+ }
+ catch(const TimeoutException&)
+ {
+ throw ConnectTimeoutException(__FILE__, __LINE__);
+ }
}
else
#endif
{
- BasicStream is(_instance.get(), _instance->messageSizeMax()
+ BasicStream is(_instance.get(), _instance->messageSizeMax()
#ifdef ICEE_HAS_WSTRING
, _instance->initializationData().stringConverter,
_instance->initializationData().wstringConverter
#endif
);
- is.b.resize(headerSize);
- is.i = is.b.begin();
- try
- {
- _transceiver->readWithTimeout(is, timeout);
- }
- catch(const TimeoutException&)
- {
- throw ConnectTimeoutException(__FILE__, __LINE__);
- }
- assert(is.i == is.b.end());
- is.i = is.b.begin();
- Ice::Byte m[4];
- is.read(m[0]);
- is.read(m[1]);
- is.read(m[2]);
- is.read(m[3]);
- if(m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3])
- {
- throwBadMagicException(__FILE__, __LINE__, Ice::ByteSeq(&m[0], &m[0] + sizeof(m)));
- }
- Byte pMajor;
- Byte pMinor;
- is.read(pMajor);
- is.read(pMinor);
- if(pMajor != protocolMajor)
- {
- throwUnsupportedProtocolException(__FILE__, __LINE__, pMajor, pMinor, protocolMajor, protocolMinor);
- }
- Byte eMajor;
- Byte eMinor;
- is.read(eMajor);
- is.read(eMinor);
- if(eMajor != encodingMajor)
- {
- throwUnsupportedEncodingException(__FILE__, __LINE__, eMajor, eMinor, encodingMajor, encodingMinor);
- }
- Byte messageType;
- is.read(messageType);
- if(messageType != validateConnectionMsg)
- {
- throwConnectionNotValidatedException(__FILE__, __LINE__);
- }
+ is.b.resize(headerSize);
+ is.i = is.b.begin();
+ try
+ {
+ _transceiver->readWithTimeout(is, timeout);
+ }
+ catch(const TimeoutException&)
+ {
+ throw ConnectTimeoutException(__FILE__, __LINE__);
+ }
+ assert(is.i == is.b.end());
+ is.i = is.b.begin();
+ Ice::Byte m[4];
+ is.read(m[0]);
+ is.read(m[1]);
+ is.read(m[2]);
+ is.read(m[3]);
+ if(m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3])
+ {
+ throwBadMagicException(__FILE__, __LINE__, Ice::ByteSeq(&m[0], &m[0] + sizeof(m)));
+ }
+ Byte pMajor;
+ Byte pMinor;
+ is.read(pMajor);
+ is.read(pMinor);
+ if(pMajor != protocolMajor)
+ {
+ throwUnsupportedProtocolException(__FILE__, __LINE__, pMajor, pMinor, protocolMajor, protocolMinor);
+ }
+ Byte eMajor;
+ Byte eMinor;
+ is.read(eMajor);
+ is.read(eMinor);
+ if(eMajor != encodingMajor)
+ {
+ throwUnsupportedEncodingException(__FILE__, __LINE__, eMajor, eMinor, encodingMajor, encodingMinor);
+ }
+ Byte messageType;
+ is.read(messageType);
+ if(messageType != validateConnectionMsg)
+ {
+ throwConnectionNotValidatedException(__FILE__, __LINE__);
+ }
Byte compress;
is.read(compress); // Ignore compression status for validate connection.
- Int size;
- is.read(size);
- if(size != headerSize)
- {
- throwIllegalMessageSizeException(__FILE__, __LINE__);
- }
- if(_traceLevels->protocol >= 1)
- {
- traceHeader("received validate connection", is, _logger, _traceLevels);
- }
+ Int size;
+ is.read(size);
+ if(size != headerSize)
+ {
+ throwIllegalMessageSizeException(__FILE__, __LINE__);
+ }
+ if(_traceLevels->protocol >= 1)
+ {
+ traceHeader("received validate connection", is, _logger, _traceLevels);
+ }
}
}
catch(const LocalException& ex)
@@ -1269,41 +1269,41 @@ Ice::Connection::setState(State state, const LocalException& ex)
if(_state == state) // Don't switch twice.
{
- return;
+ return;
}
if(!_exception.get())
{
- //
- // If we are in closed state, an exception must be set.
- //
- assert(_state != StateClosed);
-
- _exception.reset(dynamic_cast<LocalException*>(ex.ice_clone()));
-
- if(_warn)
- {
- //
- // We don't warn if we are not validated.
- //
- if(_state > StateNotValidated)
- {
- //
- // Don't warn about certain expected exceptions.
- //
- if(!(dynamic_cast<const CloseConnectionException*>(_exception.get()) ||
- dynamic_cast<const ForcedCloseConnectionException*>(_exception.get()) ||
- dynamic_cast<const CommunicatorDestroyedException*>(_exception.get()) ||
+ //
+ // If we are in closed state, an exception must be set.
+ //
+ assert(_state != StateClosed);
+
+ _exception.reset(dynamic_cast<LocalException*>(ex.ice_clone()));
+
+ if(_warn)
+ {
+ //
+ // We don't warn if we are not validated.
+ //
+ if(_state > StateNotValidated)
+ {
+ //
+ // Don't warn about certain expected exceptions.
+ //
+ if(!(dynamic_cast<const CloseConnectionException*>(_exception.get()) ||
+ dynamic_cast<const ForcedCloseConnectionException*>(_exception.get()) ||
+ dynamic_cast<const CommunicatorDestroyedException*>(_exception.get()) ||
#ifndef ICEE_PURE_CLIENT
- dynamic_cast<const ObjectAdapterDeactivatedException*>(_exception.get()) ||
+ dynamic_cast<const ObjectAdapterDeactivatedException*>(_exception.get()) ||
#endif
- (dynamic_cast<const ConnectionLostException*>(_exception.get()) && _state == StateClosing)))
- {
- Warning out(_logger);
- out << "connection exception:\n" << (*_exception.get()).toString() << "\n" << _desc;
- }
- }
- }
+ (dynamic_cast<const ConnectionLostException*>(_exception.get()) && _state == StateClosing)))
+ {
+ Warning out(_logger);
+ out << "connection exception:\n" << (*_exception.get()).toString() << "\n" << _desc;
+ }
+ }
+ }
}
//
@@ -1319,91 +1319,91 @@ Ice::Connection::setState(State state)
{
if(_state == state) // Don't switch twice.
{
- return;
+ return;
}
switch(state)
{
case StateNotValidated:
{
- assert(false);
- break;
+ assert(false);
+ break;
}
case StateActive:
{
- //
- // Can only switch from holding or not validated to
- // active.
- //
+ //
+ // Can only switch from holding or not validated to
+ // active.
+ //
#ifdef ICEE_PURE_CLIENT
- if(_state != StateNotValidated)
- {
- return;
- }
+ if(_state != StateNotValidated)
+ {
+ return;
+ }
#else
- if(_state != StateHolding && _state != StateNotValidated)
- {
- return;
- }
+ if(_state != StateHolding && _state != StateNotValidated)
+ {
+ return;
+ }
#endif
- break;
+ break;
}
-
+
#ifndef ICEE_PURE_CLIENT
case StateHolding:
{
- //
- // Can only switch from active or not validated to
- // holding.
- //
- if(_state != StateActive && _state != StateNotValidated)
- {
- return;
- }
- break;
+ //
+ // Can only switch from active or not validated to
+ // holding.
+ //
+ if(_state != StateActive && _state != StateNotValidated)
+ {
+ return;
+ }
+ break;
}
#endif
case StateClosing:
{
- //
- // Can't change back from closed.
- //
- if(_state == StateClosed)
- {
- return;
- }
- break;
+ //
+ // Can't change back from closed.
+ //
+ if(_state == StateClosed)
+ {
+ return;
+ }
+ break;
}
-
+
case StateClosed:
{
- //
- // We shutdown both for reading and writing. This will
- // unblock and read call with an exception. The thread
- // per connection then closes the transceiver.
- //
- _transceiver->shutdownReadWrite();
+ //
+ // We shutdown both for reading and writing. This will
+ // unblock and read call with an exception. The thread
+ // per connection then closes the transceiver.
+ //
+ _transceiver->shutdownReadWrite();
- //
- // In blocking mode, we close the transceiver now.
- //
+ //
+ // In blocking mode, we close the transceiver now.
+ //
#ifndef ICEE_PURE_BLOCKING_CLIENT
- if(_blocking)
+ if(_blocking)
#endif
- {
- Lock sync(_sendMonitor);
- try
- {
- _transceiver->close();
- }
- catch(const Ice::LocalException&)
- {
- }
- _transceiver = 0;
- }
- break;
+ {
+ Lock sync(_sendMonitor);
+ try
+ {
+ _transceiver->close();
+ }
+ catch(const Ice::LocalException&)
+ {
+ }
+ _transceiver = 0;
+ }
+ break;
}
}
@@ -1414,21 +1414,21 @@ Ice::Connection::setState(State state)
if(_state == StateClosing && _dispatchCount == 0)
{
- try
- {
- initiateShutdown();
+ try
+ {
+ initiateShutdown();
#ifndef ICEE_PURE_BLOCKING_CLIENT
- if(_blocking)
+ if(_blocking)
#endif
- {
- setState(StateClosed);
- }
- }
- catch(const LocalException& ex)
- {
- setState(StateClosed, ex);
- }
+ {
+ setState(StateClosed);
+ }
+ }
+ catch(const LocalException& ex)
+ {
+ setState(StateClosed, ex);
+ }
}
}
@@ -1467,7 +1467,7 @@ Ice::Connection::initiateShutdown() const
os.i = os.b.begin();
if(_traceLevels->protocol >= 1)
{
- traceHeader("sending close connection", os, _logger, _traceLevels);
+ traceHeader("sending close connection", os, _logger, _traceLevels);
}
_transceiver->write(os);
@@ -1503,20 +1503,20 @@ Ice::Connection::readStreamAndParseMessage(IceInternal::BasicStream& stream, Int
stream.readBlob(header, headerSize);
if(header[0] != magic[0] || header[1] != magic[1] || header[2] != magic[2] || header[3] != magic[3])
{
- throwBadMagicException(__FILE__, __LINE__, Ice::ByteSeq(&header[0], &header[0] + sizeof(magic)));
+ throwBadMagicException(__FILE__, __LINE__, Ice::ByteSeq(&header[0], &header[0] + sizeof(magic)));
}
if(header[4] != protocolMajor)
{
- throwUnsupportedProtocolException(__FILE__, __LINE__, header[4], header[5], protocolMajor, protocolMinor);
+ throwUnsupportedProtocolException(__FILE__, __LINE__, header[4], header[5], protocolMajor, protocolMinor);
}
if(header[6] != encodingMajor)
{
- throwUnsupportedEncodingException(__FILE__, __LINE__, header[6], header[7], encodingMajor, encodingMinor);
+ throwUnsupportedEncodingException(__FILE__, __LINE__, header[6], header[7], encodingMajor, encodingMinor);
}
const Byte messageType = header[8];
if(header[9] == 2)
{
- throw FeatureNotSupportedException(__FILE__, __LINE__, "compression");
+ throw FeatureNotSupportedException(__FILE__, __LINE__, "compression");
}
Int size;
@@ -1524,21 +1524,21 @@ Ice::Connection::readStreamAndParseMessage(IceInternal::BasicStream& stream, Int
stream.read(size);
if(size < headerSize)
{
- throwIllegalMessageSizeException(__FILE__, __LINE__);
+ throwIllegalMessageSizeException(__FILE__, __LINE__);
}
if(size > static_cast<Int>(_instance->messageSizeMax()))
{
- throwMemoryLimitException(__FILE__, __LINE__);
+ throwMemoryLimitException(__FILE__, __LINE__);
}
if(size > static_cast<Int>(stream.b.size()))
{
- stream.b.resize(size);
+ stream.b.resize(size);
}
stream.i = stream.b.begin() + pos;
if(stream.i != stream.b.end())
{
- _transceiver->read(stream);
+ _transceiver->read(stream);
}
assert(stream.i == stream.b.end());
@@ -1548,74 +1548,74 @@ Ice::Connection::readStreamAndParseMessage(IceInternal::BasicStream& stream, Int
{
case closeConnectionMsg:
{
- if(_traceLevels->protocol >= 1)
- {
- traceHeader("received close connection", stream, _logger, _traceLevels);
- }
- throw CloseConnectionException(__FILE__, __LINE__);
- break;
+ if(_traceLevels->protocol >= 1)
+ {
+ traceHeader("received close connection", stream, _logger, _traceLevels);
+ }
+ throw CloseConnectionException(__FILE__, __LINE__);
+ break;
}
-
+
case replyMsg:
{
- if(_traceLevels->protocol >= 1)
- {
- traceReply("received reply", stream, _logger, _traceLevels);
- }
- stream.read(requestId);
- break;
- }
-
+ if(_traceLevels->protocol >= 1)
+ {
+ traceReply("received reply", stream, _logger, _traceLevels);
+ }
+ stream.read(requestId);
+ break;
+ }
+
#ifndef ICEE_PURE_CLIENT
case requestMsg:
{
- if(_traceLevels->protocol >= 1)
- {
- traceRequest("received request", stream, _logger, _traceLevels);
- }
- stream.read(requestId);
- invokeNum = 1;
- break;
+ if(_traceLevels->protocol >= 1)
+ {
+ traceRequest("received request", stream, _logger, _traceLevels);
+ }
+ stream.read(requestId);
+ invokeNum = 1;
+ break;
}
-
+
case requestBatchMsg:
{
- if(_traceLevels->protocol >= 1)
- {
- traceBatchRequest("received batch request", stream, _logger, _traceLevels);
- }
- stream.read(invokeNum);
- if(invokeNum < 0)
- {
- invokeNum = 0;
- throwNegativeSizeException(__FILE__, __LINE__);
- }
- break;
+ if(_traceLevels->protocol >= 1)
+ {
+ traceBatchRequest("received batch request", stream, _logger, _traceLevels);
+ }
+ stream.read(invokeNum);
+ if(invokeNum < 0)
+ {
+ invokeNum = 0;
+ throwNegativeSizeException(__FILE__, __LINE__);
+ }
+ break;
}
#endif
-
+
case validateConnectionMsg:
{
- if(_traceLevels->protocol >= 1)
- {
- traceHeader("received validate connection", stream, _logger, _traceLevels);
- }
- if(_warn)
- {
- Warning out(_logger);
- out << "ignoring unexpected validate connection message:\n" << _desc;
- }
- break;
- }
-
+ if(_traceLevels->protocol >= 1)
+ {
+ traceHeader("received validate connection", stream, _logger, _traceLevels);
+ }
+ if(_warn)
+ {
+ Warning out(_logger);
+ out << "ignoring unexpected validate connection message:\n" << _desc;
+ }
+ break;
+ }
+
default:
{
- if(_traceLevels->protocol >= 1)
- {
- traceHeader("received unknown message\n(invalid, closing connection)", stream, _logger, _traceLevels);
- }
- throwUnknownMessageException(__FILE__, __LINE__);
- break;
+ if(_traceLevels->protocol >= 1)
+ {
+ traceHeader("received unknown message\n(invalid, closing connection)", stream, _logger, _traceLevels);
+ }
+ throwUnknownMessageException(__FILE__, __LINE__);
+ break;
}
}
}
@@ -1636,17 +1636,17 @@ Ice::Connection::run()
}
catch(const LocalException&)
{
- Lock sync(*this);
+ Lock sync(*this);
assert(_state == StateClosed);
- Lock sendSync(_sendMonitor);
+ Lock sendSync(_sendMonitor);
try
{
- _transceiver->close();
+ _transceiver->close();
}
catch(const LocalException&)
{
- // Here we ignore any exceptions in close().
+ // Here we ignore any exceptions in close().
}
_transceiver = 0;
@@ -1660,224 +1660,224 @@ Ice::Connection::run()
while(!closed)
{
- Int requestId = 0;
+ Int requestId = 0;
#ifndef ICEE_PURE_CLIENT
- Int invokeNum = 0;
- _in.os()->reset();
+ Int invokeNum = 0;
+ _in.os()->reset();
#endif
- _stream.reset();
-
- //
- // Read and parse the next message. We don't need to lock the
- // send monitor here as we have the guarantee that
- // _transceiver won't be set to 0 by another thread, the
- // thread per connection is the only thread that can set
- // _transceiver to 0.
- //
- try
- {
+ _stream.reset();
+
+ //
+ // Read and parse the next message. We don't need to lock the
+ // send monitor here as we have the guarantee that
+ // _transceiver won't be set to 0 by another thread, the
+ // thread per connection is the only thread that can set
+ // _transceiver to 0.
+ //
+ try
+ {
#ifndef ICEE_PURE_CLIENT
- readStreamAndParseMessage(_stream, requestId, invokeNum);
+ readStreamAndParseMessage(_stream, requestId, invokeNum);
#else
- readStreamAndParseMessage(_stream, requestId);
+ readStreamAndParseMessage(_stream, requestId);
#endif
- }
+ }
#ifdef _WIN32
- catch(const Ice::TimeoutException&)
- {
- //
- // See the comment in the Connection constructor. This is
- // necessary to not block in recv() indefinitely.
- //
- continue;
- }
+ catch(const Ice::TimeoutException&)
+ {
+ //
+ // See the comment in the Connection constructor. This is
+ // necessary to not block in recv() indefinitely.
+ //
+ continue;
+ }
#endif
- catch(const Ice::LocalException& ex)
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- setState(StateClosed, ex);
- }
-
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- if(_state != StateClosed)
- {
+ catch(const Ice::LocalException& ex)
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ setState(StateClosed, ex);
+ }
+
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ if(_state != StateClosed)
+ {
#ifndef ICEE_PURE_CLIENT
- if(invokeNum > 0) // We received a request or a batch request
- {
- if(_state == StateClosing)
- {
- if(_traceLevels->protocol >= 1)
- {
- string req = invokeNum > 1 ? "received batch request" : "received request";
- req += " during closing\n(ignored by server, client will retry)";
- traceRequest( req.c_str(), _stream, _logger, _traceLevels);
- }
- invokeNum = 0;
- }
- _dispatchCount += invokeNum;
- }
- else
+ if(invokeNum > 0) // We received a request or a batch request
+ {
+ if(_state == StateClosing)
+ {
+ if(_traceLevels->protocol >= 1)
+ {
+ string req = invokeNum > 1 ? "received batch request" : "received request";
+ req += " during closing\n(ignored by server, client will retry)";
+ traceRequest( req.c_str(), _stream, _logger, _traceLevels);
+ }
+ invokeNum = 0;
+ }
+ _dispatchCount += invokeNum;
+ }
+ else
#endif
- if(requestId > 0)
- {
- //
- // The message is a reply, we search the Outgoing object waiting
- // for this reply and pass it the stream before to notify the
- // send monitor to wake up threads waiting for replies.
- //
- try
- {
- Lock sync(_sendMonitor);
-
- map<Int, Outgoing*>::iterator p = _requests.end();
- if(p != _requestsHint)
- {
- if(_requestsHint->first == requestId)
- {
- p = _requestsHint;
- }
- }
-
- if(p == _requests.end())
- {
- p = _requests.find(requestId);
- }
-
- if(p == _requests.end())
- {
- throwUnknownRequestIdException(__FILE__, __LINE__);
- }
-
- p->second->finished(_stream);
-
- if(p == _requestsHint)
- {
- _requests.erase(p++);
- _requestsHint = p;
- }
- else
- {
- _requests.erase(p);
- }
- _sendMonitor.notifyAll(); // Wake up threads waiting in sendRequest()
- }
- catch(const Ice::LocalException& ex)
- {
- setState(StateClosed, ex);
- }
- }
- }
+ if(requestId > 0)
+ {
+ //
+ // The message is a reply, we search the Outgoing object waiting
+ // for this reply and pass it the stream before to notify the
+ // send monitor to wake up threads waiting for replies.
+ //
+ try
+ {
+ Lock sync(_sendMonitor);
+
+ map<Int, Outgoing*>::iterator p = _requests.end();
+ if(p != _requestsHint)
+ {
+ if(_requestsHint->first == requestId)
+ {
+ p = _requestsHint;
+ }
+ }
+
+ if(p == _requests.end())
+ {
+ p = _requests.find(requestId);
+ }
+
+ if(p == _requests.end())
+ {
+ throwUnknownRequestIdException(__FILE__, __LINE__);
+ }
+
+ p->second->finished(_stream);
+
+ if(p == _requestsHint)
+ {
+ _requests.erase(p++);
+ _requestsHint = p;
+ }
+ else
+ {
+ _requests.erase(p);
+ }
+ _sendMonitor.notifyAll(); // Wake up threads waiting in sendRequest()
+ }
+ catch(const Ice::LocalException& ex)
+ {
+ setState(StateClosed, ex);
+ }
+ }
+ }
#ifndef ICEE_PURE_CLIENT
- while(_state == StateHolding)
- {
- wait();
- }
+ while(_state == StateHolding)
+ {
+ wait();
+ }
#endif
- if(_state == StateClosed)
- {
- Lock sync(_sendMonitor);
- try
- {
- _transceiver->close();
- }
- catch(const LocalException&)
- {
- }
- _transceiver = 0;
- notifyAll();
-
- //
- // We cannot simply return here. We have to make sure
- // that all requests are notified about the closed
- // connection below.
- //
- closed = true;
- }
-
- if(_state == StateClosed || _state == StateClosing)
- {
- Lock sync(_sendMonitor);
- assert(_exception.get());
- for(map<Int, Outgoing*>::iterator p = _requests.begin(); p != _requests.end(); ++p)
- {
- p->second->finished(*_exception.get()); // The exception is immutable at this point.
- }
- _requests.clear();
- _sendMonitor.notifyAll(); // Wake up threads waiting in sendRequest()
- }
- }
-
- //
- // Method invocation (or multiple invocations for batch
- // messages) must be done outside the thread synchronization,
- // so that nested calls are possible.
- //
+ if(_state == StateClosed)
+ {
+ Lock sync(_sendMonitor);
+ try
+ {
+ _transceiver->close();
+ }
+ catch(const LocalException&)
+ {
+ }
+ _transceiver = 0;
+ notifyAll();
+
+ //
+ // We cannot simply return here. We have to make sure
+ // that all requests are notified about the closed
+ // connection below.
+ //
+ closed = true;
+ }
+
+ if(_state == StateClosed || _state == StateClosing)
+ {
+ Lock sync(_sendMonitor);
+ assert(_exception.get());
+ for(map<Int, Outgoing*>::iterator p = _requests.begin(); p != _requests.end(); ++p)
+ {
+ p->second->finished(*_exception.get()); // The exception is immutable at this point.
+ }
+ _requests.clear();
+ _sendMonitor.notifyAll(); // Wake up threads waiting in sendRequest()
+ }
+ }
+
+ //
+ // Method invocation (or multiple invocations for batch
+ // messages) must be done outside the thread synchronization,
+ // so that nested calls are possible.
+ //
#ifndef ICEE_PURE_CLIENT
- try
- {
- for(;invokeNum > 0; --invokeNum)
- {
- //
- // Prepare the response if necessary.
- //
- const bool response = requestId != 0;
- if(response)
- {
- assert(invokeNum == 1); // No further invocations if a response is expected.
-
- //
- // Add the reply header and request id.
- //
- BasicStream* os = _in.os();
- os->writeBlob(replyHdr, sizeof(replyHdr));
- os->write(requestId);
- }
-
- //
- // Dispatch the incoming request.
- //
- _in.invoke(response, requestId);
- }
- }
- catch(const LocalException& ex)
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- setState(StateClosed, ex);
- }
- catch(const std::exception& ex)
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- UnknownException uex(__FILE__, __LINE__);
- uex.unknown = string("std::exception: ") + ex.what();
- setState(StateClosed, uex);
- }
- catch(...)
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- UnknownException uex(__FILE__, __LINE__);
- uex.unknown = "unknown c++ exception";
- setState(StateClosed, uex);
- }
-
- //
- // If invoke() above raised an exception, and therefore neither
- // sendResponse() nor sendNoResponse() has been called, then we
- // must decrement _dispatchCount here.
- //
- if(invokeNum > 0)
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- assert(_dispatchCount > 0);
- _dispatchCount -= invokeNum;
- assert(_dispatchCount >= 0);
- if(_dispatchCount == 0)
- {
- notifyAll();
- }
- }
+ try
+ {
+ for(;invokeNum > 0; --invokeNum)
+ {
+ //
+ // Prepare the response if necessary.
+ //
+ const bool response = requestId != 0;
+ if(response)
+ {
+ assert(invokeNum == 1); // No further invocations if a response is expected.
+
+ //
+ // Add the reply header and request id.
+ //
+ BasicStream* os = _in.os();
+ os->writeBlob(replyHdr, sizeof(replyHdr));
+ os->write(requestId);
+ }
+
+ //
+ // Dispatch the incoming request.
+ //
+ _in.invoke(response, requestId);
+ }
+ }
+ catch(const LocalException& ex)
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ setState(StateClosed, ex);
+ }
+ catch(const std::exception& ex)
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ UnknownException uex(__FILE__, __LINE__);
+ uex.unknown = string("std::exception: ") + ex.what();
+ setState(StateClosed, uex);
+ }
+ catch(...)
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ UnknownException uex(__FILE__, __LINE__);
+ uex.unknown = "unknown c++ exception";
+ setState(StateClosed, uex);
+ }
+
+ //
+ // If invoke() above raised an exception, and therefore neither
+ // sendResponse() nor sendNoResponse() has been called, then we
+ // must decrement _dispatchCount here.
+ //
+ if(invokeNum > 0)
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ assert(_dispatchCount > 0);
+ _dispatchCount -= invokeNum;
+ assert(_dispatchCount >= 0);
+ if(_dispatchCount == 0)
+ {
+ notifyAll();
+ }
+ }
#endif
}
}
@@ -1892,22 +1892,22 @@ Ice::Connection::ThreadPerConnection::run()
{
try
{
- _connection->run();
+ _connection->run();
}
catch(const Exception& ex)
- {
- Error out(_connection->_logger);
- out << "exception in thread per connection:\n" << _connection->toString() << ex.toString();
+ {
+ Error out(_connection->_logger);
+ out << "exception in thread per connection:\n" << _connection->toString() << ex.toString();
}
catch(const std::exception& ex)
{
- Error out(_connection->_logger);
- out << "std::exception in thread per connection:\n" << _connection->toString() << ex.what();
+ Error out(_connection->_logger);
+ out << "std::exception in thread per connection:\n" << _connection->toString() << ex.what();
}
catch(...)
{
- Error out(_connection->_logger);
- out << "unknown exception in thread per connection:\n" << _connection->toString();
+ Error out(_connection->_logger);
+ out << "unknown exception in thread per connection:\n" << _connection->toString();
}
_connection = 0; // Resolve cyclic dependency.
diff --git a/cppe/src/IceE/ConvertUTF.cpp b/cppe/src/IceE/ConvertUTF.cpp
index 7575bcc5c86..ea3812228b2 100644
--- a/cppe/src/IceE/ConvertUTF.cpp
+++ b/cppe/src/IceE/ConvertUTF.cpp
@@ -39,10 +39,10 @@
Author: Mark E. Davis, 1994.
Rev History: Rick McGowan, fixes & updates May 2001.
Sept 2001: fixed const & error conditions per
- mods suggested by S. Parent & A. Lillich.
+ mods suggested by S. Parent & A. Lillich.
June 2002: Tim Dodd added detection and handling of incomplete
- source sequences, enhanced error detection, added casts
- to eliminate compiler warnings.
+ source sequences, enhanced error detection, added casts
+ to eliminate compiler warnings.
July 2003: slight mods to back out aggressive FFFE detection.
Jan 2004: updated switches in from-UTF8 conversions.
Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions.
@@ -70,8 +70,8 @@ static const UTF32 halfMask = 0x3FFUL;
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
#define UNI_SUR_LOW_START (UTF32)0xDC00
#define UNI_SUR_LOW_END (UTF32)0xDFFF
-// #define false 0
-// #define true 1
+// #define false 0
+// #define true 1
/* --------------------------------------------------------------------- */
@@ -100,7 +100,7 @@ static const char trailingBytesForUTF8[256] = {
* in a UTF-8 sequence.
*/
static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
- 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
+ 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
/*
* Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
@@ -124,67 +124,67 @@ static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF16toUTF8 (
- const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
+ const UTF16** sourceStart, const UTF16* sourceEnd,
+ UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF16* source = *sourceStart;
UTF8* target = *targetStart;
while (source < sourceEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
- ch = *source++;
- /* If we have a surrogate pair, convert to UTF32 first. */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
- /* If the 16 bits following the high surrogate are in the source buffer... */
- if (source < sourceEnd) {
- UTF32 ch2 = *source;
- /* If it's a low surrogate, convert to UTF32. */
- if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
- ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
- + (ch2 - UNI_SUR_LOW_START) + halfBase;
- ++source;
- } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- } else { /* We don't have the 16 bits following the high surrogate. */
- --source; /* return to the high surrogate */
- result = sourceExhausted;
- break;
- }
- } else if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- /* Figure out how many bytes the result will require */
- if (ch < (UTF32)0x80) { bytesToWrite = 1;
- } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
- } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
- } else if (ch < (UTF32)0x110000) { bytesToWrite = 4;
- } else { bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- }
-
- target += bytesToWrite;
- if (target > targetEnd) {
- source = oldSource; /* Back up source pointer! */
- target -= bytesToWrite; result = targetExhausted; break;
- }
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
- }
- target += bytesToWrite;
+ UTF32 ch;
+ unsigned short bytesToWrite = 0;
+ const UTF32 byteMask = 0xBF;
+ const UTF32 byteMark = 0x80;
+ const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
+ ch = *source++;
+ /* If we have a surrogate pair, convert to UTF32 first. */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
+ /* If the 16 bits following the high surrogate are in the source buffer... */
+ if (source < sourceEnd) {
+ UTF32 ch2 = *source;
+ /* If it's a low surrogate, convert to UTF32. */
+ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
+ ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
+ + (ch2 - UNI_SUR_LOW_START) + halfBase;
+ ++source;
+ } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ }
+ } else { /* We don't have the 16 bits following the high surrogate. */
+ --source; /* return to the high surrogate */
+ result = sourceExhausted;
+ break;
+ }
+ } else if (flags == strictConversion) {
+ /* UTF-16 surrogate values are illegal in UTF-32 */
+ if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ }
+ }
+ /* Figure out how many bytes the result will require */
+ if (ch < (UTF32)0x80) { bytesToWrite = 1;
+ } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
+ } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
+ } else if (ch < (UTF32)0x110000) { bytesToWrite = 4;
+ } else { bytesToWrite = 3;
+ ch = UNI_REPLACEMENT_CHAR;
+ }
+
+ target += bytesToWrite;
+ if (target > targetEnd) {
+ source = oldSource; /* Back up source pointer! */
+ target -= bytesToWrite; result = targetExhausted; break;
+ }
+ switch (bytesToWrite) { /* note: everything falls through. */
+ case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
+ }
+ target += bytesToWrite;
}
*sourceStart = source;
*targetStart = target;
@@ -209,19 +209,19 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) {
const UTF8 *srcptr = source+length;
switch (length) {
default: return false;
- /* Everything else falls through when "true"... */
+ /* Everything else falls through when "true"... */
case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
case 2: if ((a = (*--srcptr)) > 0xBF) return false;
- switch (*source) {
- /* no fall-through in this inner switch */
- case 0xE0: if (a < 0xA0) return false; break;
- case 0xED: if (a > 0x9F) return false; break;
- case 0xF0: if (a < 0x90) return false; break;
- case 0xF4: if (a > 0x8F) return false; break;
- default: if (a < 0x80) return false;
- }
+ switch (*source) {
+ /* no fall-through in this inner switch */
+ case 0xE0: if (a < 0xA0) return false; break;
+ case 0xED: if (a > 0x9F) return false; break;
+ case 0xF0: if (a < 0x90) return false; break;
+ case 0xF4: if (a > 0x8F) return false; break;
+ default: if (a < 0x80) return false;
+ }
case 1: if (*source >= 0x80 && *source < 0xC2) return false;
}
@@ -260,70 +260,70 @@ Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF8toUTF16 (
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
+ const UTF8** sourceStart, const UTF8* sourceEnd,
+ UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF8* source = *sourceStart;
UTF16* target = *targetStart;
while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- result = sourceExhausted; break;
- }
- /* Do this check whether lenient or strict */
- if (! isLegalUTF8(source, extraBytesToRead+1)) {
- result = sourceIllegal;
- break;
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (target >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up source pointer! */
- result = targetExhausted; break;
- }
- if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead+1); /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = (UTF16)ch; /* normal case */
- }
- } else if (ch > UNI_MAX_UTF16) {
- if (flags == strictConversion) {
- result = sourceIllegal;
- source -= (extraBytesToRead+1); /* return to the start */
- break; /* Bail out; shouldn't continue */
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- /* target is a character in range 0xFFFF - 0x10FFFF. */
- if (target + 1 >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up source pointer! */
- result = targetExhausted; break;
- }
- ch -= halfBase;
- *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
- *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
- }
+ UTF32 ch = 0;
+ unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
+ if (source + extraBytesToRead >= sourceEnd) {
+ result = sourceExhausted; break;
+ }
+ /* Do this check whether lenient or strict */
+ if (! isLegalUTF8(source, extraBytesToRead+1)) {
+ result = sourceIllegal;
+ break;
+ }
+ /*
+ * The cases all fall through. See "Note A" below.
+ */
+ switch (extraBytesToRead) {
+ case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
+ case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
+ case 3: ch += *source++; ch <<= 6;
+ case 2: ch += *source++; ch <<= 6;
+ case 1: ch += *source++; ch <<= 6;
+ case 0: ch += *source++;
+ }
+ ch -= offsetsFromUTF8[extraBytesToRead];
+
+ if (target >= targetEnd) {
+ source -= (extraBytesToRead+1); /* Back up source pointer! */
+ result = targetExhausted; break;
+ }
+ if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
+ /* UTF-16 surrogate values are illegal in UTF-32 */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+ if (flags == strictConversion) {
+ source -= (extraBytesToRead+1); /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ } else {
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ } else {
+ *target++ = (UTF16)ch; /* normal case */
+ }
+ } else if (ch > UNI_MAX_UTF16) {
+ if (flags == strictConversion) {
+ result = sourceIllegal;
+ source -= (extraBytesToRead+1); /* return to the start */
+ break; /* Bail out; shouldn't continue */
+ } else {
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ } else {
+ /* target is a character in range 0xFFFF - 0x10FFFF. */
+ if (target + 1 >= targetEnd) {
+ source -= (extraBytesToRead+1); /* Back up source pointer! */
+ result = targetExhausted; break;
+ }
+ ch -= halfBase;
+ *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
+ *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
+ }
}
*sourceStart = source;
*targetStart = target;
@@ -333,50 +333,50 @@ ConversionResult ConvertUTF8toUTF16 (
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF32toUTF8 (
- const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
+ const UTF32** sourceStart, const UTF32* sourceEnd,
+ UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF32* source = *sourceStart;
UTF8* target = *targetStart;
while (source < sourceEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- ch = *source++;
- if (flags == strictConversion ) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- /*
- * Figure out how many bytes the result will require. Turn any
- * illegally large UTF32 things (> Plane 17) into replacement chars.
- */
- if (ch < (UTF32)0x80) { bytesToWrite = 1;
- } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
- } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
- } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4;
- } else { bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- result = sourceIllegal;
- }
-
- target += bytesToWrite;
- if (target > targetEnd) {
- --source; /* Back up source pointer! */
- target -= bytesToWrite; result = targetExhausted; break;
- }
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
- }
- target += bytesToWrite;
+ UTF32 ch;
+ unsigned short bytesToWrite = 0;
+ const UTF32 byteMask = 0xBF;
+ const UTF32 byteMark = 0x80;
+ ch = *source++;
+ if (flags == strictConversion ) {
+ /* UTF-16 surrogate values are illegal in UTF-32 */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ }
+ }
+ /*
+ * Figure out how many bytes the result will require. Turn any
+ * illegally large UTF32 things (> Plane 17) into replacement chars.
+ */
+ if (ch < (UTF32)0x80) { bytesToWrite = 1;
+ } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
+ } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
+ } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4;
+ } else { bytesToWrite = 3;
+ ch = UNI_REPLACEMENT_CHAR;
+ result = sourceIllegal;
+ }
+
+ target += bytesToWrite;
+ if (target > targetEnd) {
+ --source; /* Back up source pointer! */
+ target -= bytesToWrite; result = targetExhausted; break;
+ }
+ switch (bytesToWrite) { /* note: everything falls through. */
+ case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
+ }
+ target += bytesToWrite;
}
*sourceStart = source;
*targetStart = target;
@@ -386,59 +386,59 @@ ConversionResult ConvertUTF32toUTF8 (
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF8toUTF32 (
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
+ const UTF8** sourceStart, const UTF8* sourceEnd,
+ UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF8* source = *sourceStart;
UTF32* target = *targetStart;
while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- result = sourceExhausted; break;
- }
- /* Do this check whether lenient or strict */
- if (! isLegalUTF8(source, extraBytesToRead+1)) {
- result = sourceIllegal;
- break;
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6;
- case 4: ch += *source++; ch <<= 6;
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (target >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up the source pointer! */
- result = targetExhausted; break;
- }
- if (ch <= UNI_MAX_LEGAL_UTF32) {
- /*
- * UTF-16 surrogate values are illegal in UTF-32, and anything
- * over Plane 17 (> 0x10FFFF) is illegal.
- */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead+1); /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = ch;
- }
- } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */
- result = sourceIllegal;
- *target++ = UNI_REPLACEMENT_CHAR;
- }
+ UTF32 ch = 0;
+ unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
+ if (source + extraBytesToRead >= sourceEnd) {
+ result = sourceExhausted; break;
+ }
+ /* Do this check whether lenient or strict */
+ if (! isLegalUTF8(source, extraBytesToRead+1)) {
+ result = sourceIllegal;
+ break;
+ }
+ /*
+ * The cases all fall through. See "Note A" below.
+ */
+ switch (extraBytesToRead) {
+ case 5: ch += *source++; ch <<= 6;
+ case 4: ch += *source++; ch <<= 6;
+ case 3: ch += *source++; ch <<= 6;
+ case 2: ch += *source++; ch <<= 6;
+ case 1: ch += *source++; ch <<= 6;
+ case 0: ch += *source++;
+ }
+ ch -= offsetsFromUTF8[extraBytesToRead];
+
+ if (target >= targetEnd) {
+ source -= (extraBytesToRead+1); /* Back up the source pointer! */
+ result = targetExhausted; break;
+ }
+ if (ch <= UNI_MAX_LEGAL_UTF32) {
+ /*
+ * UTF-16 surrogate values are illegal in UTF-32, and anything
+ * over Plane 17 (> 0x10FFFF) is illegal.
+ */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+ if (flags == strictConversion) {
+ source -= (extraBytesToRead+1); /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ } else {
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ } else {
+ *target++ = ch;
+ }
+ } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */
+ result = sourceIllegal;
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
}
*sourceStart = source;
*targetStart = target;
@@ -451,14 +451,14 @@ ConversionResult ConvertUTF8toUTF32 (
The fall-through switches in UTF-8 reading code save a
temp variable, some decrements & conditionals. The switches
are equivalent to the following loop:
- {
- int tmpBytesToRead = extraBytesToRead+1;
- do {
- ch += *source++;
- --tmpBytesToRead;
- if (tmpBytesToRead) ch <<= 6;
- } while (tmpBytesToRead > 0);
- }
+ {
+ int tmpBytesToRead = extraBytesToRead+1;
+ do {
+ ch += *source++;
+ --tmpBytesToRead;
+ if (tmpBytesToRead) ch <<= 6;
+ } while (tmpBytesToRead > 0);
+ }
In UTF-8 writing code, the switches on "bytesToWrite" are
similarly unrolled loops.
diff --git a/cppe/src/IceE/ConvertUTF.h b/cppe/src/IceE/ConvertUTF.h
index 92f461a91e5..07e2c0afcd8 100644
--- a/cppe/src/IceE/ConvertUTF.h
+++ b/cppe/src/IceE/ConvertUTF.h
@@ -62,12 +62,12 @@
the respective buffers.
Input parameters:
- sourceStart - pointer to a pointer to the source buffer.
- The contents of this are modified on return so that
- it points at the next thing to be converted.
- targetStart - similarly, pointer to pointer to the target buffer.
- sourceEnd, targetEnd - respectively pointers to the ends of the
- two buffers, for overflow checking only.
+ sourceStart - pointer to a pointer to the source buffer.
+ The contents of this are modified on return so that
+ it points at the next thing to be converted.
+ targetStart - similarly, pointer to pointer to the target buffer.
+ sourceEnd, targetEnd - respectively pointers to the ends of the
+ two buffers, for overflow checking only.
These conversion functions take a ConversionFlags argument. When this
flag is set to strict, both irregular sequences and isolated surrogates
@@ -84,15 +84,15 @@
they constitute an error.
Output parameters:
- The value "sourceIllegal" is returned from some routines if the input
- sequence is malformed. When "sourceIllegal" is returned, the source
- value will point to the illegal value that caused the problem. E.g.,
- in UTF-8 when a sequence is malformed, it points to the start of the
- malformed sequence.
+ The value "sourceIllegal" is returned from some routines if the input
+ sequence is malformed. When "sourceIllegal" is returned, the source
+ value will point to the illegal value that caused the problem. E.g.,
+ in UTF-8 when a sequence is malformed, it points to the start of the
+ malformed sequence.
Author: Mark E. Davis, 1994.
Rev History: Rick McGowan, fixes & updates May 2001.
- Fixes & updates, Sept 2001.
+ Fixes & updates, Sept 2001.
------------------------------------------------------------------------ */
@@ -107,10 +107,10 @@
namespace IceUtil
{
-typedef unsigned int UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned char UTF8; /* typically 8 bits */
-typedef bool Boolean; /* 0 or 1 */
+typedef unsigned int UTF32; /* at least 32 bits */
+typedef unsigned short UTF16; /* at least 16 bits */
+typedef unsigned char UTF8; /* typically 8 bits */
+typedef bool Boolean; /* 0 or 1 */
/* Some fundamental constants */
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
@@ -127,7 +127,7 @@ ConversionResult ConvertUTF8toUTF16(
ConversionResult ConvertUTF16toUTF8 (
const UTF16** sourceStart, const UTF16* sourceEnd,
UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
-
+
ConversionResult ConvertUTF8toUTF32(
const UTF8** sourceStart, const UTF8* sourceEnd,
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
diff --git a/cppe/src/IceE/Current.cpp b/cppe/src/IceE/Current.cpp
index 9b5543f9e39..0ae5348eefb 100644
--- a/cppe/src/IceE/Current.cpp
+++ b/cppe/src/IceE/Current.cpp
@@ -20,35 +20,35 @@ Ice::Current::operator!=(const Current& __rhs) const
{
if(this == &__rhs)
{
- return false;
+ return false;
}
if(adapter != __rhs.adapter)
{
- return true;
+ return true;
}
if(con != __rhs.con)
{
- return true;
+ return true;
}
if(id != __rhs.id)
{
- return true;
+ return true;
}
if(facet != __rhs.facet)
{
- return true;
+ return true;
}
if(operation != __rhs.operation)
{
- return true;
+ return true;
}
if(mode != __rhs.mode)
{
- return true;
+ return true;
}
if(ctx != __rhs.ctx)
{
- return true;
+ return true;
}
return false;
}
@@ -58,63 +58,63 @@ Ice::Current::operator<(const Current& __rhs) const
{
if(this == &__rhs)
{
- return false;
+ return false;
}
if(adapter < __rhs.adapter)
{
- return true;
+ return true;
}
else if(__rhs.adapter < adapter)
{
- return false;
+ return false;
}
if(con < __rhs.con)
{
- return true;
+ return true;
}
else if(__rhs.con < con)
{
- return false;
+ return false;
}
if(id < __rhs.id)
{
- return true;
+ return true;
}
else if(__rhs.id < id)
{
- return false;
+ return false;
}
if(facet < __rhs.facet)
{
- return true;
+ return true;
}
else if(__rhs.facet < facet)
{
- return false;
+ return false;
}
if(operation < __rhs.operation)
{
- return true;
+ return true;
}
else if(__rhs.operation < operation)
{
- return false;
+ return false;
}
if(mode < __rhs.mode)
{
- return true;
+ return true;
}
else if(__rhs.mode < mode)
{
- return false;
+ return false;
}
if(ctx < __rhs.ctx)
{
- return true;
+ return true;
}
else if(__rhs.ctx < ctx)
{
- return false;
+ return false;
}
return false;
}
diff --git a/cppe/src/IceE/DefaultsAndOverrides.cpp b/cppe/src/IceE/DefaultsAndOverrides.cpp
index 1f1a2e6f75c..7b47da40d5c 100644
--- a/cppe/src/IceE/DefaultsAndOverrides.cpp
+++ b/cppe/src/IceE/DefaultsAndOverrides.cpp
@@ -34,15 +34,15 @@ IceInternal::DefaultsAndOverrides::DefaultsAndOverrides(const PropertiesPtr& pro
value = properties->getProperty("Ice.Override.Timeout");
if(!value.empty())
{
- const_cast<bool&>(overrideTimeout) = true;
- const_cast<Int&>(overrideTimeoutValue) = properties->getPropertyAsInt("Ice.Override.Timeout");
+ const_cast<bool&>(overrideTimeout) = true;
+ const_cast<Int&>(overrideTimeoutValue) = properties->getPropertyAsInt("Ice.Override.Timeout");
}
value = properties->getProperty("Ice.Override.ConnectTimeout");
if(!value.empty())
{
- const_cast<bool&>(overrideConnectTimeout) = true;
- const_cast<Int&>(overrideConnectTimeoutValue) = properties->getPropertyAsInt("Ice.Override.ConnectTimeout");
+ const_cast<bool&>(overrideConnectTimeout) = true;
+ const_cast<Int&>(overrideConnectTimeoutValue) = properties->getPropertyAsInt("Ice.Override.ConnectTimeout");
}
#ifdef ICEE_HAS_LOCATOR
diff --git a/cppe/src/IceE/ExceptionBase.cpp b/cppe/src/IceE/ExceptionBase.cpp
index 1396a516f3a..83467e3a8a5 100644
--- a/cppe/src/IceE/ExceptionBase.cpp
+++ b/cppe/src/IceE/ExceptionBase.cpp
@@ -99,12 +99,12 @@ IceUtil::NullHandleException::NullHandleException(const char* file, int line) :
if(nullHandleAbort)
{
#ifdef _WIN32_WCE
- //
- // WinCE does not appear to have abort()
- //
- exit(-1);
+ //
+ // WinCE does not appear to have abort()
+ //
+ exit(-1);
#else
- abort();
+ abort();
#endif
}
}
diff --git a/cppe/src/IceE/FactoryTableDef.cpp b/cppe/src/IceE/FactoryTableDef.cpp
index db0ffdfbb8d..127312d6b53 100644
--- a/cppe/src/IceE/FactoryTableDef.cpp
+++ b/cppe/src/IceE/FactoryTableDef.cpp
@@ -17,11 +17,11 @@
namespace IceInternal
{
-FactoryTableWrapper factoryTableWrapper; // Single global instance of the wrapper object that
- // initializes factoryTable.
+FactoryTableWrapper factoryTableWrapper; // Single global instance of the wrapper object that
+ // initializes factoryTable.
-ICE_API FactoryTableDef* factoryTable; // Single global instance of the factory table for
- // non-local exceptions and non-abstract classes
+ICE_API FactoryTableDef* factoryTable; // Single global instance of the factory table for
+ // non-local exceptions and non-abstract classes
}
//
@@ -35,11 +35,11 @@ IceInternal::FactoryTableDef::addExceptionFactory(const std::string& t, const Ic
EFTable::iterator i = _eft.find(t);
if(i == _eft.end())
{
- _eft[t] = EFPair(f, 1);
+ _eft[t] = EFPair(f, 1);
}
else
{
- i->second.second++;
+ i->second.second++;
}
}
@@ -54,23 +54,23 @@ IceInternal::FactoryTableDef::getExceptionFactory(const std::string& t) const
#ifdef __APPLE__
if(i == _eft.end())
{
- lock.release();
-
- //
- // Try to find the symbol, if found this should trigger the
- // object static constructors to be called.
- //
- std::string symbol = "__F";
- for(std::string::const_iterator p = t.begin(); p != t.end(); ++p)
- {
- symbol += ((*p) == ':') ? '_' : *p;
- }
- symbol += "__initializer";
- dlsym(RTLD_DEFAULT, symbol.c_str());
-
- lock.acquire();
-
- i = _eft.find(t);
+ lock.release();
+
+ //
+ // Try to find the symbol, if found this should trigger the
+ // object static constructors to be called.
+ //
+ std::string symbol = "__F";
+ for(std::string::const_iterator p = t.begin(); p != t.end(); ++p)
+ {
+ symbol += ((*p) == ':') ? '_' : *p;
+ }
+ symbol += "__initializer";
+ dlsym(RTLD_DEFAULT, symbol.c_str());
+
+ lock.acquire();
+
+ i = _eft.find(t);
}
#endif
return i != _eft.end() ? i->second.first : IceInternal::UserExceptionFactoryPtr();
@@ -89,10 +89,10 @@ IceInternal::FactoryTableDef::removeExceptionFactory(const std::string& t)
EFTable::iterator i = _eft.find(t);
if(i != _eft.end())
{
- if(--i->second.second == 0)
- {
- _eft.erase(i);
- }
+ if(--i->second.second == 0)
+ {
+ _eft.erase(i);
+ }
}
}
@@ -122,7 +122,7 @@ IceInternal::FactoryTableWrapper::initialize()
IceUtil::StaticMutex::Lock lock(_m);
if(_initCount == 0)
{
- factoryTable = new FactoryTableDef;
+ factoryTable = new FactoryTableDef;
}
++_initCount;
}
@@ -136,9 +136,9 @@ IceInternal::FactoryTableWrapper::finalize()
IceUtil::StaticMutex::Lock lock(_m);
if(--_initCount == 0)
{
- delete factoryTable;
+ delete factoryTable;
}
}
IceUtil::StaticMutex IceInternal::FactoryTableWrapper::_m = ICE_STATIC_MUTEX_INITIALIZER;
-int IceInternal::FactoryTableWrapper::_initCount = 0; // Initialization count
+int IceInternal::FactoryTableWrapper::_initCount = 0; // Initialization count
diff --git a/cppe/src/IceE/Incoming.cpp b/cppe/src/IceE/Incoming.cpp
index 4f5dbb63848..3ea3984b4bf 100644
--- a/cppe/src/IceE/Incoming.cpp
+++ b/cppe/src/IceE/Incoming.cpp
@@ -45,15 +45,15 @@ IceInternal::Incoming::setAdapter(const Ice::ObjectAdapterPtr& adapter)
_adapter = adapter;
if(_adapter)
{
- _servantManager = _adapter->getServantManager().get();
- if(!_servantManager)
- {
- _adapter = 0;
- }
+ _servantManager = _adapter->getServantManager().get();
+ if(!_servantManager)
+ {
+ _adapter = 0;
+ }
}
else
{
- _servantManager = 0;
+ _servantManager = 0;
}
}
@@ -85,26 +85,26 @@ IceInternal::Incoming::invoke(bool response, Int requestId)
// string facet;
// if(!facetPath.empty())
// {
-// if(facetPath.size() > 1)
-// {
-// throw MarshalException(__FILE__, __LINE__);
-// }
-// facet.swap(facetPath[0]);
+// if(facetPath.size() > 1)
+// {
+// throw MarshalException(__FILE__, __LINE__);
+// }
+// facet.swap(facetPath[0]);
// }
// _current.facet.swap(facet);
Int sz;
_is.readSize(sz);
if(sz > 0)
{
- if(sz > 1)
- {
- throw MarshalException(__FILE__, __LINE__);
- }
- _is.read(_current.facet);
+ if(sz > 1)
+ {
+ throw MarshalException(__FILE__, __LINE__);
+ }
+ _is.read(_current.facet);
}
else
{
- _current.facet.clear();
+ _current.facet.clear();
}
_is.read(_current.operation, false);
@@ -116,19 +116,19 @@ IceInternal::Incoming::invoke(bool response, Int requestId)
_is.readSize(sz);
while(sz--)
{
- pair<const string, string> pr;
- _is.read(const_cast<string&>(pr.first));
- _is.read(pr.second);
- _current.ctx.insert(_current.ctx.end(), pr);
+ pair<const string, string> pr;
+ _is.read(const_cast<string&>(pr.first));
+ _is.read(pr.second);
+ _current.ctx.insert(_current.ctx.end(), pr);
}
_is.startReadEncaps();
if(response)
{
- assert(_os.b.size() == headerSize + 4); // Reply status position.
- _os.write(replyOK);
- _os.startWriteEncaps();
+ assert(_os.b.size() == headerSize + 4); // Reply status position.
+ _os.write(replyOK);
+ _os.startWriteEncaps();
}
@@ -143,294 +143,294 @@ IceInternal::Incoming::invoke(bool response, Int requestId)
try
{
- Ice::ObjectPtr servant;
- if(_servantManager)
- {
- servant = _servantManager->findServant(_current.id, _current.facet);
- }
-
- if(!servant)
- {
- if(_servantManager && _servantManager->hasServant(_current.id))
- {
- replyStatus = replyFacetNotExist;
- }
- else
- {
- replyStatus = replyObjectNotExist;
- }
- }
- else
- {
- dispatchStatus = servant->__dispatch(*this, _current);
+ Ice::ObjectPtr servant;
+ if(_servantManager)
+ {
+ servant = _servantManager->findServant(_current.id, _current.facet);
+ }
+
+ if(!servant)
+ {
+ if(_servantManager && _servantManager->hasServant(_current.id))
+ {
+ replyStatus = replyFacetNotExist;
+ }
+ else
+ {
+ replyStatus = replyObjectNotExist;
+ }
+ }
+ else
+ {
+ dispatchStatus = servant->__dispatch(*this, _current);
if(dispatchStatus == DispatchUserException)
{
replyStatus = replyUserException;
}
- }
+ }
}
catch(RequestFailedException& ex)
{
- _is.endReadEncaps();
-
- if(ex.id.name.empty())
- {
- ex.id = _current.id;
- }
-
- if(ex.facet.empty() && !_current.facet.empty())
- {
- ex.facet = _current.facet;
- }
-
- if(ex.operation.empty() && !_current.operation.empty())
- {
- ex.operation = _current.operation;
- }
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 1)
- {
- __warning(ex);
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- if(dynamic_cast<ObjectNotExistException*>(&ex))
- {
- _os.write(replyObjectNotExist);
- }
- else if(dynamic_cast<FacetNotExistException*>(&ex))
- {
- _os.write(replyFacetNotExist);
- }
- else if(dynamic_cast<OperationNotExistException*>(&ex))
- {
- _os.write(replyOperationNotExist);
- }
- else
- {
- assert(false);
- }
-
- ex.id.__write(&_os);
-
- //
- // For compatibility with the old FacetPath.
- //
- if(ex.facet.empty())
- {
- _os.write(static_cast<string*>(0), static_cast<string*>(0));
- }
- else
- {
- _os.write(&ex.facet, &ex.facet + 1);
- }
-
- _os.write(ex.operation, false);
-
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(ex.id.name.empty())
+ {
+ ex.id = _current.id;
+ }
+
+ if(ex.facet.empty() && !_current.facet.empty())
+ {
+ ex.facet = _current.facet;
+ }
+
+ if(ex.operation.empty() && !_current.operation.empty())
+ {
+ ex.operation = _current.operation;
+ }
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 1)
+ {
+ __warning(ex);
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ if(dynamic_cast<ObjectNotExistException*>(&ex))
+ {
+ _os.write(replyObjectNotExist);
+ }
+ else if(dynamic_cast<FacetNotExistException*>(&ex))
+ {
+ _os.write(replyFacetNotExist);
+ }
+ else if(dynamic_cast<OperationNotExistException*>(&ex))
+ {
+ _os.write(replyOperationNotExist);
+ }
+ else
+ {
+ assert(false);
+ }
+
+ ex.id.__write(&_os);
+
+ //
+ // For compatibility with the old FacetPath.
+ //
+ if(ex.facet.empty())
+ {
+ _os.write(static_cast<string*>(0), static_cast<string*>(0));
+ }
+ else
+ {
+ _os.write(&ex.facet, &ex.facet + 1);
+ }
+
+ _os.write(ex.operation, false);
+
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
catch(const UnknownLocalException& ex)
{
- _is.endReadEncaps();
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
- {
- __warning(ex);
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyUnknownLocalException);
- _os.write(ex.unknown, false);
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyUnknownLocalException);
+ _os.write(ex.unknown, false);
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
catch(const UnknownUserException& ex)
{
- _is.endReadEncaps();
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
- {
- __warning(ex);
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyUnknownUserException);
- _os.write(ex.unknown, false);
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyUnknownUserException);
+ _os.write(ex.unknown, false);
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
catch(const UnknownException& ex)
{
- _is.endReadEncaps();
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
- {
- __warning(ex);
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyUnknownException);
- _os.write(ex.unknown, false);
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyUnknownException);
+ _os.write(ex.unknown, false);
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
catch(const LocalException& ex)
{
- _is.endReadEncaps();
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
- {
- __warning(ex);
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyUnknownLocalException);
- _os.write(ex.toString(), false);
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyUnknownLocalException);
+ _os.write(ex.toString(), false);
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
catch(const UserException& ex)
{
- _is.endReadEncaps();
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
- {
- __warning(ex);
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyUnknownUserException);
- _os.write(ex.toString(), false);
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyUnknownUserException);
+ _os.write(ex.toString(), false);
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
catch(const Exception& ex)
{
- _is.endReadEncaps();
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
- {
- __warning(ex);
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyUnknownException);
- _os.write(ex.toString(), false);
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyUnknownException);
+ _os.write(ex.toString(), false);
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
catch(const std::exception& ex)
{
- _is.endReadEncaps();
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
- {
- __warning(string("std::exception: ") + ex.what());
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyUnknownException);
- string msg = string("std::exception: ") + ex.what();
- _os.write(msg, false);
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(string("std::exception: ") + ex.what());
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyUnknownException);
+ string msg = string("std::exception: ") + ex.what();
+ _os.write(msg, false);
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
catch(...)
{
- _is.endReadEncaps();
-
- if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
- {
- __warning("unknown c++ exception");
- }
-
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyUnknownException);
- _os.write(string("unknown c++ exception"), false);
- _connection->sendResponse(&_os);
- }
- else
- {
- _connection->sendNoResponse();
- }
-
- return;
+ _is.endReadEncaps();
+
+ if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning("unknown c++ exception");
+ }
+
+ if(response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyUnknownException);
+ _os.write(string("unknown c++ exception"), false);
+ _connection->sendResponse(&_os);
+ }
+ else
+ {
+ _connection->sendNoResponse();
+ }
+
+ return;
}
//
@@ -443,42 +443,42 @@ IceInternal::Incoming::invoke(bool response, Int requestId)
if(response)
{
- _os.endWriteEncaps();
-
- if(replyStatus != replyOK && replyStatus != replyUserException)
- {
- assert(replyStatus == replyObjectNotExist ||
- replyStatus == replyFacetNotExist);
-
- _os.b.resize(headerSize + 4); // Reply status position.
- _os.write(replyStatus);
-
- _current.id.__write(&_os);
-
- //
- // For compatibility with the old FacetPath.
- //
- if(_current.facet.empty())
- {
- _os.write(static_cast<string*>(0), static_cast<string*>(0));
- }
- else
- {
- _os.write(&_current.facet, &_current.facet + 1);
- }
-
- _os.write(_current.operation, false);
- }
- else
- {
- *(_os.b.begin() + headerSize + 4) = replyStatus; // Reply status position.
- }
-
- _connection->sendResponse(&_os);
+ _os.endWriteEncaps();
+
+ if(replyStatus != replyOK && replyStatus != replyUserException)
+ {
+ assert(replyStatus == replyObjectNotExist ||
+ replyStatus == replyFacetNotExist);
+
+ _os.b.resize(headerSize + 4); // Reply status position.
+ _os.write(replyStatus);
+
+ _current.id.__write(&_os);
+
+ //
+ // For compatibility with the old FacetPath.
+ //
+ if(_current.facet.empty())
+ {
+ _os.write(static_cast<string*>(0), static_cast<string*>(0));
+ }
+ else
+ {
+ _os.write(&_current.facet, &_current.facet + 1);
+ }
+
+ _os.write(_current.operation, false);
+ }
+ else
+ {
+ *(_os.b.begin() + headerSize + 4) = replyStatus; // Reply status position.
+ }
+
+ _connection->sendResponse(&_os);
}
else
{
- _connection->sendNoResponse();
+ _connection->sendNoResponse();
}
}
diff --git a/cppe/src/IceE/IncomingConnectionFactory.cpp b/cppe/src/IceE/IncomingConnectionFactory.cpp
index 8d124ad232c..d3c9cee90e3 100644
--- a/cppe/src/IceE/IncomingConnectionFactory.cpp
+++ b/cppe/src/IceE/IncomingConnectionFactory.cpp
@@ -53,22 +53,22 @@ IceInternal::IncomingConnectionFactory::waitUntilHolding() const
list<ConnectionPtr> connections;
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- //
- // First we wait until the connection factory itself is in holding
- // state.
- //
- while(_state < StateHolding)
- {
- wait();
- }
-
- //
- // We want to wait until all connections are in holding state
- // outside the thread synchronization.
- //
- connections = _connections;
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ //
+ // First we wait until the connection factory itself is in holding
+ // state.
+ //
+ while(_state < StateHolding)
+ {
+ wait();
+ }
+
+ //
+ // We want to wait until all connections are in holding state
+ // outside the thread synchronization.
+ //
+ connections = _connections;
}
//
@@ -84,30 +84,30 @@ IceInternal::IncomingConnectionFactory::waitUntilFinished()
list<ConnectionPtr> connections;
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- //
- // First we wait until the factory is destroyed. If we are using
- // an acceptor, we also wait for it to be closed.
- //
- while(_state != StateClosed || _acceptor)
- {
- wait();
- }
-
- threadPerIncomingConnectionFactory = _threadPerIncomingConnectionFactory;
- _threadPerIncomingConnectionFactory = 0;
-
- //
- // We want to wait until all connections are finished outside the
- // thread synchronization.
- //
- connections.swap(_connections);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ //
+ // First we wait until the factory is destroyed. If we are using
+ // an acceptor, we also wait for it to be closed.
+ //
+ while(_state != StateClosed || _acceptor)
+ {
+ wait();
+ }
+
+ threadPerIncomingConnectionFactory = _threadPerIncomingConnectionFactory;
+ _threadPerIncomingConnectionFactory = 0;
+
+ //
+ // We want to wait until all connections are finished outside the
+ // thread synchronization.
+ //
+ connections.swap(_connections);
}
if(threadPerIncomingConnectionFactory)
{
- threadPerIncomingConnectionFactory->getThreadControl().join();
+ threadPerIncomingConnectionFactory->getThreadControl().join();
}
for_each(connections.begin(), connections.end(), Ice::voidMemFun(&Connection::waitUntilFinished));
@@ -131,7 +131,7 @@ IceInternal::IncomingConnectionFactory::connections() const
// Only copy connections which have not been destroyed.
//
remove_copy_if(_connections.begin(), _connections.end(), back_inserter(result),
- Ice::constMemFun(&Connection::isDestroyed));
+ Ice::constMemFun(&Connection::isDestroyed));
return result;
}
@@ -143,14 +143,14 @@ IceInternal::IncomingConnectionFactory::flushBatchRequests()
for(list<ConnectionPtr>::const_iterator p = c.begin(); p != c.end(); ++p)
{
- try
- {
- (*p)->flushBatchRequests();
- }
- catch(const LocalException&)
- {
- // Ignore.
- }
+ try
+ {
+ (*p)->flushBatchRequests();
+ }
+ catch(const LocalException&)
+ {
+ // Ignore.
+ }
}
}
@@ -161,7 +161,7 @@ IceInternal::IncomingConnectionFactory::toString() const
if(_transceiver)
{
- return _transceiver->toString();
+ return _transceiver->toString();
}
assert(_acceptor);
@@ -169,8 +169,8 @@ IceInternal::IncomingConnectionFactory::toString() const
}
IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const InstancePtr& instance,
- const EndpointPtr& endpoint,
- const ObjectAdapterPtr& adapter) :
+ const EndpointPtr& endpoint,
+ const ObjectAdapterPtr& adapter) :
_instance(instance),
_endpoint(endpoint),
_adapter(adapter),
@@ -179,8 +179,8 @@ IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const Instance
{
if(_instance->defaultsAndOverrides()->overrideTimeout)
{
- const_cast<EndpointPtr&>(_endpoint) =
- _endpoint->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue);
+ const_cast<EndpointPtr&>(_endpoint) =
+ _endpoint->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue);
}
_acceptor = _endpoint->acceptor(const_cast<EndpointPtr&>(_endpoint));
@@ -190,36 +190,36 @@ IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const Instance
__setNoDelete(true);
try
{
- //
- // If we are in thread per connection mode, we also use one
- // thread per incoming connection factory, that accepts new
- // connections on this endpoint.
- //
- _threadPerIncomingConnectionFactory = new ThreadPerIncomingConnectionFactory(this);
- _threadPerIncomingConnectionFactory->start(_instance->threadPerConnectionStackSize());
+ //
+ // If we are in thread per connection mode, we also use one
+ // thread per incoming connection factory, that accepts new
+ // connections on this endpoint.
+ //
+ _threadPerIncomingConnectionFactory = new ThreadPerIncomingConnectionFactory(this);
+ _threadPerIncomingConnectionFactory->start(_instance->threadPerConnectionStackSize());
}
catch(const Ice::Exception& ex)
{
- {
- Error out(_instance->initializationData().logger);
- out << "cannot create thread for incoming connection factory:\n" << ex.toString();
- }
-
- try
- {
- _acceptor->close();
- }
- catch(const LocalException&)
- {
- // Here we ignore any exceptions in close().
- }
-
- _state = StateClosed;
- _acceptor = 0;
- _threadPerIncomingConnectionFactory = 0;
-
- __setNoDelete(false);
- ex.ice_throw();
+ {
+ Error out(_instance->initializationData().logger);
+ out << "cannot create thread for incoming connection factory:\n" << ex.toString();
+ }
+
+ try
+ {
+ _acceptor->close();
+ }
+ catch(const LocalException&)
+ {
+ // Here we ignore any exceptions in close().
+ }
+
+ _state = StateClosed;
+ _acceptor = 0;
+ _threadPerIncomingConnectionFactory = 0;
+
+ __setNoDelete(false);
+ ex.ice_throw();
}
__setNoDelete(false);
}
@@ -239,52 +239,52 @@ IceInternal::IncomingConnectionFactory::setState(State state)
{
if(_state == state) // Don't switch twice.
{
- return;
+ return;
}
switch(state)
{
- case StateActive:
- {
- if(_state != StateHolding) // Can only switch from holding to active.
- {
- return;
- }
- for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&Connection::activate));
- break;
- }
-
- case StateHolding:
- {
- if(_state != StateActive) // Can only switch from active to holding.
- {
- return;
- }
- for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&Connection::hold));
- break;
- }
-
- case StateClosed:
- {
- if(_acceptor)
- {
- //
- // Connect to our own acceptor, which unblocks our
- // thread per incoming connection factory stuck in accept().
- //
- _acceptor->connectToSelf();
- }
+ case StateActive:
+ {
+ if(_state != StateHolding) // Can only switch from holding to active.
+ {
+ return;
+ }
+ for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&Connection::activate));
+ break;
+ }
+
+ case StateHolding:
+ {
+ if(_state != StateActive) // Can only switch from active to holding.
+ {
+ return;
+ }
+ for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&Connection::hold));
+ break;
+ }
+
+ case StateClosed:
+ {
+ if(_acceptor)
+ {
+ //
+ // Connect to our own acceptor, which unblocks our
+ // thread per incoming connection factory stuck in accept().
+ //
+ _acceptor->connectToSelf();
+ }
#ifdef _STLP_BEGIN_NAMESPACE
- // voidbind2nd is an STLport extension for broken compilers in IceE/Functional.h
- for_each(_connections.begin(), _connections.end(),
- voidbind2nd(Ice::voidMemFun1(&Connection::destroy), Connection::ObjectAdapterDeactivated));
+ // voidbind2nd is an STLport extension for broken compilers in IceE/Functional.h
+ for_each(_connections.begin(), _connections.end(),
+ voidbind2nd(Ice::voidMemFun1(&Connection::destroy), Connection::ObjectAdapterDeactivated));
#else
- for_each(_connections.begin(), _connections.end(),
- bind2nd(Ice::voidMemFun1(&Connection::destroy), Connection::ObjectAdapterDeactivated));
+ for_each(_connections.begin(), _connections.end(),
+ bind2nd(Ice::voidMemFun1(&Connection::destroy), Connection::ObjectAdapterDeactivated));
#endif
- break;
- }
+ break;
+ }
}
_state = state;
@@ -298,109 +298,109 @@ IceInternal::IncomingConnectionFactory::run()
while(true)
{
- //
- // We must accept new connections outside the thread
- // synchronization, because we use blocking accept.
- //
- TransceiverPtr transceiver;
- try
- {
- transceiver = _acceptor->accept();
- }
- catch(const SocketException&)
- {
- // Ignore socket exceptions.
- }
- catch(const TimeoutException&)
- {
- // Ignore timeouts.
- }
- catch(const LocalException& ex)
- {
- // Warn about other Ice local exceptions.
- if(_warn)
- {
- Warning out(_instance->initializationData().logger);
- out << "connection exception:\n" << ex.toString() << "\n" << _acceptor->toString();
- }
- }
-
- ConnectionPtr connection;
-
- {
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- while(_state == StateHolding)
- {
- wait();
- }
-
- if(_state == StateClosed)
- {
- if(transceiver)
- {
- try
- {
- transceiver->close();
- }
- catch(const LocalException&)
- {
- // Here we ignore any exceptions in close().
- }
- }
-
- try
- {
- _acceptor->close();
- }
- catch(const LocalException& ex)
- {
- _acceptor = 0;
- notifyAll();
- ex.ice_throw();
- }
-
- _acceptor = 0;
- notifyAll();
- return;
- }
-
- assert(_state == StateActive);
-
- //
- // Reap connections for which destruction has completed.
- //
- _connections.erase(remove_if(_connections.begin(), _connections.end(),
- Ice::constMemFun(&Connection::isFinished)),
- _connections.end());
-
- //
- // Create a connection object for the connection.
- //
- if(transceiver)
- {
- try
- {
- connection = new Connection(_instance, transceiver, _endpoint, _adapter);
- }
- catch(const LocalException&)
- {
- return;
- }
-
- _connections.push_back(connection);
- }
- }
-
- //
- // In thread per connection mode, the connection's thread will
- // take care of connection validation and activation. We don't
- // want to block this thread waiting until validation is
- // complete because it is the only thread that can accept
- // connections with this factory's acceptor. Therefore we
- // don't call validate() and activate() from the connection
- // factory in thread per connection mode.
- //
+ //
+ // We must accept new connections outside the thread
+ // synchronization, because we use blocking accept.
+ //
+ TransceiverPtr transceiver;
+ try
+ {
+ transceiver = _acceptor->accept();
+ }
+ catch(const SocketException&)
+ {
+ // Ignore socket exceptions.
+ }
+ catch(const TimeoutException&)
+ {
+ // Ignore timeouts.
+ }
+ catch(const LocalException& ex)
+ {
+ // Warn about other Ice local exceptions.
+ if(_warn)
+ {
+ Warning out(_instance->initializationData().logger);
+ out << "connection exception:\n" << ex.toString() << "\n" << _acceptor->toString();
+ }
+ }
+
+ ConnectionPtr connection;
+
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ while(_state == StateHolding)
+ {
+ wait();
+ }
+
+ if(_state == StateClosed)
+ {
+ if(transceiver)
+ {
+ try
+ {
+ transceiver->close();
+ }
+ catch(const LocalException&)
+ {
+ // Here we ignore any exceptions in close().
+ }
+ }
+
+ try
+ {
+ _acceptor->close();
+ }
+ catch(const LocalException& ex)
+ {
+ _acceptor = 0;
+ notifyAll();
+ ex.ice_throw();
+ }
+
+ _acceptor = 0;
+ notifyAll();
+ return;
+ }
+
+ assert(_state == StateActive);
+
+ //
+ // Reap connections for which destruction has completed.
+ //
+ _connections.erase(remove_if(_connections.begin(), _connections.end(),
+ Ice::constMemFun(&Connection::isFinished)),
+ _connections.end());
+
+ //
+ // Create a connection object for the connection.
+ //
+ if(transceiver)
+ {
+ try
+ {
+ connection = new Connection(_instance, transceiver, _endpoint, _adapter);
+ }
+ catch(const LocalException&)
+ {
+ return;
+ }
+
+ _connections.push_back(connection);
+ }
+ }
+
+ //
+ // In thread per connection mode, the connection's thread will
+ // take care of connection validation and activation. We don't
+ // want to block this thread waiting until validation is
+ // complete because it is the only thread that can accept
+ // connections with this factory's acceptor. Therefore we
+ // don't call validate() and activate() from the connection
+ // factory in thread per connection mode.
+ //
}
}
@@ -415,22 +415,22 @@ IceInternal::IncomingConnectionFactory::ThreadPerIncomingConnectionFactory::run(
{
try
{
- _factory->run();
+ _factory->run();
}
catch(const Exception& ex)
- {
- Error out(_factory->_instance->initializationData().logger);
- out << "exception in thread per incoming connection factory:\n" << _factory->toString() << ex.toString();
+ {
+ Error out(_factory->_instance->initializationData().logger);
+ out << "exception in thread per incoming connection factory:\n" << _factory->toString() << ex.toString();
}
catch(const std::exception& ex)
{
- Error out(_factory->_instance->initializationData().logger);
- out << "std::exception in thread per incoming connection factory:\n" << _factory->toString() << ex.what();
+ Error out(_factory->_instance->initializationData().logger);
+ out << "std::exception in thread per incoming connection factory:\n" << _factory->toString() << ex.what();
}
catch(...)
{
- Error out(_factory->_instance->initializationData().logger);
- out << "unknown exception in thread per incoming connection factory:\n" << _factory->toString();
+ Error out(_factory->_instance->initializationData().logger);
+ out << "unknown exception in thread per incoming connection factory:\n" << _factory->toString();
}
_factory = 0; // Resolve cyclic dependency.
diff --git a/cppe/src/IceE/IncomingConnectionFactory.h b/cppe/src/IceE/IncomingConnectionFactory.h
index 766816054fa..0150c81b017 100644
--- a/cppe/src/IceE/IncomingConnectionFactory.h
+++ b/cppe/src/IceE/IncomingConnectionFactory.h
@@ -55,9 +55,9 @@ private:
enum State
{
- StateActive,
- StateHolding,
- StateClosed
+ StateActive,
+ StateHolding,
+ StateClosed
};
void setState(State);
@@ -67,13 +67,13 @@ private:
class ThreadPerIncomingConnectionFactory : public IceUtil::Thread
{
public:
-
- ThreadPerIncomingConnectionFactory(const IncomingConnectionFactoryPtr&);
- virtual void run();
+
+ ThreadPerIncomingConnectionFactory(const IncomingConnectionFactoryPtr&);
+ virtual void run();
private:
-
- IncomingConnectionFactoryPtr _factory;
+
+ IncomingConnectionFactoryPtr _factory;
};
friend class ThreadPerIncomingConnectionFactory;
IceUtil::ThreadPtr _threadPerIncomingConnectionFactory;
diff --git a/cppe/src/IceE/Initialize.cpp b/cppe/src/IceE/Initialize.cpp
index 9c10c2e0605..13d09f0e2a8 100644
--- a/cppe/src/IceE/Initialize.cpp
+++ b/cppe/src/IceE/Initialize.cpp
@@ -56,7 +56,7 @@ Ice::stringSeqToArgs(const StringSeq& args, int& argc, char* argv[])
//
if(argv)
{
- argv[argc] = 0;
+ argv[argc] = 0;
}
}
@@ -113,7 +113,7 @@ inline void checkIceVersion(Int version)
//
if(ICEE_INT_VERSION / 100 != version / 100)
{
- throw VersionMismatchException(__FILE__, __LINE__);
+ throw VersionMismatchException(__FILE__, __LINE__);
}
//
// The caller's patch level cannot be greater than library's patch level. (Patch level changes are
@@ -121,7 +121,7 @@ inline void checkIceVersion(Int version)
//
if(version % 100 > ICEE_INT_VERSION % 100)
{
- throw VersionMismatchException(__FILE__, __LINE__);
+ throw VersionMismatchException(__FILE__, __LINE__);
}
#endif
}
@@ -149,42 +149,42 @@ Ice::initialize(StringSeq& args, const InitializationData& initializationData, I
CommunicatorPtr communicator;
try
{
- //
- // Make a dummy argc/argv.
- // (We can't use argsToStringSeq() because that requires an already initialized argv.)
- //
- int argc = args.size();
- origArgc = argc;
- argv = new char*[args.size() + 1];
- int i;
- for(i = 0; i != argc; ++i)
- {
- argv[i] = new char[args[i].size() + 1];
+ //
+ // Make a dummy argc/argv.
+ // (We can't use argsToStringSeq() because that requires an already initialized argv.)
+ //
+ int argc = args.size();
+ origArgc = argc;
+ argv = new char*[args.size() + 1];
+ int i;
+ for(i = 0; i != argc; ++i)
+ {
+ argv[i] = new char[args[i].size() + 1];
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
- strcpy_s(argv[i], args[i].size() + 1, args[i].c_str());
+ strcpy_s(argv[i], args[i].size() + 1, args[i].c_str());
#else
- strcpy(argv[i], args[i].c_str());
+ strcpy(argv[i], args[i].c_str());
#endif
- }
- argv[argc] = 0;
-
- communicator = initialize(argc, argv, initializationData, version);
-
- args = argsToStringSeq(argc, argv);
-
- for(i = 0; i < origArgc; ++i)
- {
- delete[] argv[i];
- }
- delete[] argv;
+ }
+ argv[argc] = 0;
+
+ communicator = initialize(argc, argv, initializationData, version);
+
+ args = argsToStringSeq(argc, argv);
+
+ for(i = 0; i < origArgc; ++i)
+ {
+ delete[] argv[i];
+ }
+ delete[] argv;
}
catch(...)
{
- for(int i = 0; i < origArgc; ++i)
- {
- delete[] argv[i];
- }
- delete[] argv;
+ for(int i = 0; i < origArgc; ++i)
+ {
+ delete[] argv[i];
+ }
+ delete[] argv;
throw;
}
return communicator;
diff --git a/cppe/src/IceE/Instance.cpp b/cppe/src/IceE/Instance.cpp
index 27cc1453802..81221c987bd 100644
--- a/cppe/src/IceE/Instance.cpp
+++ b/cppe/src/IceE/Instance.cpp
@@ -88,7 +88,7 @@ IceInternal::Instance::routerManager() const
if(_state == StateDestroyed)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
return _routerManager;
@@ -105,7 +105,7 @@ IceInternal::Instance::locatorManager() const
if(_state == StateDestroyed)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
return _locatorManager;
@@ -120,7 +120,7 @@ IceInternal::Instance::referenceFactory() const
if(_state == StateDestroyed)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
return _referenceFactory;
@@ -133,7 +133,7 @@ IceInternal::Instance::proxyFactory() const
if(_state == StateDestroyed)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
return _proxyFactory;
@@ -146,7 +146,7 @@ IceInternal::Instance::outgoingConnectionFactory() const
if(_state == StateDestroyed)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
return _outgoingConnectionFactory;
@@ -160,7 +160,7 @@ IceInternal::Instance::objectAdapterFactory() const
if(_state == StateDestroyed)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
return _objectAdapterFactory;
@@ -183,7 +183,7 @@ IceInternal::Instance::endpointFactory() const
if(_state == StateDestroyed)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
return _endpointFactory;
@@ -200,16 +200,16 @@ IceInternal::Instance::flushBatchRequests()
#endif
{
- IceUtil::RecMutex::Lock sync(*this);
+ IceUtil::RecMutex::Lock sync(*this);
- if(_state == StateDestroyed)
- {
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
- }
+ if(_state == StateDestroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
- connectionFactory = _outgoingConnectionFactory;
+ connectionFactory = _outgoingConnectionFactory;
#ifndef ICEE_PURE_CLIENT
- adapterFactory = _objectAdapterFactory;
+ adapterFactory = _objectAdapterFactory;
#endif
}
@@ -337,181 +337,181 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
{
try
{
- __setNoDelete(true);
-
- IceUtil::StaticMutex::Lock sync(staticMutex);
- instanceCount++;
-
- if(!oneOffDone)
- {
- //
- // StdOut and StdErr redirection
- //
-
- string stdOutFilename = _initData.properties->getProperty("Ice.StdOut");
- string stdErrFilename = _initData.properties->getProperty("Ice.StdErr");
-
- if(stdOutFilename != "")
- {
- FILE * file;
+ __setNoDelete(true);
+
+ IceUtil::StaticMutex::Lock sync(staticMutex);
+ instanceCount++;
+
+ if(!oneOffDone)
+ {
+ //
+ // StdOut and StdErr redirection
+ //
+
+ string stdOutFilename = _initData.properties->getProperty("Ice.StdOut");
+ string stdErrFilename = _initData.properties->getProperty("Ice.StdErr");
+
+ if(stdOutFilename != "")
+ {
+ FILE * file;
#ifdef _WIN32_WCE
- wchar_t* wtext = new wchar_t[sizeof(wchar_t) * stdOutFilename.length()];
- mbstowcs(wtext, stdOutFilename.c_str(), stdOutFilename.length());
- file = _wfreopen(wtext, L"a", stdout);
- delete wtext;
+ wchar_t* wtext = new wchar_t[sizeof(wchar_t) * stdOutFilename.length()];
+ mbstowcs(wtext, stdOutFilename.c_str(), stdOutFilename.length());
+ file = _wfreopen(wtext, L"a", stdout);
+ delete wtext;
#else
- file = freopen(stdOutFilename.c_str(), "a", stdout);
-#endif
- if(file == 0)
- {
- SyscallException ex(__FILE__, __LINE__);
- ex.error = getSystemErrno();
- throw ex;
- }
- }
-
- if(stdErrFilename != "")
- {
- FILE* file;
+ file = freopen(stdOutFilename.c_str(), "a", stdout);
+#endif
+ if(file == 0)
+ {
+ SyscallException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
+ }
+ }
+
+ if(stdErrFilename != "")
+ {
+ FILE* file;
#ifdef _WIN32_WCE
- wchar_t* wtext = new wchar_t[sizeof(wchar_t) * stdErrFilename.length()];
- mbstowcs(wtext, stdErrFilename.c_str(), stdErrFilename.length());
- file = _wfreopen(wtext, L"a", stderr);
- delete wtext;
+ wchar_t* wtext = new wchar_t[sizeof(wchar_t) * stdErrFilename.length()];
+ mbstowcs(wtext, stdErrFilename.c_str(), stdErrFilename.length());
+ file = _wfreopen(wtext, L"a", stderr);
+ delete wtext;
#else
- file = freopen(stdErrFilename.c_str(), "a", stderr);
-#endif
- if(file == 0)
- {
- SyscallException ex(__FILE__, __LINE__);
- ex.error = getSystemErrno();
- throw ex;
- }
- }
-
- unsigned int seed = static_cast<unsigned int>(IceUtil::Time::now().toMicroSeconds());
- srand(seed);
+ file = freopen(stdErrFilename.c_str(), "a", stderr);
+#endif
+ if(file == 0)
+ {
+ SyscallException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
+ }
+ }
+
+ unsigned int seed = static_cast<unsigned int>(IceUtil::Time::now().toMicroSeconds());
+ srand(seed);
#ifndef _WIN32
- srand48(seed);
-#endif
-
- if(_initData.properties->getPropertyAsInt("Ice.NullHandleAbort") > 0)
- {
- IceUtil::nullHandleAbort = true;
- }
-
+ srand48(seed);
+#endif
+
+ if(_initData.properties->getPropertyAsInt("Ice.NullHandleAbort") > 0)
+ {
+ IceUtil::nullHandleAbort = true;
+ }
+
#ifndef _WIN32
- string newUser = _initData.properties->getProperty("Ice.ChangeUser");
- if(!newUser.empty())
- {
- struct passwd* pw = getpwnam(newUser.c_str());
- if(!pw)
- {
- SyscallException ex(__FILE__, __LINE__);
- ex.error = getSystemErrno();
- throw ex;
- }
-
- if(setgid(pw->pw_gid) == -1)
- {
- SyscallException ex(__FILE__, __LINE__);
- ex.error = getSystemErrno();
- throw ex;
- }
-
- if(setuid(pw->pw_uid) == -1)
- {
- SyscallException ex(__FILE__, __LINE__);
- ex.error = getSystemErrno();
- throw ex;
- }
- }
-#endif
- oneOffDone = true;
- }
-
- if(instanceCount == 1)
- {
-
+ string newUser = _initData.properties->getProperty("Ice.ChangeUser");
+ if(!newUser.empty())
+ {
+ struct passwd* pw = getpwnam(newUser.c_str());
+ if(!pw)
+ {
+ SyscallException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
+ }
+
+ if(setgid(pw->pw_gid) == -1)
+ {
+ SyscallException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
+ }
+
+ if(setuid(pw->pw_uid) == -1)
+ {
+ SyscallException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
+ }
+ }
+#endif
+ oneOffDone = true;
+ }
+
+ if(instanceCount == 1)
+ {
+
#ifdef _WIN32
- WORD version = MAKEWORD(1, 1);
- WSADATA data;
- if(WSAStartup(version, &data) != 0)
- {
- SocketException ex(__FILE__, __LINE__);
- ex.error = WSAGetLastError();
- throw ex;
- }
-#endif
-
+ WORD version = MAKEWORD(1, 1);
+ WSADATA data;
+ if(WSAStartup(version, &data) != 0)
+ {
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = WSAGetLastError();
+ throw ex;
+ }
+#endif
+
#ifndef _WIN32
- struct sigaction action;
- action.sa_handler = SIG_IGN;
- sigemptyset(&action.sa_mask);
- action.sa_flags = 0;
- sigaction(SIGPIPE, &action, 0);
-#endif
- }
-
- sync.release();
-
-
- if(!_initData.logger)
- {
- _initData.logger = new LoggerI(_initData.properties->getProperty("Ice.ProgramName"));
- }
-
- const_cast<TraceLevelsPtr&>(_traceLevels) = new TraceLevels(_initData.properties);
-
- const_cast<DefaultsAndOverridesPtr&>(_defaultsAndOverrides) = new DefaultsAndOverrides(_initData.properties);
-
- {
- static const int defaultMessageSizeMax = 1024;
- Int num = _initData.properties->getPropertyAsIntWithDefault("Ice.MessageSizeMax", defaultMessageSizeMax);
- if(num < 1)
- {
- const_cast<size_t&>(_messageSizeMax) = defaultMessageSizeMax * 1024; // Ignore non-sensical values.
- }
- else if(static_cast<size_t>(num) > (size_t)(0x7fffffff / 1024))
- {
- const_cast<size_t&>(_messageSizeMax) = static_cast<size_t>(0x7fffffff);
- }
- else
- {
- // Property is in kilobytes, _messageSizeMax in bytes.
- const_cast<size_t&>(_messageSizeMax) = static_cast<size_t>(num) * 1024;
- }
- }
+ struct sigaction action;
+ action.sa_handler = SIG_IGN;
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = 0;
+ sigaction(SIGPIPE, &action, 0);
+#endif
+ }
+
+ sync.release();
+
+
+ if(!_initData.logger)
+ {
+ _initData.logger = new LoggerI(_initData.properties->getProperty("Ice.ProgramName"));
+ }
+
+ const_cast<TraceLevelsPtr&>(_traceLevels) = new TraceLevels(_initData.properties);
+
+ const_cast<DefaultsAndOverridesPtr&>(_defaultsAndOverrides) = new DefaultsAndOverrides(_initData.properties);
+
+ {
+ static const int defaultMessageSizeMax = 1024;
+ Int num = _initData.properties->getPropertyAsIntWithDefault("Ice.MessageSizeMax", defaultMessageSizeMax);
+ if(num < 1)
+ {
+ const_cast<size_t&>(_messageSizeMax) = defaultMessageSizeMax * 1024; // Ignore non-sensical values.
+ }
+ else if(static_cast<size_t>(num) > (size_t)(0x7fffffff / 1024))
+ {
+ const_cast<size_t&>(_messageSizeMax) = static_cast<size_t>(0x7fffffff);
+ }
+ else
+ {
+ // Property is in kilobytes, _messageSizeMax in bytes.
+ const_cast<size_t&>(_messageSizeMax) = static_cast<size_t>(num) * 1024;
+ }
+ }
#ifndef ICEE_PURE_BLOCKING_CLIENT
- {
- Int stackSize = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection.StackSize");
- if(stackSize < 0)
- {
- stackSize = 0;
- }
- const_cast<size_t&>(_threadPerConnectionStackSize) = static_cast<size_t>(stackSize);
- }
+ {
+ Int stackSize = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection.StackSize");
+ if(stackSize < 0)
+ {
+ stackSize = 0;
+ }
+ const_cast<size_t&>(_threadPerConnectionStackSize) = static_cast<size_t>(stackSize);
+ }
#endif
#ifdef ICEE_HAS_ROUTER
- _routerManager = new RouterManager;
+ _routerManager = new RouterManager;
#endif
#ifdef ICEE_HAS_LOCATOR
- _locatorManager = new LocatorManager;
+ _locatorManager = new LocatorManager;
#endif
- _referenceFactory = new ReferenceFactory(this, communicator);
+ _referenceFactory = new ReferenceFactory(this, communicator);
- _proxyFactory = new ProxyFactory(this);
+ _proxyFactory = new ProxyFactory(this);
_endpointFactory = new EndpointFactory(this);
- _outgoingConnectionFactory = new OutgoingConnectionFactory(this);
+ _outgoingConnectionFactory = new OutgoingConnectionFactory(this);
#ifndef ICEE_PURE_CLIENT
- _objectAdapterFactory = new ObjectAdapterFactory(this, communicator);
+ _objectAdapterFactory = new ObjectAdapterFactory(this, communicator);
#endif
#ifdef ICEE_HAS_WSTRING
@@ -521,17 +521,17 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
}
#endif
- __setNoDelete(false);
+ __setNoDelete(false);
}
catch(...)
{
- {
- IceUtil::StaticMutex::Lock sync(staticMutex);
- --instanceCount;
- }
- destroy();
- __setNoDelete(false);
- throw;
+ {
+ IceUtil::StaticMutex::Lock sync(staticMutex);
+ --instanceCount;
+ }
+ destroy();
+ __setNoDelete(false);
+ throw;
}
}
@@ -556,15 +556,15 @@ IceInternal::Instance::~Instance()
if(--instanceCount == 0)
{
#ifdef _WIN32
- WSACleanup();
+ WSACleanup();
#endif
-
+
#ifndef _WIN32
- struct sigaction action;
- action.sa_handler = SIG_DFL;
- sigemptyset(&action.sa_mask);
- action.sa_flags = 0;
- sigaction(SIGPIPE, &action, 0);
+ struct sigaction action;
+ action.sa_handler = SIG_DFL;
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = 0;
+ sigaction(SIGPIPE, &action, 0);
#endif
}
}
@@ -580,16 +580,16 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
#ifdef ICEE_HAS_ROUTER
if(!_defaultsAndOverrides->defaultRouter.empty())
{
- _referenceFactory->setDefaultRouter(
- RouterPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultRouter)));
+ _referenceFactory->setDefaultRouter(
+ RouterPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultRouter)));
}
#endif
#ifdef ICEE_HAS_LOCATOR
if(!_defaultsAndOverrides->defaultLocator.empty())
{
- _referenceFactory->setDefaultLocator(
- LocatorPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultLocator)));
+ _referenceFactory->setDefaultLocator(
+ LocatorPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultLocator)));
}
#endif
@@ -600,26 +600,26 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
bool printProcessId = false;
if(!printProcessIdDone && _initData.properties->getPropertyAsInt("Ice.PrintProcessId") > 0)
{
- //
- // Safe double-check locking (no dependent variable!)
- //
- IceUtil::StaticMutex::Lock sync(staticMutex);
- printProcessId = !printProcessIdDone;
-
- //
- // We anticipate: we want to print it once, and we don't care when.
- //
- printProcessIdDone = true;
+ //
+ // Safe double-check locking (no dependent variable!)
+ //
+ IceUtil::StaticMutex::Lock sync(staticMutex);
+ printProcessId = !printProcessIdDone;
+
+ //
+ // We anticipate: we want to print it once, and we don't care when.
+ //
+ printProcessIdDone = true;
}
if(printProcessId)
{
#ifdef _WIN32
- printf("%d\n", _getpid());
+ printf("%d\n", _getpid());
#else
- printf("%d\n", getpid());
+ printf("%d\n", getpid());
#endif
- fflush(stdout);
+ fflush(stdout);
}
#endif
}
@@ -628,30 +628,30 @@ void
IceInternal::Instance::destroy()
{
{
- IceUtil::RecMutex::Lock sync(*this);
-
- //
- // If the _state is not StateActive then the instance is
- // either being destroyed, or has already been destroyed.
- //
- if(_state != StateActive)
- {
- return;
- }
-
- //
- // We cannot set state to StateDestroyed otherwise instance
- // methods called during the destroy process (such as
- // outgoingConnectionFactory() from
- // ObjectAdapterI::deactivate() will cause an exception.
- //
- _state = StateDestroyInProgress;
+ IceUtil::RecMutex::Lock sync(*this);
+
+ //
+ // If the _state is not StateActive then the instance is
+ // either being destroyed, or has already been destroyed.
+ //
+ if(_state != StateActive)
+ {
+ return;
+ }
+
+ //
+ // We cannot set state to StateDestroyed otherwise instance
+ // methods called during the destroy process (such as
+ // outgoingConnectionFactory() from
+ // ObjectAdapterI::deactivate() will cause an exception.
+ //
+ _state = StateDestroyInProgress;
}
#ifndef ICEE_PURE_CLIENT
if(_objectAdapterFactory)
{
- _objectAdapterFactory->shutdown();
+ _objectAdapterFactory->shutdown();
}
if(_outgoingConnectionFactory)
@@ -677,46 +677,46 @@ IceInternal::Instance::destroy()
#endif
{
- IceUtil::RecMutex::Lock sync(*this);
+ IceUtil::RecMutex::Lock sync(*this);
#ifndef ICEE_PURE_CLIENT
- _objectAdapterFactory = 0;
-#endif
- _outgoingConnectionFactory = 0;
-
- if(_referenceFactory)
- {
- _referenceFactory->destroy();
- _referenceFactory = 0;
- }
-
- // No destroy function defined.
- // _proxyFactory->destroy();
- _proxyFactory = 0;
-
+ _objectAdapterFactory = 0;
+#endif
+ _outgoingConnectionFactory = 0;
+
+ if(_referenceFactory)
+ {
+ _referenceFactory->destroy();
+ _referenceFactory = 0;
+ }
+
+ // No destroy function defined.
+ // _proxyFactory->destroy();
+ _proxyFactory = 0;
+
#ifdef ICEE_HAS_ROUTER
- if(_routerManager)
- {
- _routerManager->destroy();
- _routerManager = 0;
- }
+ if(_routerManager)
+ {
+ _routerManager->destroy();
+ _routerManager = 0;
+ }
#endif
#ifdef ICEE_HAS_LOCATOR
- if(_locatorManager)
- {
- _locatorManager->destroy();
- _locatorManager = 0;
- }
+ if(_locatorManager)
+ {
+ _locatorManager->destroy();
+ _locatorManager = 0;
+ }
#endif
- if(_endpointFactory)
- {
- _endpointFactory->destroy();
- _endpointFactory = 0;
- }
+ if(_endpointFactory)
+ {
+ _endpointFactory->destroy();
+ _endpointFactory = 0;
+ }
- _state = StateDestroyed;
+ _state = StateDestroyed;
}
}
diff --git a/cppe/src/IceE/Instance.h b/cppe/src/IceE/Instance.h
index 7c6c58efd20..9d844e0266a 100644
--- a/cppe/src/IceE/Instance.h
+++ b/cppe/src/IceE/Instance.h
@@ -78,9 +78,9 @@ private:
enum State
{
- StateActive,
- StateDestroyInProgress,
- StateDestroyed
+ StateActive,
+ StateDestroyInProgress,
+ StateDestroyed
};
State _state;
Ice::InitializationData _initData; // Immutable, not reset by destroy().
diff --git a/cppe/src/IceE/LocalException.cpp b/cppe/src/IceE/LocalException.cpp
index c785547149c..d35cf32c2a8 100644
--- a/cppe/src/IceE/LocalException.cpp
+++ b/cppe/src/IceE/LocalException.cpp
@@ -1502,13 +1502,13 @@ Ice::MemoryLimitException::ice_throw() const
void
Ice::throwMemoryLimitException(const char* file, int line)
{
- throw MemoryLimitException(file, line);
+ throw MemoryLimitException(file, line);
}
void
Ice::throwUnmarshalOutOfBoundsException(const char* file, int line)
{
- throw MarshalException(file, line, "out of bounds during unmarshaling");
+ throw MarshalException(file, line, "out of bounds during unmarshaling");
}
void
@@ -1644,8 +1644,8 @@ Ice::UnknownException::toString() const
out += ":\nunknown exception";
if(!unknown.empty())
{
- out += ":\n";
- out += unknown;
+ out += ":\n";
+ out += unknown;
}
return out;
}
@@ -1657,8 +1657,8 @@ Ice::UnknownLocalException::toString() const
out += ":\nunknown local exception";
if(!unknown.empty())
{
- out += ":\n";
- out += unknown;
+ out += ":\n";
+ out += unknown;
}
return out;
}
@@ -1670,8 +1670,8 @@ Ice::UnknownUserException::toString() const
out += ":\nunknown user exception";
if(!unknown.empty())
{
- out += ":\n";
- out += unknown;
+ out += ":\n";
+ out += unknown;
}
return out;
}
@@ -1814,7 +1814,7 @@ Ice::SyscallException::toString() const
if(error != 0)
{
out += ":\nsyscall exception: ";
- out += errorToString(error);
+ out += errorToString(error);
}
return out;
}
@@ -1842,9 +1842,9 @@ Ice::FileException::toString() const
{
- out += "\npath: ";
+ out += "\npath: ";
- out += path;
+ out += path;
}
@@ -1877,11 +1877,11 @@ Ice::ConnectionLostException::toString() const
out += ":\nconnection lost: ";
if(error == 0)
{
- out += "recv() returned zero";
+ out += "recv() returned zero";
}
else
{
- out += errorToString(error);
+ out += errorToString(error);
}
return out;
}
@@ -1928,11 +1928,11 @@ Ice::ProtocolException::toString() const
out += ":\nprotocol error: ";
if(!reason.empty())
{
- out += reason;
+ out += reason;
}
else
{
- out += "unknown protocol exception";
+ out += "unknown protocol exception";
}
return out;
}
@@ -1973,8 +1973,8 @@ Ice::MarshalException::toString() const
out += ":\nprotocol error: error during marshaling or unmarshaling";
if(!reason.empty())
{
- out += ":\n";
- out += reason;
+ out += ":\n";
+ out += reason;
}
return out;
}
diff --git a/cppe/src/IceE/LocatorInfo.cpp b/cppe/src/IceE/LocatorInfo.cpp
index 7dc7f5aa836..5158cb5b510 100644
--- a/cppe/src/IceE/LocatorInfo.cpp
+++ b/cppe/src/IceE/LocatorInfo.cpp
@@ -53,7 +53,7 @@ IceInternal::LocatorManager::get(const LocatorPrx& loc)
{
if(!loc)
{
- return 0;
+ return 0;
}
LocatorPrx locator = LocatorPrx::uncheckedCast(loc->ice_locator(0)); // The locator can't be located.
@@ -68,38 +68,38 @@ IceInternal::LocatorManager::get(const LocatorPrx& loc)
if(_tableHint != _table.end())
{
- if(_tableHint->first == locator)
- {
- p = _tableHint;
- }
+ if(_tableHint->first == locator)
+ {
+ p = _tableHint;
+ }
}
if(p == _table.end())
{
- p = _table.find(locator);
+ p = _table.find(locator);
}
if(p == _table.end())
{
- //
- // Rely on locator identity for the adapter table. We want to
- // have only one table per locator (not one per locator
- // proxy).
- //
- map<Identity, LocatorTablePtr>::iterator t = _locatorTables.find(locator->ice_getIdentity());
- if(t == _locatorTables.end())
- {
- t = _locatorTables.insert(_locatorTables.begin(),
- pair<const Identity, LocatorTablePtr>(locator->ice_getIdentity(),
- new LocatorTable()));
- }
-
- _tableHint = _table.insert(_tableHint,
- pair<const LocatorPrx, LocatorInfoPtr>(locator, new LocatorInfo(locator, t->second)));
+ //
+ // Rely on locator identity for the adapter table. We want to
+ // have only one table per locator (not one per locator
+ // proxy).
+ //
+ map<Identity, LocatorTablePtr>::iterator t = _locatorTables.find(locator->ice_getIdentity());
+ if(t == _locatorTables.end())
+ {
+ t = _locatorTables.insert(_locatorTables.begin(),
+ pair<const Identity, LocatorTablePtr>(locator->ice_getIdentity(),
+ new LocatorTable()));
+ }
+
+ _tableHint = _table.insert(_tableHint,
+ pair<const LocatorPrx, LocatorInfoPtr>(locator, new LocatorInfo(locator, t->second)));
}
else
{
- _tableHint = p;
+ _tableHint = p;
}
return _tableHint->second;
@@ -112,10 +112,10 @@ IceInternal::LocatorTable::LocatorTable()
void
IceInternal::LocatorTable::clear()
{
- IceUtil::Mutex::Lock sync(*this);
+ IceUtil::Mutex::Lock sync(*this);
- _adapterEndpointsMap.clear();
- _objectMap.clear();
+ _adapterEndpointsMap.clear();
+ _objectMap.clear();
}
bool
@@ -127,12 +127,12 @@ IceInternal::LocatorTable::getAdapterEndpoints(const string& adapter, vector<End
if(p != _adapterEndpointsMap.end())
{
- endpoints = p->second;
- return true;
+ endpoints = p->second;
+ return true;
}
else
{
- return false;
+ return false;
}
}
@@ -152,7 +152,7 @@ IceInternal::LocatorTable::removeAdapterEndpoints(const string& adapter)
map<string, vector<EndpointPtr> >::iterator p = _adapterEndpointsMap.find(adapter);
if(p == _adapterEndpointsMap.end())
{
- return vector<EndpointPtr>();
+ return vector<EndpointPtr>();
}
vector<EndpointPtr> endpoints = p->second;
@@ -171,12 +171,12 @@ IceInternal::LocatorTable::getProxy(const Identity& id, ObjectPrx& proxy) const
if(p != _objectMap.end())
{
- proxy = p->second;
- return true;
+ proxy = p->second;
+ return true;
}
else
{
- return false;
+ return false;
}
}
@@ -195,7 +195,7 @@ IceInternal::LocatorTable::removeProxy(const Identity& id)
map<Identity, ObjectPrx>::iterator p = _objectMap.find(id);
if(p == _objectMap.end())
{
- return 0;
+ return 0;
}
ObjectPrx proxy = p->second;
@@ -254,12 +254,12 @@ IceInternal::LocatorInfo::getLocatorRegistry()
if(!_locatorRegistry) // Lazy initialization.
{
- _locatorRegistry = _locator->getRegistry();
+ _locatorRegistry = _locator->getRegistry();
- //
- // The locator registry can't be located.
- //
- _locatorRegistry = LocatorRegistryPrx::uncheckedCast(_locatorRegistry->ice_locator(0));
+ //
+ // The locator registry can't be located.
+ //
+ _locatorRegistry = LocatorRegistryPrx::uncheckedCast(_locatorRegistry->ice_locator(0));
}
return _locatorRegistry;
@@ -274,11 +274,11 @@ IceInternal::LocatorInfo::getEndpoints(const IndirectReferencePtr& ref, bool& ca
try
{
- if(!ref->getAdapterId().empty())
- {
- if(!_table->getAdapterEndpoints(ref->getAdapterId(), endpoints))
- {
- cached = false;
+ if(!ref->getAdapterId().empty())
+ {
+ if(!_table->getAdapterEndpoints(ref->getAdapterId(), endpoints))
+ {
+ cached = false;
if(ref->getInstance()->traceLevels()->location >= 1)
{
@@ -287,20 +287,20 @@ IceInternal::LocatorInfo::getEndpoints(const IndirectReferencePtr& ref, bool& ca
out << "searching for adapter by id" << "\n";
out << "adapter = " << ref->getAdapterId();
}
-
- object = _locator->findAdapterById(ref->getAdapterId());
- if(object)
- {
- endpoints = object->__reference()->getEndpoints();
- _table->addAdapterEndpoints(ref->getAdapterId(), endpoints);
- }
- }
- }
- else
- {
- bool objectCached = true;
- if(!_table->getProxy(ref->getIdentity(), object))
- {
+
+ object = _locator->findAdapterById(ref->getAdapterId());
+ if(object)
+ {
+ endpoints = object->__reference()->getEndpoints();
+ _table->addAdapterEndpoints(ref->getAdapterId(), endpoints);
+ }
+ }
+ }
+ else
+ {
+ bool objectCached = true;
+ if(!_table->getProxy(ref->getIdentity(), object))
+ {
if(ref->getInstance()->traceLevels()->location >= 1)
{
@@ -310,37 +310,37 @@ IceInternal::LocatorInfo::getEndpoints(const IndirectReferencePtr& ref, bool& ca
out << "object = " << ref->getInstance()->identityToString(ref->getIdentity());
}
- objectCached = false;
- object = _locator->findObjectById(ref->getIdentity());
- }
-
- bool endpointsCached = true;
- if(object)
- {
- DirectReferencePtr odr = DirectReferencePtr::dynamicCast(object->__reference());
- if(odr)
- {
- endpointsCached = false;
- endpoints = odr->getEndpoints();
- }
- else
- {
- IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference());
- assert(oir);
- if(!oir->getAdapterId().empty())
- {
- endpoints = getEndpoints(oir, endpointsCached);
- }
- }
- }
-
- if(!objectCached && !endpoints.empty())
- {
- _table->addProxy(ref->getIdentity(), object);
- }
-
- cached = objectCached || endpointsCached;
- }
+ objectCached = false;
+ object = _locator->findObjectById(ref->getIdentity());
+ }
+
+ bool endpointsCached = true;
+ if(object)
+ {
+ DirectReferencePtr odr = DirectReferencePtr::dynamicCast(object->__reference());
+ if(odr)
+ {
+ endpointsCached = false;
+ endpoints = odr->getEndpoints();
+ }
+ else
+ {
+ IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference());
+ assert(oir);
+ if(!oir->getAdapterId().empty())
+ {
+ endpoints = getEndpoints(oir, endpointsCached);
+ }
+ }
+ }
+
+ if(!objectCached && !endpoints.empty())
+ {
+ _table->addProxy(ref->getIdentity(), object);
+ }
+
+ cached = objectCached || endpointsCached;
+ }
}
catch(const AdapterNotFoundException&)
{
@@ -352,10 +352,10 @@ IceInternal::LocatorInfo::getEndpoints(const IndirectReferencePtr& ref, bool& ca
out << "adapter = " << ref->getAdapterId();
}
- NotRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "object adapter";
- ex.id = ref->getAdapterId();
- throw ex;
+ NotRegisteredException ex(__FILE__, __LINE__);
+ ex.kindOfObject = "object adapter";
+ ex.id = ref->getAdapterId();
+ throw ex;
}
catch(const ObjectNotFoundException&)
{
@@ -367,32 +367,32 @@ IceInternal::LocatorInfo::getEndpoints(const IndirectReferencePtr& ref, bool& ca
out << "object = " << ref->getInstance()->identityToString(ref->getIdentity());
}
- NotRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "object";
- ex.id = ref->getInstance()->identityToString(ref->getIdentity());
- throw ex;
+ NotRegisteredException ex(__FILE__, __LINE__);
+ ex.kindOfObject = "object";
+ ex.id = ref->getInstance()->identityToString(ref->getIdentity());
+ throw ex;
}
catch(const NotRegisteredException&)
{
- throw;
+ throw;
}
catch(const LocalException& ex)
{
- if(ref->getInstance()->traceLevels()->location >= 1)
- {
- Trace out(ref->getInstance()->initializationData().logger, ref->getInstance()->traceLevels()->locationCat);
- out << "couldn't contact the locator to retrieve adapter endpoints\n";
- if(!ref)
- {
- out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()) << "\n";
- }
- else
- {
- out << "adapter = " << ref->getAdapterId() << "\n";
- }
- out << "reason = " << ex.toString();
- }
- throw;
+ if(ref->getInstance()->traceLevels()->location >= 1)
+ {
+ Trace out(ref->getInstance()->initializationData().logger, ref->getInstance()->traceLevels()->locationCat);
+ out << "couldn't contact the locator to retrieve adapter endpoints\n";
+ if(!ref)
+ {
+ out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()) << "\n";
+ }
+ else
+ {
+ out << "adapter = " << ref->getAdapterId() << "\n";
+ }
+ out << "reason = " << ex.toString();
+ }
+ throw;
}
if(ref->getInstance()->traceLevels()->location >= 1)
@@ -433,25 +433,25 @@ IceInternal::LocatorInfo::clearObjectCache(const IndirectReferencePtr& ref)
{
if(ref->getAdapterId().empty())
{
- ObjectPrx object = _table->removeProxy(ref->getIdentity());
- if(object)
- {
- IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference());
- if(oir)
- {
- if(!oir->getAdapterId().empty())
- {
- clearCache(oir);
- }
- }
- else
- {
- if(ref->getInstance()->traceLevels()->location >= 2)
- {
- trace("removed endpoints from locator table", ref, object->__reference()->getEndpoints());
- }
- }
- }
+ ObjectPrx object = _table->removeProxy(ref->getIdentity());
+ if(object)
+ {
+ IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference());
+ if(oir)
+ {
+ if(!oir->getAdapterId().empty())
+ {
+ clearCache(oir);
+ }
+ }
+ else
+ {
+ if(ref->getInstance()->traceLevels()->location >= 2)
+ {
+ trace("removed endpoints from locator table", ref, object->__reference()->getEndpoints());
+ }
+ }
+ }
}
}
@@ -460,51 +460,51 @@ IceInternal::LocatorInfo::clearCache(const IndirectReferencePtr& ref)
{
if(!ref->getAdapterId().empty())
{
- vector<EndpointPtr> endpoints = _table->removeAdapterEndpoints(ref->getAdapterId());
+ vector<EndpointPtr> endpoints = _table->removeAdapterEndpoints(ref->getAdapterId());
- if(!endpoints.empty() && ref->getInstance()->traceLevels()->location >= 2)
- {
- trace("removed endpoints from locator table", ref, endpoints);
- }
+ if(!endpoints.empty() && ref->getInstance()->traceLevels()->location >= 2)
+ {
+ trace("removed endpoints from locator table", ref, endpoints);
+ }
}
else
{
- ObjectPrx object = _table->removeProxy(ref->getIdentity());
- if(object)
- {
- IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference());
- if(oir)
- {
- if(!oir->getAdapterId().empty())
- {
- clearCache(oir);
- }
- }
- else
- {
- if(ref->getInstance()->traceLevels()->location >= 2)
- {
- trace("removed endpoints from locator table", ref, object->__reference()->getEndpoints());
- }
- }
- }
+ ObjectPrx object = _table->removeProxy(ref->getIdentity());
+ if(object)
+ {
+ IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference());
+ if(oir)
+ {
+ if(!oir->getAdapterId().empty())
+ {
+ clearCache(oir);
+ }
+ }
+ else
+ {
+ if(ref->getInstance()->traceLevels()->location >= 2)
+ {
+ trace("removed endpoints from locator table", ref, object->__reference()->getEndpoints());
+ }
+ }
+ }
}
}
void
IceInternal::LocatorInfo::trace(const string& msg,
- const IndirectReferencePtr& ref,
- const vector<EndpointPtr>& endpoints)
+ const IndirectReferencePtr& ref,
+ const vector<EndpointPtr>& endpoints)
{
Trace out(ref->getInstance()->initializationData().logger, ref->getInstance()->traceLevels()->locationCat);
out << msg << "\n";
if(!ref->getAdapterId().empty())
{
- out << "adapter = " << ref->getAdapterId() << "\n";
+ out << "adapter = " << ref->getAdapterId() << "\n";
}
else
{
- out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()) << "\n";
+ out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()) << "\n";
}
const char* sep = endpoints.size() > 1 ? ":" : "";
diff --git a/cppe/src/IceE/LoggerI.cpp b/cppe/src/IceE/LoggerI.cpp
index f0ad2390f0d..ac09b256e03 100644
--- a/cppe/src/IceE/LoggerI.cpp
+++ b/cppe/src/IceE/LoggerI.cpp
@@ -20,7 +20,7 @@ Ice::LoggerI::LoggerI(const string& prefix)
{
if(!prefix.empty())
{
- _prefix = prefix + ": ";
+ _prefix = prefix + ": ";
}
}
@@ -45,8 +45,8 @@ Ice::LoggerI::trace(const string& category, const string& message)
string::size_type idx = 0;
while((idx = s.find("\n", idx)) != string::npos)
{
- s.insert(idx + 1, " ");
- ++idx;
+ s.insert(idx + 1, " ");
+ ++idx;
}
IceUtil::StaticMutex::Lock sync(globalMutex);
diff --git a/cppe/src/IceE/LoggerUtil.cpp b/cppe/src/IceE/LoggerUtil.cpp
index 0f59e4374ad..2dabf999fce 100644
--- a/cppe/src/IceE/LoggerUtil.cpp
+++ b/cppe/src/IceE/LoggerUtil.cpp
@@ -29,7 +29,7 @@ Ice::Print::flush()
{
if(!_str.empty())
{
- _logger->print(_str);
+ _logger->print(_str);
}
_str = "";;
}
@@ -55,7 +55,7 @@ Ice::Warning::flush()
{
if(!_str.empty())
{
- _logger->warning(_str);
+ _logger->warning(_str);
}
_str = "";
}
@@ -81,7 +81,7 @@ Ice::Error::flush()
{
if(!_str.empty())
{
- _logger->error(_str);
+ _logger->error(_str);
}
_str = "";
}
@@ -108,7 +108,7 @@ Ice::Trace::flush()
{
if(!_str.empty())
{
- _logger->trace(_category, _str);
+ _logger->trace(_category, _str);
}
_str = "";
}
diff --git a/cppe/src/IceE/Network.cpp b/cppe/src/IceE/Network.cpp
index 10d022bce57..c06e9f99251 100644
--- a/cppe/src/IceE/Network.cpp
+++ b/cppe/src/IceE/Network.cpp
@@ -161,7 +161,7 @@ IceInternal::connectionLost()
errno == ENOTCONN ||
errno == ESHUTDOWN ||
errno == ECONNABORTED ||
- errno == EPIPE;
+ errno == EPIPE;
#endif
}
@@ -183,9 +183,9 @@ IceInternal::createSocket()
fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if(fd == INVALID_SOCKET)
{
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
setTcpNoDelay(fd);
@@ -215,18 +215,18 @@ IceInternal::closeSocket(SOCKET fd)
int error = WSAGetLastError();
if(closesocket(fd) == SOCKET_ERROR)
{
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
WSASetLastError(error);
#else
int error = errno;
if(close(fd) == SOCKET_ERROR)
{
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
errno = error;
#endif
@@ -237,29 +237,29 @@ IceInternal::shutdownSocketWrite(SOCKET fd)
{
if(shutdown(fd, SHUT_WR) == SOCKET_ERROR)
{
- //
- // Ignore errors indicating that we are shutdown already.
- //
+ //
+ // Ignore errors indicating that we are shutdown already.
+ //
#if defined(_WIN32)
- int error = WSAGetLastError();
- if(error == WSAENOTCONN)
- {
- return;
- }
+ int error = WSAGetLastError();
+ if(error == WSAENOTCONN)
+ {
+ return;
+ }
#elif defined(__APPLE__)
- if(errno == ENOTCONN || errno == EINVAL)
- {
- return;
- }
+ if(errno == ENOTCONN || errno == EINVAL)
+ {
+ return;
+ }
#else
- if(errno == ENOTCONN)
- {
- return;
- }
+ if(errno == ENOTCONN)
+ {
+ return;
+ }
#endif
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
}
@@ -268,30 +268,30 @@ IceInternal::shutdownSocketReadWrite(SOCKET fd)
{
if(shutdown(fd, SHUT_RDWR) == SOCKET_ERROR)
{
- //
- // Ignore errors indicating that we are shutdown already.
- //
+ //
+ // Ignore errors indicating that we are shutdown already.
+ //
#if defined(_WIN32)
- int error = WSAGetLastError();
- if(error == WSAENOTCONN)
- {
- return;
- }
+ int error = WSAGetLastError();
+ if(error == WSAENOTCONN)
+ {
+ return;
+ }
#elif defined(__APPLE__)
- if(errno == ENOTCONN || errno == EINVAL)
- {
- return;
- }
+ if(errno == ENOTCONN || errno == EINVAL)
+ {
+ return;
+ }
#else
- if(errno == ENOTCONN)
- {
- return;
- }
+ if(errno == ENOTCONN)
+ {
+ return;
+ }
#endif
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
}
@@ -301,46 +301,46 @@ IceInternal::setBlock(SOCKET fd, bool block)
if(block)
{
#ifdef _WIN32
- unsigned long arg = 0;
- if(ioctlsocket(fd, FIONBIO, &arg) == SOCKET_ERROR)
+ unsigned long arg = 0;
+ if(ioctlsocket(fd, FIONBIO, &arg) == SOCKET_ERROR)
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = WSAGetLastError();
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = WSAGetLastError();
+ throw ex;
}
#else
- int flags = fcntl(fd, F_GETFL);
- flags &= ~O_NONBLOCK;
- if(fcntl(fd, F_SETFL, flags) == SOCKET_ERROR)
+ int flags = fcntl(fd, F_GETFL);
+ flags &= ~O_NONBLOCK;
+ if(fcntl(fd, F_SETFL, flags) == SOCKET_ERROR)
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = errno;
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = errno;
+ throw ex;
}
#endif
}
else
{
#ifdef _WIN32
- unsigned long arg = 1;
- if(ioctlsocket(fd, FIONBIO, &arg) == SOCKET_ERROR)
+ unsigned long arg = 1;
+ if(ioctlsocket(fd, FIONBIO, &arg) == SOCKET_ERROR)
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = WSAGetLastError();
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = WSAGetLastError();
+ throw ex;
}
#else
- int flags = fcntl(fd, F_GETFL);
- flags |= O_NONBLOCK;
- if(fcntl(fd, F_SETFL, flags) == SOCKET_ERROR)
+ int flags = fcntl(fd, F_GETFL);
+ flags |= O_NONBLOCK;
+ if(fcntl(fd, F_SETFL, flags) == SOCKET_ERROR)
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = errno;
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = errno;
+ throw ex;
}
#endif
}
@@ -361,10 +361,10 @@ IceInternal::setTimeout(SOCKET fd, bool recv, int timeout)
if(setsockopt(fd, SOL_SOCKET, recv ? SO_RCVTIMEO : SO_SNDTIMEO, (char*)&tt, (int)sizeof(int)) == SOCKET_ERROR)
#endif
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
}
#endif
@@ -375,10 +375,10 @@ IceInternal::setTcpNoDelay(SOCKET fd)
int flag = 1;
if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, int(sizeof(int))) == SOCKET_ERROR)
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
}
@@ -388,10 +388,10 @@ IceInternal::setKeepAlive(SOCKET fd)
int flag = 1;
if(setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char*)&flag, int(sizeof(int))) == SOCKET_ERROR)
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
}
@@ -467,10 +467,10 @@ IceInternal::doBind(SOCKET fd, struct sockaddr_in& addr)
{
if(bind(fd, reinterpret_cast<struct sockaddr*>(&addr), int(sizeof(addr))) == SOCKET_ERROR)
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
socklen_t len = static_cast<socklen_t>(sizeof(addr));
@@ -495,188 +495,188 @@ IceInternal::doConnect(SOCKET fd, struct sockaddr_in& addr, int timeout)
WSAEVENT event = WSACreateEvent();
if(event == 0)
{
- closeSocketNoThrow(fd);
+ closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = WSAGetLastError();
- throw ex;
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = WSAGetLastError();
+ throw ex;
}
if(WSAEventSelect(fd, event, FD_CONNECT) == SOCKET_ERROR)
{
- int error = WSAGetLastError();
+ int error = WSAGetLastError();
- WSACloseEvent(event);
- closeSocketNoThrow(fd);
+ WSACloseEvent(event);
+ closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = error;
- throw ex;
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = error;
+ throw ex;
}
#endif
repeatConnect:
if(::connect(fd, reinterpret_cast<struct sockaddr*>(&addr), int(sizeof(addr))) == SOCKET_ERROR)
{
- if(interrupted())
- {
- goto repeatConnect;
- }
-
- if(connectInProgress())
- {
- int val;
+ if(interrupted())
+ {
+ goto repeatConnect;
+ }
+
+ if(connectInProgress())
+ {
+ int val;
#ifdef _WIN32
- WSAEVENT events[1];
- events[0] = event;
- long tout = (timeout >= 0) ? timeout : WSA_INFINITE;
- DWORD rc = WSAWaitForMultipleEvents(1, events, FALSE, tout, FALSE);
- if(rc == WSA_WAIT_FAILED)
- {
- int error = WSAGetLastError();
-
- WSACloseEvent(event);
- closeSocketNoThrow(fd);
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = error;
- throw ex;
- }
-
- if(rc == WSA_WAIT_TIMEOUT)
- {
- WSACloseEvent(event);
- closeSocketNoThrow(fd);
-
- assert(timeout >= 0);
- throw ConnectTimeoutException(__FILE__, __LINE__);
- }
- assert(rc == WSA_WAIT_EVENT_0);
-
- WSANETWORKEVENTS nevents;
- if(WSAEnumNetworkEvents(fd, event, &nevents) == SOCKET_ERROR)
- {
- int error = WSAGetLastError();
- WSACloseEvent(event);
- closeSocketNoThrow(fd);
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = error;
- throw ex;
- }
-
- //
- // This is necessary to be able to set the socket in blocking mode.
- //
- if(WSAEventSelect(fd, event, 0) == SOCKET_ERROR)
- {
- int error = WSAGetLastError();
-
- WSACloseEvent(event);
- closeSocketNoThrow(fd);
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = error;
- throw ex;
- }
-
- //
- // Now we close the event, because we're finished and
- // this code be repeated.
- //
- WSACloseEvent(event);
-
- assert(nevents.lNetworkEvents & FD_CONNECT);
- val = nevents.iErrorCode[FD_CONNECT_BIT];
+ WSAEVENT events[1];
+ events[0] = event;
+ long tout = (timeout >= 0) ? timeout : WSA_INFINITE;
+ DWORD rc = WSAWaitForMultipleEvents(1, events, FALSE, tout, FALSE);
+ if(rc == WSA_WAIT_FAILED)
+ {
+ int error = WSAGetLastError();
+
+ WSACloseEvent(event);
+ closeSocketNoThrow(fd);
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = error;
+ throw ex;
+ }
+
+ if(rc == WSA_WAIT_TIMEOUT)
+ {
+ WSACloseEvent(event);
+ closeSocketNoThrow(fd);
+
+ assert(timeout >= 0);
+ throw ConnectTimeoutException(__FILE__, __LINE__);
+ }
+ assert(rc == WSA_WAIT_EVENT_0);
+
+ WSANETWORKEVENTS nevents;
+ if(WSAEnumNetworkEvents(fd, event, &nevents) == SOCKET_ERROR)
+ {
+ int error = WSAGetLastError();
+ WSACloseEvent(event);
+ closeSocketNoThrow(fd);
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = error;
+ throw ex;
+ }
+
+ //
+ // This is necessary to be able to set the socket in blocking mode.
+ //
+ if(WSAEventSelect(fd, event, 0) == SOCKET_ERROR)
+ {
+ int error = WSAGetLastError();
+
+ WSACloseEvent(event);
+ closeSocketNoThrow(fd);
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = error;
+ throw ex;
+ }
+
+ //
+ // Now we close the event, because we're finished and
+ // this code be repeated.
+ //
+ WSACloseEvent(event);
+
+ assert(nevents.lNetworkEvents & FD_CONNECT);
+ val = nevents.iErrorCode[FD_CONNECT_BIT];
#else
repeatPoll:
struct pollfd pollFd[1];
pollFd[0].fd = fd;
pollFd[0].events = POLLOUT;
int ret = ::poll(pollFd, 1, timeout);
- if(ret == 0)
- {
- closeSocketNoThrow(fd);
- throw ConnectTimeoutException(__FILE__, __LINE__);
- }
- else if(ret == SOCKET_ERROR)
- {
- if(interrupted())
- {
- goto repeatPoll;
- }
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
-
+ if(ret == 0)
+ {
+ closeSocketNoThrow(fd);
+ throw ConnectTimeoutException(__FILE__, __LINE__);
+ }
+ else if(ret == SOCKET_ERROR)
+ {
+ if(interrupted())
+ {
+ goto repeatPoll;
+ }
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+
//
// Strange windows bug: The following call to Sleep() is
// necessary, otherwise no error is reported through
// getsockopt.
//
//Sleep(0);
- socklen_t len = static_cast<socklen_t>(sizeof(int));
- if(getsockopt(fd, SOL_SOCKET, SO_ERROR, reinterpret_cast<char*>(&val), &len) == SOCKET_ERROR)
- {
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
+ socklen_t len = static_cast<socklen_t>(sizeof(int));
+ if(getsockopt(fd, SOL_SOCKET, SO_ERROR, reinterpret_cast<char*>(&val), &len) == SOCKET_ERROR)
+ {
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
#endif
- if(val > 0)
- {
- closeSocketNoThrow(fd);
+ if(val > 0)
+ {
+ closeSocketNoThrow(fd);
#ifdef _WIN32
- WSASetLastError(val);
+ WSASetLastError(val);
#else
- errno = val;
+ errno = val;
#endif
- if(connectionRefused())
- {
- ConnectionRefusedException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- else if(connectFailed())
- {
- ConnectFailedException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- else
- {
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- }
-
- return;
- }
+ if(connectionRefused())
+ {
+ ConnectionRefusedException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ else if(connectFailed())
+ {
+ ConnectFailedException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ else
+ {
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ }
+
+ return;
+ }
- closeSocketNoThrow(fd);
- if(connectionRefused())
- {
- ConnectionRefusedException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- else if(connectFailed())
- {
- ConnectFailedException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- else
- {
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
+ closeSocketNoThrow(fd);
+ if(connectionRefused())
+ {
+ ConnectionRefusedException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ else if(connectFailed())
+ {
+ ConnectFailedException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ else
+ {
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
}
}
@@ -692,59 +692,59 @@ IceInternal::getAddress(const string& host, int port, struct sockaddr_in& addr)
{
#ifdef _WIN32
- //
- // Windows XP has getaddrinfo(), but we don't want to require XP to run IceE.
- //
-
- //
- // gethostbyname() is thread safe on Windows, with a separate hostent per thread
- //
- struct hostent* entry;
- int retry = 5;
- do
- {
- entry = gethostbyname(host.c_str());
- }
- while(entry == 0 && WSAGetLastError() == WSATRY_AGAIN && --retry >= 0);
-
- if(entry == 0)
- {
- DNSException ex(__FILE__, __LINE__);
-
- ex.error = WSAGetLastError();
- ex.host = host;
- throw ex;
- }
- memcpy(&addr.sin_addr, entry->h_addr, entry->h_length);
+ //
+ // Windows XP has getaddrinfo(), but we don't want to require XP to run IceE.
+ //
+
+ //
+ // gethostbyname() is thread safe on Windows, with a separate hostent per thread
+ //
+ struct hostent* entry;
+ int retry = 5;
+ do
+ {
+ entry = gethostbyname(host.c_str());
+ }
+ while(entry == 0 && WSAGetLastError() == WSATRY_AGAIN && --retry >= 0);
+
+ if(entry == 0)
+ {
+ DNSException ex(__FILE__, __LINE__);
+
+ ex.error = WSAGetLastError();
+ ex.host = host;
+ throw ex;
+ }
+ memcpy(&addr.sin_addr, entry->h_addr, entry->h_length);
#else
- struct addrinfo* info = 0;
- int retry = 5;
-
- struct addrinfo hints = { 0 };
- hints.ai_family = PF_INET;
-
- int rs = 0;
- do
- {
- rs = getaddrinfo(host.c_str(), 0, &hints, &info);
- }
- while(info == 0 && rs == EAI_AGAIN && --retry >= 0);
-
- if(rs != 0)
- {
- DNSException ex(__FILE__, __LINE__);
- ex.error = rs;
- ex.host = host;
- throw ex;
- }
-
- assert(info->ai_family == PF_INET);
- struct sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(info->ai_addr);
-
- addr.sin_addr.s_addr = sin->sin_addr.s_addr;
- freeaddrinfo(info);
+ struct addrinfo* info = 0;
+ int retry = 5;
+
+ struct addrinfo hints = { 0 };
+ hints.ai_family = PF_INET;
+
+ int rs = 0;
+ do
+ {
+ rs = getaddrinfo(host.c_str(), 0, &hints, &info);
+ }
+ while(info == 0 && rs == EAI_AGAIN && --retry >= 0);
+
+ if(rs != 0)
+ {
+ DNSException ex(__FILE__, __LINE__);
+ ex.error = rs;
+ ex.host = host;
+ throw ex;
+ }
+
+ assert(info->ai_family == PF_INET);
+ struct sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(info->ai_addr);
+
+ addr.sin_addr.s_addr = sin->sin_addr.s_addr;
+ freeaddrinfo(info);
#endif
}
@@ -765,24 +765,24 @@ IceInternal::errorToString(int error)
#ifndef _WIN32_WCE
if(error < WSABASEERR)
{
- LPVOID lpMsgBuf = 0;
- DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- error,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR)&lpMsgBuf,
- 0,
- NULL);
- if(ok)
- {
- LPCTSTR msg = (LPCTSTR)lpMsgBuf;
- assert(msg && strlen((const char*)msg) > 0);
- string result = (const char*)msg;
- LocalFree(lpMsgBuf);
- return result;
- }
+ LPVOID lpMsgBuf = 0;
+ DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ error,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR)&lpMsgBuf,
+ 0,
+ NULL);
+ if(ok)
+ {
+ LPCTSTR msg = (LPCTSTR)lpMsgBuf;
+ assert(msg && strlen((const char*)msg) > 0);
+ string result = (const char*)msg;
+ LocalFree(lpMsgBuf);
+ return result;
+ }
}
#endif
@@ -826,17 +826,17 @@ IceInternal::fdToString(SOCKET fd)
{
if(fd == INVALID_SOCKET)
{
- return "<closed>";
+ return "<closed>";
}
socklen_t localLen = static_cast<socklen_t>(sizeof(struct sockaddr_in));
struct sockaddr_in localAddr;
if(getsockname(fd, reinterpret_cast<struct sockaddr*>(&localAddr), &localLen) == SOCKET_ERROR)
{
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
bool peerNotConnected = false;
@@ -844,17 +844,17 @@ IceInternal::fdToString(SOCKET fd)
struct sockaddr_in remoteAddr;
if(getpeername(fd, reinterpret_cast<struct sockaddr*>(&remoteAddr), &remoteLen) == SOCKET_ERROR)
{
- if(notConnected())
- {
- peerNotConnected = true;
- }
- else
- {
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
+ if(notConnected())
+ {
+ peerNotConnected = true;
+ }
+ else
+ {
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
}
string s;
@@ -862,12 +862,12 @@ IceInternal::fdToString(SOCKET fd)
s += addrToString(localAddr);
if(peerNotConnected)
{
- s += "\nremote address = <not connected>";
+ s += "\nremote address = <not connected>";
}
else
{
- s += "\nremote address = ";
- s += addrToString(remoteAddr);
+ s += "\nremote address = ";
+ s += addrToString(remoteAddr);
}
return s;
}
@@ -889,7 +889,7 @@ IceInternal::acceptInterrupted()
{
if(interrupted())
{
- return true;
+ return true;
}
#ifdef _WIN32
@@ -912,14 +912,14 @@ IceInternal::doAccept(SOCKET fd)
repeatAccept:
if((ret = ::accept(fd, 0, 0)) == INVALID_SOCKET)
{
- if(acceptInterrupted())
- {
- goto repeatAccept;
- }
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ if(acceptInterrupted())
+ {
+ goto repeatAccept;
+ }
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
setTcpNoDelay(ret);
@@ -933,15 +933,15 @@ IceInternal::doListen(SOCKET fd, int backlog)
repeatListen:
if(::listen(fd, backlog) == SOCKET_ERROR)
{
- if(interrupted())
- {
- goto repeatListen;
- }
-
- closeSocketNoThrow(fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ if(interrupted())
+ {
+ goto repeatListen;
+ }
+
+ closeSocketNoThrow(fd);
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
}
@@ -989,7 +989,7 @@ IceInternal::getLocalHosts()
for (int i = 0; i < addrs->iAddressCount; ++i)
{
result.push_back(
- inetAddrToString(reinterpret_cast<struct sockaddr_in*>(addrs->Address[i].lpSockaddr)->sin_addr));
+ inetAddrToString(reinterpret_cast<struct sockaddr_in*>(addrs->Address[i].lpSockaddr)->sin_addr));
}
//
diff --git a/cppe/src/IceE/Object.cpp b/cppe/src/IceE/Object.cpp
index df169ea057e..025db36ba10 100644
--- a/cppe/src/IceE/Object.cpp
+++ b/cppe/src/IceE/Object.cpp
@@ -126,31 +126,31 @@ DispatchStatus
Ice::Object::__dispatch(Incoming& in, const Current& current)
{
pair<string*, string*> r =
- equal_range(__all, __all + sizeof(__all) / sizeof(string), current.operation);
+ equal_range(__all, __all + sizeof(__all) / sizeof(string), current.operation);
if(r.first == r.second)
{
- throw OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
- }
+ throw OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
+ }
switch(r.first - __all)
{
case 0:
{
- return ___ice_id(in, current);
+ return ___ice_id(in, current);
}
case 1:
{
- return ___ice_ids(in, current);
+ return ___ice_ids(in, current);
}
case 2:
- {
- return ___ice_isA(in, current);
- }
- case 3:
- {
- return ___ice_ping(in, current);
- }
+ {
+ return ___ice_isA(in, current);
+ }
+ case 3:
+ {
+ return ___ice_ping(in, current);
+ }
}
assert(false);
@@ -163,13 +163,13 @@ operationModeToString(OperationMode mode)
switch(mode)
{
case Normal:
- return "::Ice::Normal";
+ return "::Ice::Normal";
case Nonmutating:
- return "::Ice::Nonmutating";
+ return "::Ice::Nonmutating";
case Idempotent:
- return "::Ice::Idempotent";
+ return "::Ice::Idempotent";
}
return "???";
@@ -182,22 +182,22 @@ Ice::Object::__invalidMode(OperationMode expected, OperationMode received)
if(expected == Idempotent && received == Nonmutating)
{
- //
- // Fine: typically an old client still using the deprecated nonmutating keyword
- //
-
- //
- // Note that expected == Nonmutating and received == Idempotent is not ok:
- // the server may still use the deprecated nonmutating keyword to detect updates
- // and the client should not break this (deprecated) feature.
- //
+ //
+ // Fine: typically an old client still using the deprecated nonmutating keyword
+ //
+
+ //
+ // Note that expected == Nonmutating and received == Idempotent is not ok:
+ // the server may still use the deprecated nonmutating keyword to detect updates
+ // and the client should not break this (deprecated) feature.
+ //
}
else
{
- Ice::MarshalException ex(__FILE__, __LINE__);
- ex.reason = Ice::printfToString("unexpected operation mode. expected = %s received = %s",
- operationModeToString(expected), operationModeToString(received));
- throw ex;
+ Ice::MarshalException ex(__FILE__, __LINE__);
+ ex.reason = Ice::printfToString("unexpected operation mode. expected = %s received = %s",
+ operationModeToString(expected), operationModeToString(received));
+ throw ex;
}
}
@@ -212,10 +212,10 @@ Ice::Blobject::__dispatch(Incoming& in, const Current& current)
in.os()->writeBlob(outParams);
if(ok)
{
- return DispatchOK;
+ return DispatchOK;
}
else
{
- return DispatchUserException;
+ return DispatchUserException;
}
}
diff --git a/cppe/src/IceE/ObjectAdapter.cpp b/cppe/src/IceE/ObjectAdapter.cpp
index 2148ecc74bb..a67f4b59a71 100644
--- a/cppe/src/IceE/ObjectAdapter.cpp
+++ b/cppe/src/IceE/ObjectAdapter.cpp
@@ -67,80 +67,80 @@ Ice::ObjectAdapter::activate()
bool printAdapterReady = false;
{
- IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
-
- checkForDeactivation();
-
- //
- // If the one off initializations of the adapter are already
- // done, we just need to activate the incoming connection
- // factories and we're done.
- //
- if(_activateOneOffDone)
- {
- for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
- Ice::voidMemFun(&IncomingConnectionFactory::activate));
- return;
- }
-
- //
- // One off initializations of the adapter: update the locator
- // registry and print the "adapter ready" message. We set the
- // _waitForActivate flag to prevent deactivation from other
- // threads while these one off initializations are done.
- //
- _waitForActivate = true;
+ IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
+
+ checkForDeactivation();
+
+ //
+ // If the one off initializations of the adapter are already
+ // done, we just need to activate the incoming connection
+ // factories and we're done.
+ //
+ if(_activateOneOffDone)
+ {
+ for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
+ Ice::voidMemFun(&IncomingConnectionFactory::activate));
+ return;
+ }
+
+ //
+ // One off initializations of the adapter: update the locator
+ // registry and print the "adapter ready" message. We set the
+ // _waitForActivate flag to prevent deactivation from other
+ // threads while these one off initializations are done.
+ //
+ _waitForActivate = true;
#ifdef ICEE_HAS_LOCATOR
- locatorInfo = _locatorInfo;
+ locatorInfo = _locatorInfo;
#endif
- printAdapterReady = _instance->initializationData().properties->getPropertyAsInt("Ice.PrintAdapterReady") > 0;
+ printAdapterReady = _instance->initializationData().properties->getPropertyAsInt("Ice.PrintAdapterReady") > 0;
}
#ifdef ICEE_HAS_LOCATOR
try
{
- Ice::Identity dummy;
- dummy.name = "dummy";
- updateLocatorRegistry(locatorInfo, createDirectProxy(dummy));
+ Ice::Identity dummy;
+ dummy.name = "dummy";
+ updateLocatorRegistry(locatorInfo, createDirectProxy(dummy));
}
catch(const Ice::LocalException&)
{
- //
- // If we couldn't update the locator registry, we let the
- // exception go through and don't activate the adapter to
- // allow to user code to retry activating the adapter
- // later.
- //
- {
- IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
- _waitForActivate = false;
- notifyAll();
- }
- throw;
+ //
+ // If we couldn't update the locator registry, we let the
+ // exception go through and don't activate the adapter to
+ // allow to user code to retry activating the adapter
+ // later.
+ //
+ {
+ IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
+ _waitForActivate = false;
+ notifyAll();
+ }
+ throw;
}
#endif
if(printAdapterReady)
{
- printf("%s ready\n", _name.c_str());
- fflush(stdout);
+ printf("%s ready\n", _name.c_str());
+ fflush(stdout);
}
{
- IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
- assert(!_deactivated); // Not possible if _waitForActivate = true;
+ IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
+ assert(!_deactivated); // Not possible if _waitForActivate = true;
- //
- // Signal threads waiting for the activation.
- //
- _waitForActivate = false;
- notifyAll();
+ //
+ // Signal threads waiting for the activation.
+ //
+ _waitForActivate = false;
+ notifyAll();
- _activateOneOffDone = true;
+ _activateOneOffDone = true;
- for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
- Ice::voidMemFun(&IncomingConnectionFactory::activate));
+ for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
+ Ice::voidMemFun(&IncomingConnectionFactory::activate));
}
}
@@ -150,9 +150,9 @@ Ice::ObjectAdapter::hold()
IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
checkForDeactivation();
-
+
for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
- Ice::voidMemFun(&IncomingConnectionFactory::hold));
+ Ice::voidMemFun(&IncomingConnectionFactory::hold));
}
void
@@ -163,7 +163,7 @@ Ice::ObjectAdapter::waitForHold()
checkForDeactivation();
for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
- Ice::constVoidMemFun(&IncomingConnectionFactory::waitUntilHolding));
+ Ice::constVoidMemFun(&IncomingConnectionFactory::waitUntilHolding));
}
void
@@ -176,25 +176,25 @@ Ice::ObjectAdapter::deactivate()
#endif
{
- IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
-
- //
- // Ignore deactivation requests if the object adapter has already
- // been deactivated.
- //
- if(_deactivated)
- {
- return;
- }
-
- //
- // Wait for activation to complete. This is necessary to not
- // get out of order locator updates.
- //
- while(_waitForActivate)
- {
- wait();
- }
+ IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
+
+ //
+ // Ignore deactivation requests if the object adapter has already
+ // been deactivated.
+ //
+ if(_deactivated)
+ {
+ return;
+ }
+
+ //
+ // Wait for activation to complete. This is necessary to not
+ // get out of order locator updates.
+ //
+ while(_waitForActivate)
+ {
+ wait();
+ }
#ifdef ICEE_HAS_ROUTER
if(_routerInfo)
@@ -212,27 +212,27 @@ Ice::ObjectAdapter::deactivate()
#endif
incomingConnectionFactories = _incomingConnectionFactories;
- outgoingConnectionFactory = _instance->outgoingConnectionFactory();
+ outgoingConnectionFactory = _instance->outgoingConnectionFactory();
#ifdef ICEE_HAS_LOCATOR
- locatorInfo = _locatorInfo;
+ locatorInfo = _locatorInfo;
#endif
- _deactivated = true;
-
- notifyAll();
+ _deactivated = true;
+
+ notifyAll();
}
#ifdef ICEE_HAS_LOCATOR
try
{
- updateLocatorRegistry(locatorInfo, 0);
+ updateLocatorRegistry(locatorInfo, 0);
}
catch(const Ice::LocalException&)
{
- //
- // We can't throw exceptions in deactivate so we ignore
- // failures to update the locator registry.
- //
+ //
+ // We can't throw exceptions in deactivate so we ignore
+ // failures to update the locator registry.
+ //
}
#endif
@@ -242,7 +242,7 @@ Ice::ObjectAdapter::deactivate()
// message.
//
for_each(incomingConnectionFactories.begin(), incomingConnectionFactories.end(),
- Ice::voidMemFun(&IncomingConnectionFactory::destroy));
+ Ice::voidMemFun(&IncomingConnectionFactory::destroy));
//
// Must be called outside the thread synchronization, because
@@ -523,8 +523,8 @@ Ice::ObjectAdapter::createReverseProxy(const Identity& ident) const
vector<IncomingConnectionFactoryPtr>::const_iterator p;
for(p = _incomingConnectionFactories.begin(); p != _incomingConnectionFactories.end(); ++p)
{
- list<ConnectionPtr> cons = (*p)->connections();
- copy(cons.begin(), cons.end(), back_inserter(connections));
+ list<ConnectionPtr> cons = (*p)->connections();
+ copy(cons.begin(), cons.end(), back_inserter(connections));
}
//
@@ -533,7 +533,7 @@ Ice::ObjectAdapter::createReverseProxy(const Identity& ident) const
//
vector<EndpointPtr> endpoints;
ReferencePtr ref = _instance->referenceFactory()->create(ident, Ice::Context(), "", ReferenceModeTwoway,
- connections);
+ connections);
return _instance->proxyFactory()->referenceToProxy(ref);
}
@@ -554,8 +554,8 @@ Ice::ObjectAdapter::flushBatchRequests()
{
vector<IncomingConnectionFactoryPtr> f;
{
- IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
- f = _incomingConnectionFactories;
+ IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
+ f = _incomingConnectionFactories;
}
for_each(f.begin(), f.end(), Ice::voidMemFun(&IncomingConnectionFactory::flushBatchRequests));
}
@@ -583,7 +583,7 @@ Ice::ObjectAdapter::decDirectCount()
assert(_directCount > 0);
if(--_directCount == 0)
{
- notifyAll();
+ notifyAll();
}
}
@@ -597,12 +597,12 @@ Ice::ObjectAdapter::getServantManager() const
}
Ice::ObjectAdapter::ObjectAdapter(const InstancePtr& instance, const CommunicatorPtr& communicator,
- const ObjectAdapterFactoryPtr& objectAdapterFactory,
- const string& name, const string& endpointInfo
+ const ObjectAdapterFactoryPtr& objectAdapterFactory,
+ const string& name, const string& endpointInfo
#ifdef ICEE_HAS_ROUTER
- , const RouterPrx& router
+ , const RouterPrx& router
#endif
- ) :
+ ) :
_deactivated(false),
_instance(instance),
_communicator(communicator),
@@ -670,36 +670,36 @@ Ice::ObjectAdapter::ObjectAdapter(const InstancePtr& instance, const Communicato
//
_instance->outgoingConnectionFactory()->setRouterInfo(_routerInfo);
}
- }
- else
+ }
+ else
#endif
- {
- //
- // Parse the endpoints, but don't store them in the adapter.
- // The connection factory might change it, for example, to
- // fill in the real port number.
- //
- vector<EndpointPtr> endpoints = parseEndpoints(endpointInfo);
- for(vector<EndpointPtr>::iterator p = endpoints.begin(); p != endpoints.end(); ++p)
- {
- _incomingConnectionFactories.push_back(new IncomingConnectionFactory(_instance, *p, this));
- }
- if(endpoints.empty())
- {
- TraceLevelsPtr tl = _instance->traceLevels();
- if(tl->network >= 2)
- {
- Trace out(_instance->initializationData().logger, tl->networkCat);
- out << "created adapter `" << name << "' without endpoints";
- }
- }
-
- //
- // Parse published endpoints. These are used in proxies
- // instead of the connection factory endpoints.
- //
- string endpts = _instance->initializationData().properties->getProperty(name + ".PublishedEndpoints");
- _publishedEndpoints = parseEndpoints(endpts);
+ {
+ //
+ // Parse the endpoints, but don't store them in the adapter.
+ // The connection factory might change it, for example, to
+ // fill in the real port number.
+ //
+ vector<EndpointPtr> endpoints = parseEndpoints(endpointInfo);
+ for(vector<EndpointPtr>::iterator p = endpoints.begin(); p != endpoints.end(); ++p)
+ {
+ _incomingConnectionFactories.push_back(new IncomingConnectionFactory(_instance, *p, this));
+ }
+ if(endpoints.empty())
+ {
+ TraceLevelsPtr tl = _instance->traceLevels();
+ if(tl->network >= 2)
+ {
+ Trace out(_instance->initializationData().logger, tl->networkCat);
+ out << "created adapter `" << name << "' without endpoints";
+ }
+ }
+
+ //
+ // Parse published endpoints. These are used in proxies
+ // instead of the connection factory endpoints.
+ //
+ string endpts = _instance->initializationData().properties->getProperty(name + ".PublishedEndpoints");
+ _publishedEndpoints = parseEndpoints(endpts);
if(_publishedEndpoints.empty())
{
transform(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
@@ -711,26 +711,26 @@ Ice::ObjectAdapter::ObjectAdapter(const InstancePtr& instance, const Communicato
//
_publishedEndpoints.erase(remove_if(_publishedEndpoints.begin(), _publishedEndpoints.end(),
not1(Ice::constMemFun(&Endpoint::publish))), _publishedEndpoints.end());
- }
+ }
#ifdef ICEE_HAS_LOCATOR
- string locator = _instance->initializationData().properties->getProperty(_name + ".Locator");
- if(!locator.empty())
- {
- setLocator(LocatorPrx::uncheckedCast(_instance->proxyFactory()->stringToProxy(locator)));
- }
- else
- {
- setLocator(_instance->referenceFactory()->getDefaultLocator());
- }
+ string locator = _instance->initializationData().properties->getProperty(_name + ".Locator");
+ if(!locator.empty())
+ {
+ setLocator(LocatorPrx::uncheckedCast(_instance->proxyFactory()->stringToProxy(locator)));
+ }
+ else
+ {
+ setLocator(_instance->referenceFactory()->getDefaultLocator());
+ }
#endif
}
catch(...)
{
- deactivate();
- waitForDeactivate();
- __setNoDelete(false);
- throw;
+ deactivate();
+ waitForDeactivate();
+ __setNoDelete(false);
+ throw;
}
__setNoDelete(false);
}
@@ -739,21 +739,21 @@ Ice::ObjectAdapter::~ObjectAdapter()
{
if(!_deactivated)
{
- Warning out(_instance->initializationData().logger);
- out << "object adapter `" << _name << "' has not been deactivated";
+ Warning out(_instance->initializationData().logger);
+ out << "object adapter `" << _name << "' has not been deactivated";
}
else if(!_destroyed)
{
- Warning out(_instance->initializationData().logger);
- out << "object adapter `" << _name << "' has not been destroyed";
+ Warning out(_instance->initializationData().logger);
+ out << "object adapter `" << _name << "' has not been destroyed";
}
else
{
- //assert(!_servantManager); // We don't clear this reference, it needs to be immutable.
- assert(!_communicator);
- assert(_incomingConnectionFactories.empty());
- assert(_directCount == 0);
- assert(!_waitForActivate);
+ //assert(!_servantManager); // We don't clear this reference, it needs to be immutable.
+ assert(!_communicator);
+ assert(_incomingConnectionFactories.empty());
+ assert(_directCount == 0);
+ assert(!_waitForActivate);
}
}
@@ -764,16 +764,16 @@ Ice::ObjectAdapter::newProxy(const Identity& ident, const string& facet) const
if(_id.empty())
{
#endif
- return newDirectProxy(ident, facet);
+ return newDirectProxy(ident, facet);
#ifdef ICEE_HAS_LOCATOR
}
else if(_replicaGroupId.empty())
{
- return newIndirectProxy(ident, facet, _id);
+ return newIndirectProxy(ident, facet, _id);
}
else
{
- return newIndirectProxy(ident, facet, _replicaGroupId);
+ return newIndirectProxy(ident, facet, _replicaGroupId);
}
#endif
}
@@ -797,10 +797,10 @@ Ice::ObjectAdapter::newDirectProxy(const Identity& ident, const string& facet) c
//
#ifdef ICEE_HAS_ROUTER
ReferencePtr ref = _instance->referenceFactory()->create(ident, Ice::Context(), facet, ReferenceModeTwoway,
- false, endpoints, 0);
+ false, endpoints, 0);
#else
ReferencePtr ref = _instance->referenceFactory()->create(ident, Ice::Context(), facet, ReferenceModeTwoway,
- false, endpoints);
+ false, endpoints);
#endif
return _instance->proxyFactory()->referenceToProxy(ref);
@@ -816,11 +816,11 @@ Ice::ObjectAdapter::newIndirectProxy(const Identity& ident, const string& facet,
#ifdef ICEE_HAS_ROUTER
ReferencePtr ref =
_instance->referenceFactory()->create(ident, Ice::Context(), facet, ReferenceModeTwoway, false, id, 0,
- _locatorInfo);
+ _locatorInfo);
#else
ReferencePtr ref =
_instance->referenceFactory()->create(ident, Ice::Context(), facet, ReferenceModeTwoway, false, id,
- _locatorInfo);
+ _locatorInfo);
#endif
//
@@ -835,9 +835,9 @@ Ice::ObjectAdapter::checkForDeactivation() const
{
if(_deactivated)
{
- ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
- ex.name = _name;
- throw ex;
+ ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
+ ex.name = _name;
+ throw ex;
}
}
@@ -864,38 +864,38 @@ Ice::ObjectAdapter::parseEndpoints(const string& str) const
vector<EndpointPtr> endpoints;
while(end < endpts.length())
{
- const string delim = " \t\n\r";
-
- beg = endpts.find_first_not_of(delim, end);
- if(beg == string::npos)
- {
- break;
- }
-
- end = endpts.find(':', beg);
- if(end == string::npos)
- {
- end = endpts.length();
- }
-
- if(end == beg)
- {
- ++end;
- continue;
- }
-
- string s = endpts.substr(beg, end - beg);
- EndpointPtr endp = _instance->endpointFactory()->create(s);
- if(endp == 0)
- {
- EndpointParseException ex(__FILE__, __LINE__);
- ex.str = s;
- throw ex;
- }
+ const string delim = " \t\n\r";
+
+ beg = endpts.find_first_not_of(delim, end);
+ if(beg == string::npos)
+ {
+ break;
+ }
+
+ end = endpts.find(':', beg);
+ if(end == string::npos)
+ {
+ end = endpts.length();
+ }
+
+ if(end == beg)
+ {
+ ++end;
+ continue;
+ }
+
+ string s = endpts.substr(beg, end - beg);
+ EndpointPtr endp = _instance->endpointFactory()->create(s);
+ if(endp == 0)
+ {
+ EndpointParseException ex(__FILE__, __LINE__);
+ ex.str = s;
+ throw ex;
+ }
vector<EndpointPtr> endps = endp->expand(true);
endpoints.insert(endpoints.end(), endps.begin(), endps.end());
- ++end;
+ ++end;
}
return endpoints;
@@ -907,7 +907,7 @@ ObjectAdapter::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locatorI
{
if(_id.empty())
{
- return; // Nothing to update.
+ return; // Nothing to update.
}
//
@@ -924,42 +924,42 @@ ObjectAdapter::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locatorI
LocatorRegistryPrx locatorRegistry = locatorInfo ? locatorInfo->getLocatorRegistry() : LocatorRegistryPrx();
if(!locatorRegistry)
{
- return;
+ return;
}
if(!_id.empty())
{
- try
- {
- if(_replicaGroupId.empty())
- {
- locatorRegistry->setAdapterDirectProxy(_id, proxy);
- }
- else
- {
- locatorRegistry->setReplicatedAdapterDirectProxy(_id, _replicaGroupId, proxy);
- }
- }
- catch(const AdapterNotFoundException&)
- {
- NotRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "object adapter";
- ex.id = _id;
- throw ex;
- }
- catch(const InvalidReplicaGroupIdException&)
- {
- NotRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "replica group";
- ex.id = _replicaGroupId;
- throw ex;
- }
- catch(const AdapterAlreadyActiveException&)
- {
- ObjectAdapterIdInUseException ex(__FILE__, __LINE__);
- ex.id = _id;
- throw ex;
- }
+ try
+ {
+ if(_replicaGroupId.empty())
+ {
+ locatorRegistry->setAdapterDirectProxy(_id, proxy);
+ }
+ else
+ {
+ locatorRegistry->setReplicatedAdapterDirectProxy(_id, _replicaGroupId, proxy);
+ }
+ }
+ catch(const AdapterNotFoundException&)
+ {
+ NotRegisteredException ex(__FILE__, __LINE__);
+ ex.kindOfObject = "object adapter";
+ ex.id = _id;
+ throw ex;
+ }
+ catch(const InvalidReplicaGroupIdException&)
+ {
+ NotRegisteredException ex(__FILE__, __LINE__);
+ ex.kindOfObject = "replica group";
+ ex.id = _replicaGroupId;
+ throw ex;
+ }
+ catch(const AdapterAlreadyActiveException&)
+ {
+ ObjectAdapterIdInUseException ex(__FILE__, __LINE__);
+ ex.id = _id;
+ throw ex;
+ }
}
}
#endif
diff --git a/cppe/src/IceE/ObjectAdapterFactory.cpp b/cppe/src/IceE/ObjectAdapterFactory.cpp
index b2a23adbfeb..e53feb3be0c 100644
--- a/cppe/src/IceE/ObjectAdapterFactory.cpp
+++ b/cppe/src/IceE/ObjectAdapterFactory.cpp
@@ -24,23 +24,23 @@ IceInternal::ObjectAdapterFactory::shutdown()
map<string, ObjectAdapterPtr> adapters;
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- //
- // Ignore shutdown requests if the object adapter factory has
- // already been shut down.
- //
- if(!_instance)
- {
- return;
- }
-
- adapters = _adapters;
-
- _instance = 0;
- _communicator = 0;
-
- notifyAll();
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ //
+ // Ignore shutdown requests if the object adapter factory has
+ // already been shut down.
+ //
+ if(!_instance)
+ {
+ return;
+ }
+
+ adapters = _adapters;
+
+ _instance = 0;
+ _communicator = 0;
+
+ notifyAll();
}
//
@@ -48,10 +48,10 @@ IceInternal::ObjectAdapterFactory::shutdown()
// deadlocks.
//
//for_each(adapters.begin(), adapters.end(),
- //Ice::secondVoidMemFun<const string, ObjectAdapter>(&ObjectAdapter::deactivate));
+ //Ice::secondVoidMemFun<const string, ObjectAdapter>(&ObjectAdapter::deactivate));
for(map<string, ObjectAdapterPtr>::const_iterator p = adapters.begin(); p != adapters.end(); ++p)
{
- p->second->deactivate();
+ p->second->deactivate();
}
}
@@ -60,25 +60,25 @@ void
IceInternal::ObjectAdapterFactory::waitForShutdown()
{
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- //
- // First we wait for the shutdown of the factory itself.
- //
- while(_instance)
- {
- wait();
- }
-
- //
- // If some other thread is currently shutting down, we wait
- // until this thread is finished.
- //
- while(_waitForShutdown)
- {
- wait();
- }
- _waitForShutdown = true;
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ //
+ // First we wait for the shutdown of the factory itself.
+ //
+ while(_instance)
+ {
+ wait();
+ }
+
+ //
+ // If some other thread is currently shutting down, we wait
+ // until this thread is finished.
+ //
+ while(_waitForShutdown)
+ {
+ wait();
+ }
+ _waitForShutdown = true;
}
//
@@ -86,17 +86,17 @@ IceInternal::ObjectAdapterFactory::waitForShutdown()
//
for(map<string, ObjectAdapterPtr>::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p)
{
- p->second->waitForDeactivate();
+ p->second->waitForDeactivate();
}
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- //
- // Signal that waiting is complete.
- //
- _waitForShutdown = false;
- notifyAll();
+ //
+ // Signal that waiting is complete.
+ //
+ _waitForShutdown = false;
+ notifyAll();
}
}
@@ -130,35 +130,35 @@ IceInternal::ObjectAdapterFactory::destroy()
//
for(map<string, ObjectAdapterPtr>::const_iterator p = adapters.begin(); p != adapters.end(); ++p)
{
- p->second->destroy();
+ p->second->destroy();
}
}
ObjectAdapterPtr
IceInternal::ObjectAdapterFactory::createObjectAdapter(const string& name, const string& endpoints
#ifdef ICEE_HAS_ROUTER
- , const RouterPrx& router
+ , const RouterPrx& router
#endif
- )
+ )
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
if(!_instance)
{
- throw ObjectAdapterDeactivatedException(__FILE__, __LINE__);
+ throw ObjectAdapterDeactivatedException(__FILE__, __LINE__);
}
map<string, ObjectAdapterPtr>::iterator p = _adapters.find(name);
if(p != _adapters.end())
{
- throw AlreadyRegisteredException(__FILE__, __LINE__, "object adapter", name);
+ throw AlreadyRegisteredException(__FILE__, __LINE__, "object adapter", name);
}
ObjectAdapterPtr adapter = new ObjectAdapter(_instance, _communicator, this, name, endpoints
#ifdef ICEE_HAS_ROUTER
- , router
+ , router
#endif
- );
+ );
_adapters.insert(make_pair(name, adapter));
return adapter;
}
@@ -182,7 +182,7 @@ struct FlushAdapter
{
void operator() (ObjectAdapterPtr p)
{
- p->flushBatchRequests();
+ p->flushBatchRequests();
}
};
@@ -193,18 +193,18 @@ IceInternal::ObjectAdapterFactory::flushBatchRequests() const
{
list<ObjectAdapterPtr> a;
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- for(map<string, ObjectAdapterPtr>::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p)
- {
- a.push_back(p->second);
- }
+ for(map<string, ObjectAdapterPtr>::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p)
+ {
+ a.push_back(p->second);
+ }
}
for_each(a.begin(), a.end(), FlushAdapter());
}
IceInternal::ObjectAdapterFactory::ObjectAdapterFactory(const InstancePtr& instance,
- const CommunicatorPtr& communicator) :
+ const CommunicatorPtr& communicator) :
_instance(instance),
_communicator(communicator),
_waitForShutdown(false)
diff --git a/cppe/src/IceE/ObjectAdapterFactory.h b/cppe/src/IceE/ObjectAdapterFactory.h
index 8bf700c5d84..5bf7be7bc6b 100644
--- a/cppe/src/IceE/ObjectAdapterFactory.h
+++ b/cppe/src/IceE/ObjectAdapterFactory.h
@@ -36,9 +36,9 @@ public:
::Ice::ObjectAdapterPtr createObjectAdapter(const std::string&, const std::string&
#ifdef ICEE_HAS_ROUTER
- , const ::Ice::RouterPrx&
+ , const ::Ice::RouterPrx&
#endif
- );
+ );
void removeObjectAdapter(const std::string&);
void flushBatchRequests() const;
diff --git a/cppe/src/IceE/Outgoing.cpp b/cppe/src/IceE/Outgoing.cpp
index 2bf572dfab2..19b7d9a07ee 100644
--- a/cppe/src/IceE/Outgoing.cpp
+++ b/cppe/src/IceE/Outgoing.cpp
@@ -45,7 +45,7 @@ IceInternal::LocalExceptionWrapper::retry() const
}
IceInternal::Outgoing::Outgoing(Connection* connection, Reference* ref, const string& operation,
- OperationMode mode, const Context* context) :
+ OperationMode mode, const Context* context) :
_connection(connection),
_reference(ref),
_state(StateUnsent),
@@ -58,26 +58,26 @@ IceInternal::Outgoing::Outgoing(Connection* connection, Reference* ref, const st
{
switch(_reference->getMode())
{
- case ReferenceModeTwoway:
- case ReferenceModeOneway:
- {
- _stream.writeBlob(requestHdr, sizeof(requestHdr));
- break;
- }
+ case ReferenceModeTwoway:
+ case ReferenceModeOneway:
+ {
+ _stream.writeBlob(requestHdr, sizeof(requestHdr));
+ break;
+ }
- case ReferenceModeBatchOneway:
+ case ReferenceModeBatchOneway:
#ifdef ICEE_HAS_BATCH
- {
- _connection->prepareBatchRequest(&_stream);
- break;
- }
+ {
+ _connection->prepareBatchRequest(&_stream);
+ break;
+ }
#endif
- case ReferenceModeDatagram:
- case ReferenceModeBatchDatagram:
- {
- assert(false);
- break;
- }
+ case ReferenceModeDatagram:
+ case ReferenceModeBatchDatagram:
+ {
+ assert(false);
+ break;
+ }
}
// _reference->getIdentity().__write(&_stream);
@@ -91,12 +91,12 @@ IceInternal::Outgoing::Outgoing(Connection* connection, Reference* ref, const st
//
if(_reference->getFacet().empty())
{
- _stream.writeSize(0);
+ _stream.writeSize(0);
}
else
{
- _stream.writeSize(1);
- _stream.write(_reference->getFacet());
+ _stream.writeSize(1);
+ _stream.write(_reference->getFacet());
}
_stream.write(operation, false);
@@ -112,8 +112,8 @@ IceInternal::Outgoing::Outgoing(Connection* connection, Reference* ref, const st
Context::const_iterator p;
for(p = context->begin(); p != context->end(); ++p)
{
- _stream.write(p->first);
- _stream.write(p->second);
+ _stream.write(p->first);
+ _stream.write(p->second);
}
//
@@ -134,86 +134,86 @@ IceInternal::Outgoing::invoke()
switch(_reference->getMode())
{
- case ReferenceModeTwoway:
- {
- //
- // We let all exceptions raised by sending directly
- // propagate to the caller, because they can be retried
- // without violating "at-most-once". In case of such
- // exceptions, the connection object does not call back on
- // this object, so we don't need to lock the mutex, keep
- // track of state, or save exceptions.
- //
- _connection->sendRequest(&_stream, this);
+ case ReferenceModeTwoway:
+ {
+ //
+ // We let all exceptions raised by sending directly
+ // propagate to the caller, because they can be retried
+ // without violating "at-most-once". In case of such
+ // exceptions, the connection object does not call back on
+ // this object, so we don't need to lock the mutex, keep
+ // track of state, or save exceptions.
+ //
+ _connection->sendRequest(&_stream, this);
- if(_exception.get())
- {
- //
- // A CloseConnectionException indicates graceful
- // server shutdown, and is therefore always repeatable
- // without violating "at-most-once". That's because by
- // sending a close connection message, the server
- // guarantees that all outstanding requests can safely
- // be repeated.
- //
- // An ObjectNotExistException can always be retried as
- // well without violating "at-most-once".
- //
- if(dynamic_cast<CloseConnectionException*>(_exception.get()) ||
- dynamic_cast<ObjectNotExistException*>(_exception.get()))
- {
- _exception->ice_throw();
- }
-
- //
- // Throw the exception wrapped in a LocalExceptionWrapper, to
- // indicate that the request cannot be resent without
- // potentially violating the "at-most-once" principle.
- //
- throw LocalExceptionWrapper(*_exception.get(), false);
- }
-
- if(_state == StateUserException)
- {
- return false;
- }
+ if(_exception.get())
+ {
+ //
+ // A CloseConnectionException indicates graceful
+ // server shutdown, and is therefore always repeatable
+ // without violating "at-most-once". That's because by
+ // sending a close connection message, the server
+ // guarantees that all outstanding requests can safely
+ // be repeated.
+ //
+ // An ObjectNotExistException can always be retried as
+ // well without violating "at-most-once".
+ //
+ if(dynamic_cast<CloseConnectionException*>(_exception.get()) ||
+ dynamic_cast<ObjectNotExistException*>(_exception.get()))
+ {
+ _exception->ice_throw();
+ }
+
+ //
+ // Throw the exception wrapped in a LocalExceptionWrapper, to
+ // indicate that the request cannot be resent without
+ // potentially violating the "at-most-once" principle.
+ //
+ throw LocalExceptionWrapper(*_exception.get(), false);
+ }
+
+ if(_state == StateUserException)
+ {
+ return false;
+ }
- assert(_state == StateOK);
- break;
- }
-
- case ReferenceModeOneway:
- {
- //
- // For oneway requests, the connection object
- // never calls back on this object. Therefore we don't
- // need to lock the mutex or save exceptions. We simply
- // let all exceptions from sending propagate to the
- // caller, because such exceptions can be retried without
- // violating "at-most-once".
- //
- _connection->sendRequest(&_stream, 0);
- break;
- }
+ assert(_state == StateOK);
+ break;
+ }
+
+ case ReferenceModeOneway:
+ {
+ //
+ // For oneway requests, the connection object
+ // never calls back on this object. Therefore we don't
+ // need to lock the mutex or save exceptions. We simply
+ // let all exceptions from sending propagate to the
+ // caller, because such exceptions can be retried without
+ // violating "at-most-once".
+ //
+ _connection->sendRequest(&_stream, 0);
+ break;
+ }
- case ReferenceModeBatchOneway:
+ case ReferenceModeBatchOneway:
#ifdef ICEE_HAS_BATCH
- {
- //
- // For batch oneways, the same rules as for
- // regular oneways (see comment above)
- // apply.
- //
- _connection->finishBatchRequest(&_stream);
- break;
- }
+ {
+ //
+ // For batch oneways, the same rules as for
+ // regular oneways (see comment above)
+ // apply.
+ //
+ _connection->finishBatchRequest(&_stream);
+ break;
+ }
#endif
- case ReferenceModeDatagram:
- case ReferenceModeBatchDatagram:
- {
- assert(false);
- return false;
- }
+ case ReferenceModeDatagram:
+ case ReferenceModeBatchDatagram:
+ {
+ assert(false);
+ return false;
+ }
}
return true;
@@ -232,14 +232,14 @@ IceInternal::Outgoing::abort(const LocalException& ex)
#ifdef ICEE_HAS_BATCH
if(_reference->getMode() == ReferenceModeBatchOneway)
{
- _connection->abortBatchRequest();
-
- //
- // If we abort a batch requests, we cannot retry, because not
- // only the batch request that caused the problem will be
- // aborted, but all other requests in the batch as well.
- //
- throw LocalExceptionWrapper(ex, false);
+ _connection->abortBatchRequest();
+
+ //
+ // If we abort a batch requests, we cannot retry, because not
+ // only the batch request that caused the problem will be
+ // aborted, but all other requests in the batch as well.
+ //
+ throw LocalExceptionWrapper(ex, false);
}
#endif
@@ -257,7 +257,7 @@ IceInternal::Outgoing::finished(BasicStream& is)
//
if(&is != &_stream)
{
- _stream.swap(is);
+ _stream.swap(is);
}
Byte replyStatus;
@@ -265,153 +265,153 @@ IceInternal::Outgoing::finished(BasicStream& is)
switch(replyStatus)
{
- case replyOK:
- {
- //
- // Input and output parameters are always sent in an
- // encapsulation, which makes it possible to forward
- // oneway requests as blobs.
- //
- _stream.startReadEncaps();
- _state = StateOK; // The state must be set last, in case there is an exception.
- break;
- }
-
- case replyUserException:
- {
- //
- // Input and output parameters are always sent in an
- // encapsulation, which makes it possible to forward
- // oneway requests as blobs.
- //
- _stream.startReadEncaps();
- _state = StateUserException; // The state must be set last, in case there is an exception.
- break;
- }
-
- case replyObjectNotExist:
- case replyFacetNotExist:
- case replyOperationNotExist:
- {
- //
- // Don't read the exception members directly into the
- // exception. Otherwise if reading fails and raises an
- // exception, you will have a memory leak.
- //
- Identity ident;
- ident.__read(&_stream);
+ case replyOK:
+ {
+ //
+ // Input and output parameters are always sent in an
+ // encapsulation, which makes it possible to forward
+ // oneway requests as blobs.
+ //
+ _stream.startReadEncaps();
+ _state = StateOK; // The state must be set last, in case there is an exception.
+ break;
+ }
+
+ case replyUserException:
+ {
+ //
+ // Input and output parameters are always sent in an
+ // encapsulation, which makes it possible to forward
+ // oneway requests as blobs.
+ //
+ _stream.startReadEncaps();
+ _state = StateUserException; // The state must be set last, in case there is an exception.
+ break;
+ }
+
+ case replyObjectNotExist:
+ case replyFacetNotExist:
+ case replyOperationNotExist:
+ {
+ //
+ // Don't read the exception members directly into the
+ // exception. Otherwise if reading fails and raises an
+ // exception, you will have a memory leak.
+ //
+ Identity ident;
+ ident.__read(&_stream);
- //
- // For compatibility with the old FacetPath.
- //
- vector<string> facetPath;
- _stream.read(facetPath);
- string facet;
- if(!facetPath.empty())
- {
- if(facetPath.size() > 1)
- {
- throw MarshalException(__FILE__, __LINE__);
- }
- facet.swap(facetPath[0]);
- }
+ //
+ // For compatibility with the old FacetPath.
+ //
+ vector<string> facetPath;
+ _stream.read(facetPath);
+ string facet;
+ if(!facetPath.empty())
+ {
+ if(facetPath.size() > 1)
+ {
+ throw MarshalException(__FILE__, __LINE__);
+ }
+ facet.swap(facetPath[0]);
+ }
- string operation;
- _stream.read(operation, false);
-
- RequestFailedException* ex;
- switch(replyStatus)
- {
- case replyObjectNotExist:
- {
- ex = new ObjectNotExistException(__FILE__, __LINE__);
- break;
- }
-
- case replyFacetNotExist:
- {
- ex = new FacetNotExistException(__FILE__, __LINE__);
- break;
- }
-
- case replyOperationNotExist:
- {
- ex = new OperationNotExistException(__FILE__, __LINE__);
- break;
- }
-
- default:
- {
- ex = 0; // To keep the compiler from complaining.
- assert(false);
- break;
- }
- }
-
- ex->id = ident;
- ex->facet = facet;
- ex->operation = operation;
- _exception.reset(ex);
+ string operation;
+ _stream.read(operation, false);
+
+ RequestFailedException* ex;
+ switch(replyStatus)
+ {
+ case replyObjectNotExist:
+ {
+ ex = new ObjectNotExistException(__FILE__, __LINE__);
+ break;
+ }
+
+ case replyFacetNotExist:
+ {
+ ex = new FacetNotExistException(__FILE__, __LINE__);
+ break;
+ }
+
+ case replyOperationNotExist:
+ {
+ ex = new OperationNotExistException(__FILE__, __LINE__);
+ break;
+ }
+
+ default:
+ {
+ ex = 0; // To keep the compiler from complaining.
+ assert(false);
+ break;
+ }
+ }
+
+ ex->id = ident;
+ ex->facet = facet;
+ ex->operation = operation;
+ _exception.reset(ex);
- _state = StateLocalException; // The state must be set last, in case there is an exception.
- break;
- }
-
- case replyUnknownException:
- case replyUnknownLocalException:
- case replyUnknownUserException:
- {
- //
- // Don't read the exception members directly into the
- // exception. Otherwise if reading fails and raises an
- // exception, you will have a memory leak.
- //
- string unknown;
- _stream.read(unknown, false);
-
- UnknownException* ex;
- switch(replyStatus)
- {
- case replyUnknownException:
- {
- ex = new UnknownException(__FILE__, __LINE__);
- break;
- }
-
- case replyUnknownLocalException:
- {
- ex = new UnknownLocalException(__FILE__, __LINE__);
- break;
- }
-
- case replyUnknownUserException:
- {
- ex = new UnknownUserException(__FILE__, __LINE__);
- break;
- }
-
- default:
- {
- ex = 0; // To keep the compiler from complaining.
- assert(false);
- break;
- }
- }
-
- ex->unknown = unknown;
- _exception.reset(ex);
+ _state = StateLocalException; // The state must be set last, in case there is an exception.
+ break;
+ }
+
+ case replyUnknownException:
+ case replyUnknownLocalException:
+ case replyUnknownUserException:
+ {
+ //
+ // Don't read the exception members directly into the
+ // exception. Otherwise if reading fails and raises an
+ // exception, you will have a memory leak.
+ //
+ string unknown;
+ _stream.read(unknown, false);
+
+ UnknownException* ex;
+ switch(replyStatus)
+ {
+ case replyUnknownException:
+ {
+ ex = new UnknownException(__FILE__, __LINE__);
+ break;
+ }
+
+ case replyUnknownLocalException:
+ {
+ ex = new UnknownLocalException(__FILE__, __LINE__);
+ break;
+ }
+
+ case replyUnknownUserException:
+ {
+ ex = new UnknownUserException(__FILE__, __LINE__);
+ break;
+ }
+
+ default:
+ {
+ ex = 0; // To keep the compiler from complaining.
+ assert(false);
+ break;
+ }
+ }
+
+ ex->unknown = unknown;
+ _exception.reset(ex);
- _state = StateLocalException; // The state must be set last, in case there is an exception.
- break;
- }
-
- default:
- {
- //_exception.reset(new UnknownReplyStatusException(__FILE__, __LINE__));
- _exception.reset(new ProtocolException(__FILE__, __LINE__, "unknown reply status"));
- _state = StateLocalException;
- break;
- }
+ _state = StateLocalException; // The state must be set last, in case there is an exception.
+ break;
+ }
+
+ default:
+ {
+ //_exception.reset(new UnknownReplyStatusException(__FILE__, __LINE__));
+ _exception.reset(new ProtocolException(__FILE__, __LINE__, "unknown reply status"));
+ _state = StateLocalException;
+ break;
+ }
}
}
diff --git a/cppe/src/IceE/OutgoingConnectionFactory.cpp b/cppe/src/IceE/OutgoingConnectionFactory.cpp
index 5c86c452c77..79b3696c73c 100644
--- a/cppe/src/IceE/OutgoingConnectionFactory.cpp
+++ b/cppe/src/IceE/OutgoingConnectionFactory.cpp
@@ -36,18 +36,18 @@ IceInternal::OutgoingConnectionFactory::destroy()
if(_destroyed)
{
- return;
+ return;
}
#ifdef _STLP_BEGIN_NAMESPACE
// voidbind2nd is an STLport extension for broken compilers in IceE/Functional.h
for_each(_connections.begin(), _connections.end(),
- voidbind2nd(Ice::secondVoidMemFun1<EndpointPtr, Connection, Connection::DestructionReason>
- (&Connection::destroy), Connection::CommunicatorDestroyed));
+ voidbind2nd(Ice::secondVoidMemFun1<EndpointPtr, Connection, Connection::DestructionReason>
+ (&Connection::destroy), Connection::CommunicatorDestroyed));
#else
for_each(_connections.begin(), _connections.end(),
- bind2nd(Ice::secondVoidMemFun1<const EndpointPtr, Connection, Connection::DestructionReason>
- (&Connection::destroy), Connection::CommunicatorDestroyed));
+ bind2nd(Ice::secondVoidMemFun1<const EndpointPtr, Connection, Connection::DestructionReason>
+ (&Connection::destroy), Connection::CommunicatorDestroyed));
#endif
_destroyed = true;
@@ -60,27 +60,27 @@ IceInternal::OutgoingConnectionFactory::waitUntilFinished()
multimap<EndpointPtr, ConnectionPtr> connections;
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- //
- // First we wait until the factory is destroyed. We also wait
- // until there are no pending connections anymore. Only then
- // we can be sure the _connections contains all connections.
- //
- while(!_destroyed || !_pending.empty())
- {
- wait();
- }
-
- //
- // We want to wait until all connections are finished outside the
- // thread synchronization.
- //
- connections.swap(_connections);
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ //
+ // First we wait until the factory is destroyed. We also wait
+ // until there are no pending connections anymore. Only then
+ // we can be sure the _connections contains all connections.
+ //
+ while(!_destroyed || !_pending.empty())
+ {
+ wait();
+ }
+
+ //
+ // We want to wait until all connections are finished outside the
+ // thread synchronization.
+ //
+ connections.swap(_connections);
}
for_each(connections.begin(), connections.end(),
- Ice::secondVoidMemFun<const EndpointPtr, Connection>(&Connection::waitUntilFinished));
+ Ice::secondVoidMemFun<const EndpointPtr, Connection>(&Connection::waitUntilFinished));
}
ConnectionPtr
@@ -90,130 +90,130 @@ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpts
vector<EndpointPtr> endpoints = endpts;
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- if(_destroyed)
- {
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
- }
-
- //
- // Reap connections for which destruction has completed.
- //
- std::multimap<EndpointPtr, ConnectionPtr>::iterator p = _connections.begin();
- while(p != _connections.end())
- {
- if(p->second->isFinished())
- {
- _connections.erase(p++);
- }
- else
- {
- ++p;
- }
- }
-
- //
- // Modify endpoints with overrides.
- //
- vector<EndpointPtr>::iterator q;
- for(q = endpoints.begin(); q != endpoints.end(); ++q)
- {
- if(_instance->defaultsAndOverrides()->overrideTimeout)
- {
- *q = (*q)->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue);
- }
- }
-
- //
- // Search for existing connections.
- //
- vector<EndpointPtr>::const_iterator r;
- for(q = endpoints.begin(), r = endpts.begin(); q != endpoints.end(); ++q, ++r)
- {
- pair<multimap<EndpointPtr, ConnectionPtr>::iterator,
- multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(*q);
-
- while(pr.first != pr.second)
- {
- //
- // Don't return connections for which destruction has
- // been initiated.
- //
- if(!pr.first->second->isDestroyed())
- {
- return pr.first->second;
- }
-
- ++pr.first;
- }
- }
-
- //
- // If some other thread is currently trying to establish a
- // connection to any of our endpoints, we wait until this
- // thread is finished.
- //
- bool searchAgain = false;
- while(!_destroyed)
- {
- for(q = endpoints.begin(); q != endpoints.end(); ++q)
- {
- if(_pending.find(*q) != _pending.end())
- {
- break;
- }
- }
-
- if(q == endpoints.end())
- {
- break;
- }
-
- searchAgain = true;
-
- wait();
- }
-
- if(_destroyed)
- {
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
- }
-
- //
- // Search for existing connections again if we waited above,
- // as new connections might have been added in the meantime.
- //
- if(searchAgain)
- {
- for(q = endpoints.begin(), r = endpts.begin(); q != endpoints.end(); ++q, ++r)
- {
- pair<multimap<EndpointPtr, ConnectionPtr>::iterator,
- multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(*q);
-
- while(pr.first != pr.second)
- {
- //
- // Don't return connections for which destruction has
- // been initiated.
- //
- if(!pr.first->second->isDestroyed())
- {
- return pr.first->second;
- }
-
- ++pr.first;
- }
- }
- }
-
- //
- // No connection to any of our endpoints exists yet, so we
- // will try to create one. To avoid that other threads try to
- // create connections to the same endpoints, we add our
- // endpoints to _pending.
- //
- _pending.insert(endpoints.begin(), endpoints.end());
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ if(_destroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+
+ //
+ // Reap connections for which destruction has completed.
+ //
+ std::multimap<EndpointPtr, ConnectionPtr>::iterator p = _connections.begin();
+ while(p != _connections.end())
+ {
+ if(p->second->isFinished())
+ {
+ _connections.erase(p++);
+ }
+ else
+ {
+ ++p;
+ }
+ }
+
+ //
+ // Modify endpoints with overrides.
+ //
+ vector<EndpointPtr>::iterator q;
+ for(q = endpoints.begin(); q != endpoints.end(); ++q)
+ {
+ if(_instance->defaultsAndOverrides()->overrideTimeout)
+ {
+ *q = (*q)->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue);
+ }
+ }
+
+ //
+ // Search for existing connections.
+ //
+ vector<EndpointPtr>::const_iterator r;
+ for(q = endpoints.begin(), r = endpts.begin(); q != endpoints.end(); ++q, ++r)
+ {
+ pair<multimap<EndpointPtr, ConnectionPtr>::iterator,
+ multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(*q);
+
+ while(pr.first != pr.second)
+ {
+ //
+ // Don't return connections for which destruction has
+ // been initiated.
+ //
+ if(!pr.first->second->isDestroyed())
+ {
+ return pr.first->second;
+ }
+
+ ++pr.first;
+ }
+ }
+
+ //
+ // If some other thread is currently trying to establish a
+ // connection to any of our endpoints, we wait until this
+ // thread is finished.
+ //
+ bool searchAgain = false;
+ while(!_destroyed)
+ {
+ for(q = endpoints.begin(); q != endpoints.end(); ++q)
+ {
+ if(_pending.find(*q) != _pending.end())
+ {
+ break;
+ }
+ }
+
+ if(q == endpoints.end())
+ {
+ break;
+ }
+
+ searchAgain = true;
+
+ wait();
+ }
+
+ if(_destroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+
+ //
+ // Search for existing connections again if we waited above,
+ // as new connections might have been added in the meantime.
+ //
+ if(searchAgain)
+ {
+ for(q = endpoints.begin(), r = endpts.begin(); q != endpoints.end(); ++q, ++r)
+ {
+ pair<multimap<EndpointPtr, ConnectionPtr>::iterator,
+ multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(*q);
+
+ while(pr.first != pr.second)
+ {
+ //
+ // Don't return connections for which destruction has
+ // been initiated.
+ //
+ if(!pr.first->second->isDestroyed())
+ {
+ return pr.first->second;
+ }
+
+ ++pr.first;
+ }
+ }
+ }
+
+ //
+ // No connection to any of our endpoints exists yet, so we
+ // will try to create one. To avoid that other threads try to
+ // create connections to the same endpoints, we add our
+ // endpoints to _pending.
+ //
+ _pending.insert(endpoints.begin(), endpoints.end());
}
ConnectionPtr connection;
@@ -223,104 +223,104 @@ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpts
vector<EndpointPtr>::const_iterator r;
for(q = endpoints.begin(), r = endpts.begin(); q != endpoints.end(); ++q, ++r)
{
- EndpointPtr endpoint = *q;
-
- try
- {
- ConnectorPtr connector = endpoint->connector();
- assert(connector);
-
- Int timeout;
- if(_instance->defaultsAndOverrides()->overrideConnectTimeout)
- {
- timeout = _instance->defaultsAndOverrides()->overrideConnectTimeoutValue;
- }
- // It is not necessary to check for overrideTimeout,
- // the endpoint has already been modified with this
- // override, if set.
- else
- {
- timeout = endpoint->timeout();
- }
-
- TransceiverPtr transceiver = connector->connect(timeout);
- assert(transceiver);
+ EndpointPtr endpoint = *q;
+
+ try
+ {
+ ConnectorPtr connector = endpoint->connector();
+ assert(connector);
+
+ Int timeout;
+ if(_instance->defaultsAndOverrides()->overrideConnectTimeout)
+ {
+ timeout = _instance->defaultsAndOverrides()->overrideConnectTimeoutValue;
+ }
+ // It is not necessary to check for overrideTimeout,
+ // the endpoint has already been modified with this
+ // override, if set.
+ else
+ {
+ timeout = endpoint->timeout();
+ }
+
+ TransceiverPtr transceiver = connector->connect(timeout);
+ assert(transceiver);
#ifdef ICEE_PURE_CLIENT
- connection = new Connection(_instance, transceiver, endpoint);
+ connection = new Connection(_instance, transceiver, endpoint);
#else
- connection = new Connection(_instance, transceiver, endpoint, 0);
+ connection = new Connection(_instance, transceiver, endpoint, 0);
#endif
- //
- // Wait for the connection to be validated by the
- // connection thread. Once the connection has been
- // validated it will be activated also.
- //
- connection->waitForValidation();
- break;
- }
- catch(const LocalException& ex)
- {
- exception.reset(dynamic_cast<LocalException*>(ex.ice_clone()));
-
- //
- // If a connection object was constructed, then validate()
- // must have raised the exception.
- //
- if(connection)
- {
- connection->waitUntilFinished(); // We must call waitUntilFinished() for cleanup.
- connection = 0;
- }
- }
-
- TraceLevelsPtr traceLevels = _instance->traceLevels();
- if(traceLevels->retry >= 2)
- {
- Trace out(_instance->initializationData().logger, traceLevels->retryCat);
-
- out << "connection to endpoint failed";
- if(q + 1 != endpoints.end())
- {
- out << ", trying next endpoint\n";
- }
- else
- {
- out << " and no more endpoints to try\n";
- }
- out << (*exception.get()).toString();
- }
+ //
+ // Wait for the connection to be validated by the
+ // connection thread. Once the connection has been
+ // validated it will be activated also.
+ //
+ connection->waitForValidation();
+ break;
+ }
+ catch(const LocalException& ex)
+ {
+ exception.reset(dynamic_cast<LocalException*>(ex.ice_clone()));
+
+ //
+ // If a connection object was constructed, then validate()
+ // must have raised the exception.
+ //
+ if(connection)
+ {
+ connection->waitUntilFinished(); // We must call waitUntilFinished() for cleanup.
+ connection = 0;
+ }
+ }
+
+ TraceLevelsPtr traceLevels = _instance->traceLevels();
+ if(traceLevels->retry >= 2)
+ {
+ Trace out(_instance->initializationData().logger, traceLevels->retryCat);
+
+ out << "connection to endpoint failed";
+ if(q + 1 != endpoints.end())
+ {
+ out << ", trying next endpoint\n";
+ }
+ else
+ {
+ out << " and no more endpoints to try\n";
+ }
+ out << (*exception.get()).toString();
+ }
}
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- //
- // Signal other threads that we are done with trying to
- // establish connections to our endpoints.
- //
- for(q = endpoints.begin(); q != endpoints.end(); ++q)
- {
- _pending.erase(*q);
- }
- notifyAll();
-
- if(!connection)
- {
- assert(exception.get());
- exception->ice_throw();
- }
- else
- {
- _connections.insert(_connections.end(),
- pair<const EndpointPtr, ConnectionPtr>(connection->endpoint(), connection));
-
- if(_destroyed)
- {
- connection->destroy(Connection::CommunicatorDestroyed);
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
- }
- }
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ //
+ // Signal other threads that we are done with trying to
+ // establish connections to our endpoints.
+ //
+ for(q = endpoints.begin(); q != endpoints.end(); ++q)
+ {
+ _pending.erase(*q);
+ }
+ notifyAll();
+
+ if(!connection)
+ {
+ assert(exception.get());
+ exception->ice_throw();
+ }
+ else
+ {
+ _connections.insert(_connections.end(),
+ pair<const EndpointPtr, ConnectionPtr>(connection->endpoint(), connection));
+
+ if(_destroyed)
+ {
+ connection->destroy(Connection::CommunicatorDestroyed);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+ }
}
assert(connection);
@@ -336,7 +336,7 @@ IceInternal::OutgoingConnectionFactory::setRouterInfo(const RouterInfoPtr& route
if(_destroyed)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
assert(routerInfo);
@@ -353,34 +353,34 @@ IceInternal::OutgoingConnectionFactory::setRouterInfo(const RouterInfoPtr& route
vector<EndpointPtr>::const_iterator p;
for(p = endpoints.begin(); p != endpoints.end(); ++p)
{
- EndpointPtr endpoint = *p;
+ EndpointPtr endpoint = *p;
- //
- // Modify endpoints with overrides.
- //
- if(_instance->defaultsAndOverrides()->overrideTimeout)
- {
- endpoint = endpoint->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue);
- }
+ //
+ // Modify endpoints with overrides.
+ //
+ if(_instance->defaultsAndOverrides()->overrideTimeout)
+ {
+ endpoint = endpoint->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue);
+ }
#ifndef ICEE_PURE_CLIENT
- pair<multimap<EndpointPtr, ConnectionPtr>::iterator,
- multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(endpoint);
-
- while(pr.first != pr.second)
- {
- try
- {
- pr.first->second->setAdapter(adapter);
- }
- catch(const Ice::LocalException&)
- {
- //
- // Ignore, the connection is being closed or closed.
- //
- }
- ++pr.first;
- }
+ pair<multimap<EndpointPtr, ConnectionPtr>::iterator,
+ multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(endpoint);
+
+ while(pr.first != pr.second)
+ {
+ try
+ {
+ pr.first->second->setAdapter(adapter);
+ }
+ catch(const Ice::LocalException&)
+ {
+ //
+ // Ignore, the connection is being closed or closed.
+ //
+ }
+ ++pr.first;
+ }
#endif
}
}
@@ -394,26 +394,26 @@ IceInternal::OutgoingConnectionFactory::flushBatchRequests()
list<ConnectionPtr> c;
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- for(std::multimap<EndpointPtr, ConnectionPtr>::const_iterator p = _connections.begin();
- p != _connections.end();
- ++p)
- {
- c.push_back(p->second);
- }
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ for(std::multimap<EndpointPtr, ConnectionPtr>::const_iterator p = _connections.begin();
+ p != _connections.end();
+ ++p)
+ {
+ c.push_back(p->second);
+ }
}
for(list<ConnectionPtr>::const_iterator p = c.begin(); p != c.end(); ++p)
{
- try
- {
- (*p)->flushBatchRequests();
- }
- catch(const LocalException&)
- {
- // Ignore.
- }
+ try
+ {
+ (*p)->flushBatchRequests();
+ }
+ catch(const LocalException&)
+ {
+ // Ignore.
+ }
}
}
#endif
@@ -439,24 +439,24 @@ IceInternal::OutgoingConnectionFactory::removeAdapter(const ObjectAdapterPtr& ad
if(_destroyed)
{
- return;
+ return;
}
for(multimap<EndpointPtr, ConnectionPtr>::const_iterator p = _connections.begin(); p != _connections.end(); ++p)
{
- if(p->second->getAdapter() == adapter)
- {
- try
- {
- p->second->setAdapter(0);
- }
- catch(const Ice::LocalException&)
- {
- //
- // Ignore, the connection is being closed or closed.
- //
- }
- }
+ if(p->second->getAdapter() == adapter)
+ {
+ try
+ {
+ p->second->setAdapter(0);
+ }
+ catch(const Ice::LocalException&)
+ {
+ //
+ // Ignore, the connection is being closed or closed.
+ //
+ }
+ }
}
}
diff --git a/cppe/src/IceE/Properties.cpp b/cppe/src/IceE/Properties.cpp
index 58e439b7046..c9058e2a932 100644
--- a/cppe/src/IceE/Properties.cpp
+++ b/cppe/src/IceE/Properties.cpp
@@ -27,11 +27,11 @@ Ice::Properties::getProperty(const string& key)
map<string, string>::const_iterator p = _properties.find(key);
if(p != _properties.end())
{
- return p->second;
+ return p->second;
}
else
{
- return string();
+ return string();
}
}
@@ -43,11 +43,11 @@ Ice::Properties::getPropertyWithDefault(const string& key, const string& value)
map<string, string>::const_iterator p = _properties.find(key);
if(p != _properties.end())
{
- return p->second;
+ return p->second;
}
else
{
- return value;
+ return value;
}
}
@@ -65,7 +65,7 @@ Ice::Properties::getPropertyAsIntWithDefault(const string& key, Int value)
map<string, string>::const_iterator p = _properties.find(key);
if(p != _properties.end())
{
- value = atoi(p->second.c_str());
+ value = atoi(p->second.c_str());
}
return value;
@@ -94,7 +94,7 @@ Ice::Properties::setProperty(const string& key, const string& value)
{
if(key.empty())
{
- return;
+ return;
}
IceUtil::Mutex::Lock sync(*this);
@@ -104,11 +104,11 @@ Ice::Properties::setProperty(const string& key, const string& value)
//
if(!value.empty())
{
- _properties[key] = value;
+ _properties[key] = value;
}
else
{
- _properties.erase(key);
+ _properties.erase(key);
}
}
@@ -122,7 +122,7 @@ Ice::Properties::getCommandLineOptions()
map<string, string>::const_iterator p;
for(p = _properties.begin(); p != _properties.end(); ++p)
{
- result.push_back("--" + p->first + "=" + p->second);
+ result.push_back("--" + p->first + "=" + p->second);
}
return result;
}
@@ -133,7 +133,7 @@ Ice::Properties::parseCommandLineOptions(const string& prefix, const StringSeq&
string pfx = prefix;
if(!pfx.empty() && pfx[pfx.size() - 1] != '.')
{
- pfx += '.';
+ pfx += '.';
}
pfx = "--" + pfx;
@@ -176,7 +176,7 @@ Ice::Properties::load(const std::string& file)
if(!in)
{
FileException ex(__FILE__, __LINE__);
- ex.path = file;
+ ex.path = file;
ex.error = getSystemErrno();
throw ex;
}
@@ -184,7 +184,7 @@ Ice::Properties::load(const std::string& file)
char line[1024];
while(fgets(line, 1024, in) != NULL)
{
- parseLine(line
+ parseLine(line
#ifdef ICEE_HAS_WSTRING
, _converter
#endif
@@ -226,7 +226,7 @@ Ice::Properties::Properties(StringSeq& args, const PropertiesPtr& defaults
{
if(defaults != 0)
{
- _properties = defaults->getPropertiesForPrefix("");
+ _properties = defaults->getPropertiesForPrefix("");
}
StringSeq::iterator q = args.begin();
@@ -239,7 +239,7 @@ Ice::Properties::Properties(StringSeq& args, const PropertiesPtr& defaults
//
string name = *q;
replace(name.begin(), name.end(), '\\', '/');
- setProperty("Ice.ProgramName", name);
+ setProperty("Ice.ProgramName", name);
}
StringSeq tmp;
@@ -258,27 +258,27 @@ Ice::Properties::Properties(StringSeq& args, const PropertiesPtr& defaults
, 0
#endif
);
- loadConfigFiles = true;
+ loadConfigFiles = true;
}
else
{
- tmp.push_back(s);
+ tmp.push_back(s);
}
- ++q;
+ ++q;
}
args = tmp;
if(!loadConfigFiles)
{
- //
- // If Ice.Config is not set, load from ICE_CONFIG (if set)
- //
- loadConfigFiles = (_properties.find("Ice.Config") == _properties.end());
+ //
+ // If Ice.Config is not set, load from ICE_CONFIG (if set)
+ //
+ loadConfigFiles = (_properties.find("Ice.Config") == _properties.end());
}
if(loadConfigFiles)
{
- loadConfig();
+ loadConfig();
}
args = parseIceCommandLineOptions(args);
@@ -335,7 +335,11 @@ Ice::Properties::parseLine(const string& line
}
string key = IceUtil::trim(s.substr(0, split));
- string value = IceUtil::trim(s.substr(split + 1, s.length() - split - 1));
+ string value;
+ if(split < s.length() - 2)
+ {
+ value = IceUtil::trim(s.substr(split + 1, s.length() - split - 1));
+ }
#ifdef ICEE_HAS_WSTRING
if(converter)
diff --git a/cppe/src/IceE/Protocol.cpp b/cppe/src/IceE/Protocol.cpp
index 12bfd645fb8..309614511ce 100644
--- a/cppe/src/IceE/Protocol.cpp
+++ b/cppe/src/IceE/Protocol.cpp
@@ -12,7 +12,7 @@
namespace IceInternal
{
-const Ice::Byte magic[] = { 0x49, 0x63, 0x65, 0x50 }; // 'I', 'c', 'e', 'P'
+const Ice::Byte magic[] = { 0x49, 0x63, 0x65, 0x50 }; // 'I', 'c', 'e', 'P'
const Ice::Byte requestHdr[] =
{
diff --git a/cppe/src/IceE/Proxy.cpp b/cppe/src/IceE/Proxy.cpp
index 6ba2127a000..af83c170b36 100644
--- a/cppe/src/IceE/Proxy.cpp
+++ b/cppe/src/IceE/Proxy.cpp
@@ -36,8 +36,8 @@ Ice::__write(::IceInternal::BasicStream* __os, const ::Ice::Context& v, ::Ice::_
::Ice::Context::const_iterator p;
for(p = v.begin(); p != v.end(); ++p)
{
- __os->write(p->first);
- __os->write(p->second);
+ __os->write(p->first);
+ __os->write(p->second);
}
}
@@ -48,10 +48,10 @@ Ice::__read(::IceInternal::BasicStream* __is, ::Ice::Context& v, ::Ice::__U__Con
__is->readSize(sz);
while(sz--)
{
- ::std::pair<const ::std::string, ::std::string> pair;
- __is->read(const_cast< ::std::string&>(pair.first));
- ::Ice::Context::iterator __i = v.insert(v.end(), pair);
- __is->read(__i->second);
+ ::std::pair<const ::std::string, ::std::string> pair;
+ __is->read(const_cast< ::std::string&>(pair.first));
+ ::Ice::Context::iterator __i = v.insert(v.end(), pair);
+ __is->read(__i->second);
}
}
@@ -68,23 +68,23 @@ IceInternal::checkedCastImpl(const ObjectPrx& b, const string& f, const string&
if(b)
{
- ObjectPrx bb = b->ice_facet(f);
- try
- {
- if(bb->ice_isA(typeId))
- {
- return bb;
- }
+ ObjectPrx bb = b->ice_facet(f);
+ try
+ {
+ if(bb->ice_isA(typeId))
+ {
+ return bb;
+ }
#ifndef NDEBUG
- else
- {
- assert(typeId != "::Ice::Object");
- }
+ else
+ {
+ assert(typeId != "::Ice::Object");
+ }
#endif
- }
- catch(const FacetNotExistException&)
- {
- }
+ }
+ catch(const FacetNotExistException&)
+ {
+ }
}
return 0;
}
@@ -102,23 +102,23 @@ IceInternal::checkedCastImpl(const ObjectPrx& b, const string& f, const string&
if(b)
{
- ObjectPrx bb = b->ice_facet(f);
- try
- {
- if(bb->ice_isA(typeId, ctx))
- {
- return bb;
- }
+ ObjectPrx bb = b->ice_facet(f);
+ try
+ {
+ if(bb->ice_isA(typeId, ctx))
+ {
+ return bb;
+ }
#ifndef NDEBUG
- else
- {
- assert(typeId != "::Ice::Object");
- }
+ else
+ {
+ assert(typeId != "::Ice::Object");
+ }
#endif
- }
- catch(const FacetNotExistException&)
- {
- }
+ }
+ catch(const FacetNotExistException&)
+ {
+ }
}
return 0;
}
@@ -160,11 +160,11 @@ IceProxy::Ice::Object::ice_isA(const string& __id, const Context* __context)
while(true)
{
ConnectionPtr __connection;
- try
- {
- __checkTwowayOnly("ice_isA");
- static const string __operation("ice_isA");
- __connection = ice_getConnection();
+ try
+ {
+ __checkTwowayOnly("ice_isA");
+ static const string __operation("ice_isA");
+ __connection = ice_getConnection();
Outgoing __og(__connection.get(), _reference.get(), __operation, ::Ice::Nonmutating, __context);
BasicStream* __stream = __og.stream();
try
@@ -181,14 +181,14 @@ IceProxy::Ice::Object::ice_isA(const string& __id, const Context* __context)
{
if(!__ok)
{
- try
- {
+ try
+ {
__stream->throwException();
- }
- catch(const ::Ice::UserException& __ex)
- {
- throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
- }
+ }
+ catch(const ::Ice::UserException& __ex)
+ {
+ throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
+ }
}
__stream->read(__ret);
}
@@ -203,20 +203,20 @@ IceProxy::Ice::Object::ice_isA(const string& __id, const Context* __context)
}
#endif
return __ret;
- }
- catch(const LocalExceptionWrapper& __ex)
- {
- __handleExceptionWrapperRelaxed(__connection, __ex, __cnt);
- }
- catch(const LocalException& __ex)
- {
- __handleException(__connection, __ex, __cnt);
- }
+ }
+ catch(const LocalExceptionWrapper& __ex)
+ {
+ __handleExceptionWrapperRelaxed(__connection, __ex, __cnt);
+ }
+ catch(const LocalException& __ex)
+ {
+ __handleException(__connection, __ex, __cnt);
+ }
#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug.
- catch(...)
- {
- throw;
- }
+ catch(...)
+ {
+ throw;
+ }
#endif
}
}
@@ -228,10 +228,10 @@ IceProxy::Ice::Object::ice_ping(const Context* __context)
while(true)
{
ConnectionPtr __connection;
- try
- {
+ try
+ {
static const string __operation("ice_ping");
- __connection = ice_getConnection();
+ __connection = ice_getConnection();
Outgoing __og(__connection.get(), _reference.get(), __operation, ::Ice::Nonmutating, __context);
bool __ok = __og.invoke();
try
@@ -239,14 +239,14 @@ IceProxy::Ice::Object::ice_ping(const Context* __context)
BasicStream* __is = __og.stream();
if(!__ok)
{
- try
- {
+ try
+ {
__is->throwException();
- }
- catch(const ::Ice::UserException& __ex)
- {
- throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
- }
+ }
+ catch(const ::Ice::UserException& __ex)
+ {
+ throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
+ }
}
}
catch(const ::Ice::LocalException& __ex)
@@ -259,21 +259,21 @@ IceProxy::Ice::Object::ice_ping(const Context* __context)
throw;
}
#endif
- return;
- }
- catch(const LocalExceptionWrapper& __ex)
- {
- __handleExceptionWrapperRelaxed(__connection, __ex, __cnt);
- }
- catch(const LocalException& __ex)
- {
- __handleException(__connection, __ex, __cnt);
- }
+ return;
+ }
+ catch(const LocalExceptionWrapper& __ex)
+ {
+ __handleExceptionWrapperRelaxed(__connection, __ex, __cnt);
+ }
+ catch(const LocalException& __ex)
+ {
+ __handleException(__connection, __ex, __cnt);
+ }
#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug.
- catch(...)
- {
- throw;
- }
+ catch(...)
+ {
+ throw;
+ }
#endif
}
}
@@ -285,11 +285,11 @@ IceProxy::Ice::Object::ice_ids(const Context* __context)
while(true)
{
ConnectionPtr __connection;
- try
- {
- __checkTwowayOnly("ice_ids");
+ try
+ {
+ __checkTwowayOnly("ice_ids");
static const string __operation("ice_ids");
- __connection = ice_getConnection();
+ __connection = ice_getConnection();
Outgoing __og(__connection.get(), _reference.get(), __operation, ::Ice::Nonmutating, __context);
vector<string> __ret;
bool __ok = __og.invoke();
@@ -298,14 +298,14 @@ IceProxy::Ice::Object::ice_ids(const Context* __context)
BasicStream* __is = __og.stream();
if(!__ok)
{
- try
- {
+ try
+ {
__is->throwException();
- }
- catch(const ::Ice::UserException& __ex)
- {
- throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
- }
+ }
+ catch(const ::Ice::UserException& __ex)
+ {
+ throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
+ }
}
__is->read(__ret, false);
}
@@ -320,20 +320,20 @@ IceProxy::Ice::Object::ice_ids(const Context* __context)
}
#endif
return __ret;
- }
- catch(const LocalExceptionWrapper& __ex)
- {
- __handleExceptionWrapperRelaxed(__connection, __ex, __cnt);
- }
- catch(const LocalException& __ex)
- {
- __handleException(__connection, __ex, __cnt);
- }
+ }
+ catch(const LocalExceptionWrapper& __ex)
+ {
+ __handleExceptionWrapperRelaxed(__connection, __ex, __cnt);
+ }
+ catch(const LocalException& __ex)
+ {
+ __handleException(__connection, __ex, __cnt);
+ }
#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug.
- catch(...)
- {
- throw;
- }
+ catch(...)
+ {
+ throw;
+ }
#endif
}
}
@@ -345,11 +345,11 @@ IceProxy::Ice::Object::ice_id(const Context* __context)
while(true)
{
ConnectionPtr __connection;
- try
- {
- __checkTwowayOnly("ice_id");
+ try
+ {
+ __checkTwowayOnly("ice_id");
static const string __operation("ice_id");
- __connection = ice_getConnection();
+ __connection = ice_getConnection();
Outgoing __og(__connection.get(), _reference.get(), __operation, ::Ice::Nonmutating, __context);
string __ret;
bool __ok = __og.invoke();
@@ -358,14 +358,14 @@ IceProxy::Ice::Object::ice_id(const Context* __context)
BasicStream* __is = __og.stream();
if(!__ok)
{
- try
- {
+ try
+ {
__is->throwException();
- }
- catch(const ::Ice::UserException& __ex)
- {
- throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
- }
+ }
+ catch(const ::Ice::UserException& __ex)
+ {
+ throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
+ }
}
__is->read(__ret, false);
}
@@ -380,20 +380,20 @@ IceProxy::Ice::Object::ice_id(const Context* __context)
}
#endif
return __ret;
- }
- catch(const LocalExceptionWrapper& __ex)
- {
- __handleExceptionWrapperRelaxed(__connection, __ex, __cnt);
- }
- catch(const LocalException& __ex)
- {
- __handleException(__connection, __ex, __cnt);
- }
+ }
+ catch(const LocalExceptionWrapper& __ex)
+ {
+ __handleExceptionWrapperRelaxed(__connection, __ex, __cnt);
+ }
+ catch(const LocalException& __ex)
+ {
+ __handleException(__connection, __ex, __cnt);
+ }
#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug.
- catch(...)
- {
- throw;
- }
+ catch(...)
+ {
+ throw;
+ }
#endif
}
}
@@ -427,13 +427,13 @@ IceProxy::Ice::Object::ice_identity(const Identity& newIdentity) const
}
if(newIdentity == _reference->getIdentity())
{
- return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
+ return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
}
else
{
- ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(_reference->changeIdentity(newIdentity));
- return proxy;
+ ObjectPrx proxy(new ::IceProxy::Ice::Object());
+ proxy->setup(_reference->changeIdentity(newIdentity));
+ return proxy;
}
}
@@ -448,13 +448,13 @@ IceProxy::Ice::Object::ice_facet(const string& newFacet) const
{
if(newFacet == _reference->getFacet())
{
- return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
+ return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
}
else
{
- ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(_reference->changeFacet(newFacet));
- return proxy;
+ ObjectPrx proxy(new ::IceProxy::Ice::Object());
+ proxy->setup(_reference->changeFacet(newFacet));
+ return proxy;
}
}
@@ -473,13 +473,13 @@ IceProxy::Ice::Object::ice_router(const RouterPrx& router) const
ReferencePtr ref = _reference->changeRouter(router);
if(ref == _reference)
{
- return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
+ return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
}
else
{
- ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref);
- return proxy;
+ ObjectPrx proxy(new ::IceProxy::Ice::Object());
+ proxy->setup(ref);
+ return proxy;
}
}
@@ -499,13 +499,13 @@ IceProxy::Ice::Object::ice_adapterId(const string& adapterId) const
ReferencePtr ref = _reference->changeAdapterId(adapterId);
if(ref == _reference)
{
- return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
+ return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
}
else
{
- ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref);
- return proxy;
+ ObjectPrx proxy(new ::IceProxy::Ice::Object());
+ proxy->setup(ref);
+ return proxy;
}
}
@@ -522,13 +522,13 @@ IceProxy::Ice::Object::ice_locator(const LocatorPrx& locator) const
ReferencePtr ref = _reference->changeLocator(locator);
if(ref == _reference)
{
- return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
+ return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
}
else
{
- ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref);
- return proxy;
+ ObjectPrx proxy(new ::IceProxy::Ice::Object());
+ proxy->setup(ref);
+ return proxy;
}
}
@@ -561,13 +561,13 @@ IceProxy::Ice::Object::ice_timeout(int t) const
ReferencePtr ref = _reference->changeTimeout(t);
if(ref == _reference)
{
- return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
+ return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
}
else
{
- ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref);
- return proxy;
+ ObjectPrx proxy(new ::IceProxy::Ice::Object());
+ proxy->setup(ref);
+ return proxy;
}
}
@@ -610,10 +610,10 @@ IceProxy::Ice::Object::__copyFrom(const ObjectPrx& from)
ConnectionPtr con;
{
- ::IceUtil::Mutex::Lock sync(*from.get());
+ ::IceUtil::Mutex::Lock sync(*from.get());
- ref = from->_reference;
- con = from->_connection;
+ ref = from->_reference;
+ con = from->_connection;
}
//
@@ -645,13 +645,13 @@ IceProxy::Ice::Object::__handleException(const ConnectionPtr& connection, const
ProxyFactoryPtr proxyFactory = _reference->getInstance()->proxyFactory();
if(proxyFactory)
{
- proxyFactory->checkRetryAfterException(ex, _reference, cnt);
+ proxyFactory->checkRetryAfterException(ex, _reference, cnt);
}
else
{
- //
- // The communicator is already destroyed, so we cannot retry.
- //
+ //
+ // The communicator is already destroyed, so we cannot retry.
+ //
ex.ice_throw();
}
}
@@ -703,8 +703,8 @@ IceProxy::Ice::Object::__checkTwowayOnly(const char* name) const
if(!ice_isTwoway())
{
TwowayOnlyException ex(__FILE__, __LINE__);
- ex.operation = name;
- throw ex;
+ ex.operation = name;
+ throw ex;
}
}
@@ -719,13 +719,13 @@ IceProxy::Ice::Object::changeMode(ReferenceMode newMode) const
{
if(_reference->getMode() == newMode)
{
- return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
+ return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this));
}
else
{
- ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(_reference->changeMode(newMode));
- return proxy;
+ ObjectPrx proxy(new ::IceProxy::Ice::Object());
+ proxy->setup(_reference->changeMode(newMode));
+ return proxy;
}
}
@@ -734,19 +734,19 @@ Ice::proxyIdentityLess(const ObjectPrx& lhs, const ObjectPrx& rhs)
{
if(!lhs && !rhs)
{
- return false;
+ return false;
}
else if(!lhs && rhs)
{
- return true;
+ return true;
}
else if(lhs && !rhs)
{
- return false;
+ return false;
}
else
{
- return lhs->ice_getIdentity() < rhs->ice_getIdentity();
+ return lhs->ice_getIdentity() < rhs->ice_getIdentity();
}
}
@@ -755,19 +755,19 @@ Ice::proxyIdentityEqual(const ObjectPrx& lhs, const ObjectPrx& rhs)
{
if(!lhs && !rhs)
{
- return true;
+ return true;
}
else if(!lhs && rhs)
{
- return false;
+ return false;
}
else if(lhs && !rhs)
{
- return false;
+ return false;
}
else
{
- return lhs->ice_getIdentity() == rhs->ice_getIdentity();
+ return lhs->ice_getIdentity() == rhs->ice_getIdentity();
}
}
@@ -776,43 +776,43 @@ Ice::proxyIdentityAndFacetLess(const ObjectPrx& lhs, const ObjectPrx& rhs)
{
if(!lhs && !rhs)
{
- return false;
+ return false;
}
else if(!lhs && rhs)
{
- return true;
+ return true;
}
else if(lhs && !rhs)
{
- return false;
+ return false;
}
else
{
- Identity lhsIdentity = lhs->ice_getIdentity();
- Identity rhsIdentity = rhs->ice_getIdentity();
-
- if(lhsIdentity < rhsIdentity)
- {
- return true;
- }
- else if(rhsIdentity < lhsIdentity)
- {
- return false;
- }
-
- string lhsFacet = lhs->ice_getFacet();
- string rhsFacet = rhs->ice_getFacet();
-
- if(lhsFacet < rhsFacet)
- {
- return true;
- }
- else if(rhsFacet < lhsFacet)
- {
- return false;
- }
-
- return false;
+ Identity lhsIdentity = lhs->ice_getIdentity();
+ Identity rhsIdentity = rhs->ice_getIdentity();
+
+ if(lhsIdentity < rhsIdentity)
+ {
+ return true;
+ }
+ else if(rhsIdentity < lhsIdentity)
+ {
+ return false;
+ }
+
+ string lhsFacet = lhs->ice_getFacet();
+ string rhsFacet = rhs->ice_getFacet();
+
+ if(lhsFacet < rhsFacet)
+ {
+ return true;
+ }
+ else if(rhsFacet < lhsFacet)
+ {
+ return false;
+ }
+
+ return false;
}
}
@@ -821,32 +821,32 @@ Ice::proxyIdentityAndFacetEqual(const ObjectPrx& lhs, const ObjectPrx& rhs)
{
if(!lhs && !rhs)
{
- return true;
+ return true;
}
else if(!lhs && rhs)
{
- return false;
+ return false;
}
else if(lhs && !rhs)
{
- return false;
+ return false;
}
else
{
- Identity lhsIdentity = lhs->ice_getIdentity();
- Identity rhsIdentity = rhs->ice_getIdentity();
-
- if(lhsIdentity == rhsIdentity)
- {
- string lhsFacet = lhs->ice_getFacet();
- string rhsFacet = rhs->ice_getFacet();
-
- if(lhsFacet == rhsFacet)
- {
- return true;
- }
- }
-
- return false;
+ Identity lhsIdentity = lhs->ice_getIdentity();
+ Identity rhsIdentity = rhs->ice_getIdentity();
+
+ if(lhsIdentity == rhsIdentity)
+ {
+ string lhsFacet = lhs->ice_getFacet();
+ string rhsFacet = rhs->ice_getFacet();
+
+ if(lhsFacet == rhsFacet)
+ {
+ return true;
+ }
+ }
+
+ return false;
}
}
diff --git a/cppe/src/IceE/ProxyFactory.cpp b/cppe/src/IceE/ProxyFactory.cpp
index 564f40ec857..3ca7b7a2d23 100644
--- a/cppe/src/IceE/ProxyFactory.cpp
+++ b/cppe/src/IceE/ProxyFactory.cpp
@@ -39,11 +39,11 @@ IceInternal::ProxyFactory::proxyToString(const ObjectPrx& proxy) const
{
if(proxy)
{
- return proxy->__reference()->toString();
+ return proxy->__reference()->toString();
}
else
{
- return "";
+ return "";
}
}
@@ -69,13 +69,13 @@ IceInternal::ProxyFactory::proxyToStream(const ObjectPrx& proxy, BasicStream* s)
{
if(proxy)
{
- proxy->__reference()->getIdentity().__write(s);
- proxy->__reference()->streamWrite(s);
+ proxy->__reference()->getIdentity().__write(s);
+ proxy->__reference()->streamWrite(s);
}
else
{
- Identity ident;
- ident.__write(s);
+ Identity ident;
+ ident.__write(s);
}
}
@@ -105,15 +105,15 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co
if(one)
{
#ifdef ICEE_HAS_LOCATOR
- LocatorInfoPtr li = ref->getLocatorInfo();
- if(li)
- {
- //
- // We retry ObjectNotExistException if the reference is indirect.
- //
- li->clearObjectCache(IndirectReferencePtr::dynamicCast(ref));
- }
- else
+ LocatorInfoPtr li = ref->getLocatorInfo();
+ if(li)
+ {
+ //
+ // We retry ObjectNotExistException if the reference is indirect.
+ //
+ li->clearObjectCache(IndirectReferencePtr::dynamicCast(ref));
+ }
+ else
#endif
#ifdef ICEE_HAS_ROUTER
if(ref->getRouterInfo() && one->operation == "ice_add_proxy")
@@ -133,14 +133,14 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co
}
return; // We must always retry, so we don't look at the retry count.
}
- else
+ else
#endif
- {
- //
- // For all other cases, we don't retry ObjectNotExistException
- //
- ex.ice_throw();
- }
+ {
+ //
+ // For all other cases, we don't retry ObjectNotExistException
+ //
+ ex.ice_throw();
+ }
}
else
#endif
@@ -150,7 +150,7 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co
// We don't retry other *NotExistException, which are all
// derived from RequestFailedException.
//
- ex.ice_throw();
+ ex.ice_throw();
}
//
@@ -177,7 +177,7 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co
//
if(dynamic_cast<const MarshalException*>(&ex))
{
- ex.ice_throw();
+ ex.ice_throw();
}
++cnt;
@@ -225,41 +225,41 @@ IceInternal::ProxyFactory::ProxyFactory(const InstancePtr& instance) :
while(true)
{
- const string delim = " \t";
+ const string delim = " \t";
- beg = str.find_first_not_of(delim, end);
- if(beg == string::npos)
- {
- if(_retryIntervals.empty())
- {
- _retryIntervals.push_back(0);
- }
- break;
- }
+ beg = str.find_first_not_of(delim, end);
+ if(beg == string::npos)
+ {
+ if(_retryIntervals.empty())
+ {
+ _retryIntervals.push_back(0);
+ }
+ break;
+ }
- end = str.find_first_of(delim, beg);
- if(end == string::npos)
- {
- end = str.length();
- }
-
- if(beg == end)
- {
- break;
- }
+ end = str.find_first_of(delim, beg);
+ if(end == string::npos)
+ {
+ end = str.length();
+ }
+
+ if(beg == end)
+ {
+ break;
+ }
- string value = str.substr(beg, end - beg);
- int v = atoi(value.c_str());
+ string value = str.substr(beg, end - beg);
+ int v = atoi(value.c_str());
- //
- // If -1 is the first value, no retry and wait intervals.
- //
- if(v == -1 && _retryIntervals.empty())
- {
- break;
- }
+ //
+ // If -1 is the first value, no retry and wait intervals.
+ //
+ if(v == -1 && _retryIntervals.empty())
+ {
+ break;
+ }
- _retryIntervals.push_back(v > 0 ? v : 0);
+ _retryIntervals.push_back(v > 0 ? v : 0);
}
}
diff --git a/cppe/src/IceE/RecMutex.cpp b/cppe/src/IceE/RecMutex.cpp
index 28528f31c4e..bf526d2b8a4 100644
--- a/cppe/src/IceE/RecMutex.cpp
+++ b/cppe/src/IceE/RecMutex.cpp
@@ -34,7 +34,7 @@ IceUtil::RecMutex::lock() const
EnterCriticalSection(&_mutex);
if(++_count > 1)
{
- LeaveCriticalSection(&_mutex);
+ LeaveCriticalSection(&_mutex);
}
}
@@ -43,11 +43,11 @@ IceUtil::RecMutex::tryLock() const
{
if(!TryEnterCriticalSection(&_mutex))
{
- return false;
+ return false;
}
if(++_count > 1)
{
- LeaveCriticalSection(&_mutex);
+ LeaveCriticalSection(&_mutex);
}
return true;
}
@@ -57,7 +57,7 @@ IceUtil::RecMutex::unlock() const
{
if(--_count == 0)
{
- LeaveCriticalSection(&_mutex);
+ LeaveCriticalSection(&_mutex);
}
}
@@ -84,7 +84,7 @@ IceUtil::RecMutex::RecMutex() :
_mutex = CreateMutex(0, false, 0);
if(_mutex == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -94,7 +94,7 @@ IceUtil::RecMutex::~RecMutex()
BOOL rc = CloseHandle(_mutex);
if(rc == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -104,23 +104,23 @@ IceUtil::RecMutex::lock() const
DWORD rc = WaitForSingleObject(_mutex, INFINITE);
if(rc != WAIT_OBJECT_0)
{
- if(rc == WAIT_FAILED)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
- }
- else
- {
- throw ThreadSyscallException(__FILE__, __LINE__, 0);
- }
+ if(rc == WAIT_FAILED)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ }
+ else
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, 0);
+ }
}
if(++_count > 1)
{
- BOOL rc2 = ReleaseMutex(_mutex);
- if(rc2 == 0)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
- }
+ BOOL rc2 = ReleaseMutex(_mutex);
+ if(rc2 == 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ }
}
}
@@ -130,15 +130,15 @@ IceUtil::RecMutex::tryLock() const
DWORD rc = WaitForSingleObject(_mutex, 0);
if(rc != WAIT_OBJECT_0)
{
- return false;
+ return false;
}
if(++_count > 1)
{
- BOOL rc2 = ReleaseMutex(_mutex);
- if(rc2 == 0)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
- }
+ BOOL rc2 = ReleaseMutex(_mutex);
+ if(rc2 == 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ }
}
return true;
}
@@ -148,11 +148,11 @@ IceUtil::RecMutex::unlock() const
{
if(--_count == 0)
{
- BOOL rc = ReleaseMutex(_mutex);
- if(rc == 0)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
- }
+ BOOL rc = ReleaseMutex(_mutex);
+ if(rc == 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ }
}
}
@@ -164,7 +164,7 @@ IceUtil::RecMutex::unlock(LockState& state) const
BOOL rc = ReleaseMutex(_mutex);
if(rc == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -174,14 +174,14 @@ IceUtil::RecMutex::lock(LockState& state) const
DWORD rc = WaitForSingleObject(_mutex, INFINITE);
if(rc != WAIT_OBJECT_0)
{
- if(rc == WAIT_FAILED)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
- }
- else
- {
- throw ThreadSyscallException(__FILE__, __LINE__, 0);
- }
+ if(rc == WAIT_FAILED)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ }
+ else
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, 0);
+ }
}
_count = state.count;
@@ -203,19 +203,19 @@ IceUtil::RecMutex::RecMutex() :
rc = pthread_mutexattr_init(&attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
#endif
rc = pthread_mutex_init(&_mutex, &attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
#if defined(__linux) && !defined(__USE_UNIX98)
@@ -224,7 +224,7 @@ IceUtil::RecMutex::RecMutex() :
rc = pthread_mutexattr_destroy(&attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
#endif
}
@@ -243,12 +243,12 @@ IceUtil::RecMutex::lock() const
int rc = pthread_mutex_lock(&_mutex);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
if(++_count > 1)
{
- rc = pthread_mutex_unlock(&_mutex);
- assert(rc == 0);
+ rc = pthread_mutex_unlock(&_mutex);
+ assert(rc == 0);
}
}
@@ -259,18 +259,18 @@ IceUtil::RecMutex::tryLock() const
bool result = (rc == 0);
if(!result)
{
- if(rc != EBUSY)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
+ if(rc != EBUSY)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
}
else if(++_count > 1)
{
- rc = pthread_mutex_unlock(&_mutex);
- if(rc != 0)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
+ rc = pthread_mutex_unlock(&_mutex);
+ if(rc != 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
}
return result;
}
@@ -280,9 +280,9 @@ IceUtil::RecMutex::unlock() const
{
if(--_count == 0)
{
- int rc = 0; // Prevent warnings when NDEBUG is defined.
- rc = pthread_mutex_unlock(&_mutex);
- assert(rc == 0);
+ int rc = 0; // Prevent warnings when NDEBUG is defined.
+ rc = pthread_mutex_unlock(&_mutex);
+ assert(rc == 0);
}
}
diff --git a/cppe/src/IceE/Reference.cpp b/cppe/src/IceE/Reference.cpp
index 1b10d06a667..1d780684b61 100644
--- a/cppe/src/IceE/Reference.cpp
+++ b/cppe/src/IceE/Reference.cpp
@@ -78,7 +78,7 @@ IceInternal::Reference::changeMode(ReferenceMode newMode) const
{
if(newMode == _mode)
{
- return ReferencePtr(const_cast<Reference*>(this));
+ return ReferencePtr(const_cast<Reference*>(this));
}
ReferencePtr r = _instance->referenceFactory()->copy(this);
r->_mode = newMode;
@@ -90,7 +90,7 @@ IceInternal::Reference::changeSecure(bool newSecure) const
{
if(newSecure == _secure)
{
- return ReferencePtr(const_cast<Reference*>(this));
+ return ReferencePtr(const_cast<Reference*>(this));
}
ReferencePtr r = _instance->referenceFactory()->copy(this);
r->_secure = newSecure;
@@ -102,7 +102,7 @@ IceInternal::Reference::changeIdentity(const Identity& newIdentity) const
{
if(newIdentity == _identity)
{
- return ReferencePtr(const_cast<Reference*>(this));
+ return ReferencePtr(const_cast<Reference*>(this));
}
ReferencePtr r = _instance->referenceFactory()->copy(this);
r->_identity = newIdentity;
@@ -114,7 +114,7 @@ IceInternal::Reference::changeFacet(const string& newFacet) const
{
if(newFacet == _facet)
{
- return ReferencePtr(const_cast<Reference*>(this));
+ return ReferencePtr(const_cast<Reference*>(this));
}
ReferencePtr r = _instance->referenceFactory()->copy(this);
r->_facet = newFacet;
@@ -126,7 +126,7 @@ IceInternal::Reference::changeTimeout(int newTimeout) const
{
if(_overrideTimeout && newTimeout == _timeout)
{
- return ReferencePtr(const_cast<Reference*>(this));
+ return ReferencePtr(const_cast<Reference*>(this));
}
ReferencePtr r = getInstance()->referenceFactory()->copy(this);
r->_timeout = newTimeout;
@@ -161,19 +161,19 @@ Reference::hash() const
for(q = _context.begin(); q != _context.end(); ++q)
{
- for(p = q->first.begin(); p != q->first.end(); ++p)
- {
- h = 5 * h + *p;
- }
- for(p = q->second.begin(); p != q->second.end(); ++p)
- {
- h = 5 * h + *p;
- }
+ for(p = q->first.begin(); p != q->first.end(); ++p)
+ {
+ h = 5 * h + *p;
+ }
+ for(p = q->second.begin(); p != q->second.end(); ++p)
+ {
+ h = 5 * h + *p;
+ }
}
for(p = _facet.begin(); p != _facet.end(); ++p)
{
- h = 5 * h + *p;
+ h = 5 * h + *p;
}
h = 5 * h + static_cast<Int>(getSecure());
@@ -197,11 +197,11 @@ IceInternal::Reference::streamWrite(BasicStream* s) const
//
if(_facet.empty())
{
- s->write(static_cast<string*>(0), static_cast<string*>(0));
+ s->write(static_cast<string*>(0), static_cast<string*>(0));
}
else
{
- s->write(&_facet, &_facet + 1);
+ s->write(&_facet, &_facet + 1);
}
s->write(static_cast<Byte>(_mode));
@@ -225,7 +225,7 @@ IceInternal::Reference::toString() const
if(id.find_first_of(" :@") != string::npos)
{
s += "\"";
- s += id;
+ s += id;
s += "\"";
}
else
@@ -237,11 +237,11 @@ IceInternal::Reference::toString() const
{
s += " -f ";
- //
- // If the encoded facet string contains characters which
- // the reference parser uses as separators, then we enclose
- // the facet string in quotes.
- //
+ //
+ // If the encoded facet string contains characters which
+ // the reference parser uses as separators, then we enclose
+ // the facet string in quotes.
+ //
string fs = _facet;
#ifdef ICEE_HAS_WSTRING
if(_instance->initializationData().stringConverter)
@@ -252,55 +252,55 @@ IceInternal::Reference::toString() const
fs = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer());
}
#endif
- fs = IceUtil::escapeString(fs, "");
- if(fs.find_first_of(" :@") != string::npos)
- {
+ fs = IceUtil::escapeString(fs, "");
+ if(fs.find_first_of(" :@") != string::npos)
+ {
s += "\"";
- s += fs;
+ s += fs;
s += "\"";
- }
- else
- {
- s += fs;
- }
+ }
+ else
+ {
+ s += fs;
+ }
}
switch(_mode)
{
- case ReferenceModeTwoway:
- {
- s += " -t";
- break;
- }
-
- case ReferenceModeOneway:
- {
- s += " -o";
- break;
- }
-
- case ReferenceModeBatchOneway:
- {
- s += " -O";
- break;
- }
-
- case ReferenceModeDatagram:
- {
- s += " -d";
- break;
- }
-
- case ReferenceModeBatchDatagram:
- {
- s += " -D";
- break;
- }
+ case ReferenceModeTwoway:
+ {
+ s += " -t";
+ break;
+ }
+
+ case ReferenceModeOneway:
+ {
+ s += " -o";
+ break;
+ }
+
+ case ReferenceModeBatchOneway:
+ {
+ s += " -O";
+ break;
+ }
+
+ case ReferenceModeDatagram:
+ {
+ s += " -d";
+ break;
+ }
+
+ case ReferenceModeBatchDatagram:
+ {
+ s += " -D";
+ break;
+ }
}
if(getSecure())
{
- s += " -s";
+ s += " -s";
}
return s;
@@ -317,37 +317,37 @@ IceInternal::Reference::operator==(const Reference& r) const
if(getType() != r.getType())
{
- return false;
+ return false;
}
if(_mode != r._mode)
{
- return false;
+ return false;
}
if(_secure != r._secure)
{
- return false;
+ return false;
}
if(_identity != r._identity)
{
- return false;
+ return false;
}
if(_context != r._context)
{
- return false;
+ return false;
}
if(_facet != r._facet)
{
- return false;
+ return false;
}
if(_overrideTimeout != r._overrideTimeout || _overrideTimeout && _timeout != r._timeout)
{
- return false;
+ return false;
}
return true;
@@ -362,83 +362,83 @@ IceInternal::Reference::operator<(const Reference& r) const
if(_mode < r._mode)
{
- return true;
+ return true;
}
else if(r._mode < _mode)
{
- return false;
+ return false;
}
if(!_secure && r._secure)
{
- return true;
+ return true;
}
else if(r._secure < _secure)
{
- return false;
+ return false;
}
if(_identity < r._identity)
{
- return true;
+ return true;
}
else if(r._identity < _identity)
{
- return false;
+ return false;
}
if(_context < r._context)
{
- return true;
+ return true;
}
else if(r._context < _context)
{
- return false;
+ return false;
}
if(_facet < r._facet)
{
- return true;
+ return true;
}
else if(r._facet < _facet)
{
- return false;
+ return false;
}
if(!_overrideTimeout && r._overrideTimeout)
{
- return true;
+ return true;
}
else if(r._overrideTimeout < _overrideTimeout)
{
- return false;
+ return false;
}
else if(_overrideTimeout)
{
- if(_timeout < r._timeout)
- {
- return true;
- }
- else if(r._timeout < _timeout)
- {
- return false;
- }
+ if(_timeout < r._timeout)
+ {
+ return true;
+ }
+ else if(r._timeout < _timeout)
+ {
+ return false;
+ }
}
if(getType() < r.getType())
{
- return true;
+ return true;
}
else if(r.getType() < getType())
{
- return false;
+ return false;
}
return false;
}
IceInternal::Reference::Reference(const InstancePtr& inst, const CommunicatorPtr& com, const Identity& ident,
- const Context& context, const string& fs, ReferenceMode md, bool sec) :
+ const Context& context, const string& fs, ReferenceMode md, bool sec) :
_hashInitialized(false),
_instance(inst),
_communicator(com),
@@ -474,18 +474,18 @@ IceInternal::Reference::applyOverrides(vector<EndpointPtr>& endpts) const
//
for(vector<EndpointPtr>::iterator p = endpts.begin(); p != endpts.end(); ++p)
{
- if(_overrideTimeout)
- {
- *p = (*p)->timeout(_timeout);
- }
+ if(_overrideTimeout)
+ {
+ *p = (*p)->timeout(_timeout);
+ }
}
}
IceUtil::Shared* IceInternal::upCast(IceInternal::FixedReference* p) { return p; }
IceInternal::FixedReference::FixedReference(const InstancePtr& inst, const CommunicatorPtr& com, const Identity& ident,
- const Context& context, const string& fs, ReferenceMode md,
- const vector<ConnectionPtr>& fixedConns) :
+ const Context& context, const string& fs, ReferenceMode md,
+ const vector<ConnectionPtr>& fixedConns) :
Reference(inst, com, ident, context, fs, md, false),
_fixedConnections(fixedConns)
{
@@ -594,9 +594,9 @@ IceInternal::FixedReference::getConnection() const
#ifndef ICEE_HAS_BATCH
case ReferenceModeBatchDatagram:
case ReferenceModeBatchOneway:
- {
- throw FeatureNotSupportedException(__FILE__, __LINE__, "batch proxy mode");
- }
+ {
+ throw FeatureNotSupportedException(__FILE__, __LINE__, "batch proxy mode");
+ }
#endif
}
@@ -619,28 +619,28 @@ IceInternal::FixedReference::getConnection() const
vector<ConnectionPtr> secureConnections;
while(p != connections.end())
{
- if((*p)->endpoint()->secure())
- {
- secureConnections.push_back(*p);
- p = connections.erase(p);
- }
- else
- {
- ++p;
- }
+ if((*p)->endpoint()->secure())
+ {
+ secureConnections.push_back(*p);
+ p = connections.erase(p);
+ }
+ else
+ {
+ ++p;
+ }
}
if(getSecure())
{
- connections.swap(secureConnections);
+ connections.swap(secureConnections);
}
else
{
- connections.insert(connections.end(), secureConnections.begin(), secureConnections.end());
+ connections.insert(connections.end(), secureConnections.begin(), secureConnections.end());
}
if(connections.empty())
{
- throw NoEndpointException(__FILE__, __LINE__); // No stringified representation for fixed proxies.
+ throw NoEndpointException(__FILE__, __LINE__); // No stringified representation for fixed proxies.
}
ConnectionPtr connection = connections[0];
@@ -680,7 +680,7 @@ IceInternal::FixedReference::operator<(const Reference& r) const
{
const FixedReference* rhs = dynamic_cast<const FixedReference*>(&r);
assert(rhs);
- return _fixedConnections < rhs->_fixedConnections;
+ return _fixedConnections < rhs->_fixedConnections;
}
return false;
}
@@ -706,10 +706,10 @@ IceInternal::RoutableReference::getRoutedEndpoints() const
if(_routerInfo)
{
//
- // If we route, we send everything to the router's client
- // proxy endpoints.
- //
- return _routerInfo->getClientEndpoints();
+ // If we route, we send everything to the router's client
+ // proxy endpoints.
+ //
+ return _routerInfo->getClientEndpoints();
}
return vector<EndpointPtr>();
}
@@ -720,7 +720,7 @@ IceInternal::RoutableReference::changeRouter(const RouterPrx& newRouter) const
RouterInfoPtr newRouterInfo = getInstance()->routerManager()->get(newRouter);
if(newRouterInfo == _routerInfo)
{
- return RoutableReferencePtr(const_cast<RoutableReference*>(this));
+ return RoutableReferencePtr(const_cast<RoutableReference*>(this));
}
RoutableReferencePtr r = RoutableReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
r->_routerInfo = newRouterInfo;
@@ -763,14 +763,14 @@ IceInternal::RoutableReference::operator<(const Reference& r) const
{
const RoutableReference* rhs = dynamic_cast<const RoutableReference*>(&r);
assert(rhs);
- return _routerInfo < rhs->_routerInfo;
+ return _routerInfo < rhs->_routerInfo;
}
return false;
}
IceInternal::RoutableReference::RoutableReference(const InstancePtr& inst, const CommunicatorPtr& com,
- const Identity& ident, const Context& context, const string& fs,
- ReferenceMode md, bool sec, const RouterInfoPtr& rtrInfo) :
+ const Identity& ident, const Context& context, const string& fs,
+ ReferenceMode md, bool sec, const RouterInfoPtr& rtrInfo) :
Reference(inst, com, ident, context, fs, md, sec), _routerInfo(rtrInfo)
{
}
@@ -786,9 +786,9 @@ IceUtil::Shared* IceInternal::upCast(IceInternal::DirectReference* p) { return p
#ifdef ICEE_HAS_ROUTER
IceInternal::DirectReference::DirectReference(const InstancePtr& inst, const CommunicatorPtr& com,
- const Identity& ident, const Context& context, const string& fs, ReferenceMode md,
- bool sec, const vector<EndpointPtr>& endpts,
- const RouterInfoPtr& rtrInfo) :
+ const Identity& ident, const Context& context, const string& fs, ReferenceMode md,
+ bool sec, const vector<EndpointPtr>& endpts,
+ const RouterInfoPtr& rtrInfo) :
RoutableReference(inst, com, ident, context, fs, md, sec, rtrInfo),
_endpoints(endpts)
@@ -796,8 +796,8 @@ IceInternal::DirectReference::DirectReference(const InstancePtr& inst, const Com
}
#else
IceInternal::DirectReference::DirectReference(const InstancePtr& inst, const CommunicatorPtr& com,
- const Identity& ident, const Context& context, const string& fs, ReferenceMode md,
- bool sec, const vector<EndpointPtr>& endpts) :
+ const Identity& ident, const Context& context, const string& fs, ReferenceMode md,
+ bool sec, const vector<EndpointPtr>& endpts) :
Reference(inst, com, ident, context, fs, md, sec),
_endpoints(endpts)
{
@@ -834,7 +834,7 @@ DirectReference::changeAdapterId(const string& newAdapterId) const
return getInstance()->referenceFactory()->create(getIdentity(), *getContext(), getFacet(), getMode(),
getSecure(), newAdapterId,
#ifdef ICEE_HAS_ROUTER
- getRouterInfo(),
+ getRouterInfo(),
#endif
locatorInfo);
}
@@ -858,12 +858,12 @@ IceInternal::DirectReference::changeTimeout(int newTimeout) const
DirectReferencePtr r = DirectReferencePtr::dynamicCast(Parent::changeTimeout(newTimeout));
if(r.get() != this) // Also override the timeout on the endpoints if it was updated.
{
- vector<EndpointPtr> newEndpoints;
- for(vector<EndpointPtr>::const_iterator p = _endpoints.begin(); p != _endpoints.end(); ++p)
- {
- newEndpoints.push_back((*p)->timeout(newTimeout));
- }
- r->_endpoints = newEndpoints;
+ vector<EndpointPtr> newEndpoints;
+ for(vector<EndpointPtr>::const_iterator p = _endpoints.begin(); p != _endpoints.end(); ++p)
+ {
+ newEndpoints.push_back((*p)->timeout(newTimeout));
+ }
+ r->_endpoints = newEndpoints;
}
return r;
}
@@ -877,14 +877,14 @@ IceInternal::DirectReference::streamWrite(BasicStream* s) const
s->writeSize(sz);
if(sz)
{
- for(vector<EndpointPtr>::const_iterator p = _endpoints.begin(); p != _endpoints.end(); ++p)
- {
- (*p)->streamWrite(s);
- }
+ for(vector<EndpointPtr>::const_iterator p = _endpoints.begin(); p != _endpoints.end(); ++p)
+ {
+ (*p)->streamWrite(s);
+ }
}
else
{
- s->write(string("")); // Adapter id.
+ s->write(string("")); // Adapter id.
}
}
@@ -896,12 +896,12 @@ IceInternal::DirectReference::toString() const
vector<EndpointPtr>::const_iterator p;
for(p = _endpoints.begin(); p != _endpoints.end(); ++p)
{
- string endp = (*p)->toString();
- if(!endp.empty())
- {
- result.append(":");
- result.append(endp);
- }
+ string endp = (*p)->toString();
+ if(!endp.empty())
+ {
+ result.append(":");
+ result.append(endp);
+ }
}
return result;
}
@@ -915,7 +915,7 @@ IceInternal::DirectReference::getConnection() const
if(endpts.empty())
{
- endpts = _endpoints; // Endpoint overrides are already applied on these endpoints.
+ endpts = _endpoints; // Endpoint overrides are already applied on these endpoints.
}
#else
vector<EndpointPtr> endpts = _endpoints;
@@ -975,8 +975,8 @@ IceInternal::DirectReference::operator<(const Reference& r) const
if(Parent::operator==(r))
{
const DirectReference* rhs = dynamic_cast<const DirectReference*>(&r);
- assert(rhs);
- return _endpoints < rhs->_endpoints;
+ assert(rhs);
+ return _endpoints < rhs->_endpoints;
}
return false;
}
@@ -998,9 +998,9 @@ IceUtil::Shared* IceInternal::upCast(IceInternal::IndirectReference* p) { return
#ifdef ICEE_HAS_ROUTER
IceInternal::IndirectReference::IndirectReference(const InstancePtr& inst, const CommunicatorPtr& com,
- const Identity& ident, const Context& context, const string& fs,
- ReferenceMode md, bool sec, const string& adptid,
- const RouterInfoPtr& rtrInfo, const LocatorInfoPtr& locInfo) :
+ const Identity& ident, const Context& context, const string& fs,
+ ReferenceMode md, bool sec, const string& adptid,
+ const RouterInfoPtr& rtrInfo, const LocatorInfoPtr& locInfo) :
RoutableReference(inst, com, ident, context, fs, md, sec, rtrInfo),
_adapterId(adptid),
_locatorInfo(locInfo)
@@ -1008,9 +1008,9 @@ IceInternal::IndirectReference::IndirectReference(const InstancePtr& inst, const
}
#else
IceInternal::IndirectReference::IndirectReference(const InstancePtr& inst, const CommunicatorPtr& com,
- const Identity& ident, const Context& context, const string& fs,
- ReferenceMode md, bool sec, const string& adptid,
- const LocatorInfoPtr& locInfo) :
+ const Identity& ident, const Context& context, const string& fs,
+ ReferenceMode md, bool sec, const string& adptid,
+ const LocatorInfoPtr& locInfo) :
Reference(inst, com, ident, context, fs, md, sec),
_adapterId(adptid),
_locatorInfo(locInfo)
@@ -1054,7 +1054,7 @@ IceInternal::IndirectReference::changeLocator(const LocatorPrx& newLocator) cons
LocatorInfoPtr newLocatorInfo = getInstance()->locatorManager()->get(newLocator);
if(newLocatorInfo == _locatorInfo)
{
- return IndirectReferencePtr(const_cast<IndirectReference*>(this));
+ return IndirectReferencePtr(const_cast<IndirectReference*>(this));
}
IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
r->_locatorInfo = newLocatorInfo;
@@ -1098,13 +1098,13 @@ IceInternal::IndirectReference::toString() const
a = IceUtil::escapeString(a, "");
if(a.find_first_of(" ") != string::npos)
{
- result.append("\"");
- result.append(a);
- result.append("\"");
+ result.append("\"");
+ result.append(a);
+ result.append("\"");
}
else
{
- result.append(_adapterId);
+ result.append(_adapterId);
}
return result;
}
@@ -1117,58 +1117,58 @@ IceInternal::IndirectReference::getConnection() const
while(true)
{
#ifdef ICEE_HAS_ROUTER
- vector<EndpointPtr> endpts = Parent::getRoutedEndpoints();
+ vector<EndpointPtr> endpts = Parent::getRoutedEndpoints();
#else
- vector<EndpointPtr> endpts;
+ vector<EndpointPtr> endpts;
#endif
- bool cached = false;
- if(endpts.empty() && _locatorInfo)
- {
- const IndirectReferencePtr self = const_cast<IndirectReference*>(this);
- endpts = _locatorInfo->getEndpoints(self, cached);
- }
-
- applyOverrides(endpts);
-
- vector<EndpointPtr> filteredEndpoints = filterEndpoints(endpts, getMode(), getSecure());
- if(filteredEndpoints.empty())
- {
- throw NoEndpointException(__FILE__, __LINE__, toString());
- }
-
- try
- {
- OutgoingConnectionFactoryPtr factory = getInstance()->outgoingConnectionFactory();
- connection = factory->create(filteredEndpoints);
- assert(connection);
- }
- catch(const LocalException& ex)
- {
+ bool cached = false;
+ if(endpts.empty() && _locatorInfo)
+ {
+ const IndirectReferencePtr self = const_cast<IndirectReference*>(this);
+ endpts = _locatorInfo->getEndpoints(self, cached);
+ }
+
+ applyOverrides(endpts);
+
+ vector<EndpointPtr> filteredEndpoints = filterEndpoints(endpts, getMode(), getSecure());
+ if(filteredEndpoints.empty())
+ {
+ throw NoEndpointException(__FILE__, __LINE__, toString());
+ }
+
+ try
+ {
+ OutgoingConnectionFactoryPtr factory = getInstance()->outgoingConnectionFactory();
+ connection = factory->create(filteredEndpoints);
+ assert(connection);
+ }
+ catch(const LocalException& ex)
+ {
#ifdef ICEE_HAS_ROUTER
- if(!getRouterInfo())
+ if(!getRouterInfo())
#endif
- {
- assert(_locatorInfo);
- const IndirectReferencePtr self = const_cast<IndirectReference*>(this);
- _locatorInfo->clearCache(self);
-
- if(cached)
- {
- TraceLevelsPtr traceLevels = getInstance()->traceLevels();
- if(traceLevels->retry >= 2)
- {
- Trace out(getInstance()->initializationData().logger, traceLevels->retryCat);
- out << "connection to cached endpoints failed\n"
- << "removing endpoints from cache and trying one more time\n" << ex.toString();
- }
- continue;
- }
- }
-
- throw;
- }
-
- break;
+ {
+ assert(_locatorInfo);
+ const IndirectReferencePtr self = const_cast<IndirectReference*>(this);
+ _locatorInfo->clearCache(self);
+
+ if(cached)
+ {
+ TraceLevelsPtr traceLevels = getInstance()->traceLevels();
+ if(traceLevels->retry >= 2)
+ {
+ Trace out(getInstance()->initializationData().logger, traceLevels->retryCat);
+ out << "connection to cached endpoints failed\n"
+ << "removing endpoints from cache and trying one more time\n" << ex.toString();
+ }
+ continue;
+ }
+ }
+
+ throw;
+ }
+
+ break;
}
#if defined(ICEE_HAS_ROUTER) && !defined(ICEE_PURE_CLIENT)
@@ -1238,16 +1238,16 @@ IceInternal::IndirectReference::operator<(const Reference& r) const
if(Parent::operator==(r))
{
const IndirectReference* rhs = dynamic_cast<const IndirectReference*>(&r);
- assert(rhs);
- if(_adapterId < rhs->_adapterId)
- {
- return true;
- }
- else if(rhs->_adapterId < _adapterId)
- {
- return false;
- }
- return _locatorInfo < rhs->_locatorInfo;
+ assert(rhs);
+ if(_adapterId < rhs->_adapterId)
+ {
+ return true;
+ }
+ else if(rhs->_adapterId < _adapterId)
+ {
+ return false;
+ }
+ return _locatorInfo < rhs->_locatorInfo;
}
return false;
}
@@ -1305,18 +1305,18 @@ IceInternal::filterEndpoints(const vector<EndpointPtr>& allEndpoints, ReferenceM
//
// Filter out non-datagram endpoints.
//
- endpoints.erase(remove_if(endpoints.begin(), endpoints.end(),
- not1(Ice::constMemFun(&Endpoint::datagram))),
- endpoints.end());
+ endpoints.erase(remove_if(endpoints.begin(), endpoints.end(),
+ not1(Ice::constMemFun(&Endpoint::datagram))),
+ endpoints.end());
break;
}
#ifndef ICEE_HAS_BATCH
case ReferenceModeBatchDatagram:
case ReferenceModeBatchOneway:
- {
- throw FeatureNotSupportedException(__FILE__, __LINE__, "batch proxy mode");
- }
+ {
+ throw FeatureNotSupportedException(__FILE__, __LINE__, "batch proxy mode");
+ }
#endif
}
@@ -1339,23 +1339,23 @@ IceInternal::filterEndpoints(const vector<EndpointPtr>& allEndpoints, ReferenceM
vector<EndpointPtr> secureEndpoints;
while(p != endpoints.end())
{
- if((*p)->secure())
- {
- secureEndpoints.push_back(*p);
- p = endpoints.erase(p);
- }
- else
- {
- ++p;
- }
+ if((*p)->secure())
+ {
+ secureEndpoints.push_back(*p);
+ p = endpoints.erase(p);
+ }
+ else
+ {
+ ++p;
+ }
}
if(sec)
{
- endpoints.swap(secureEndpoints);
+ endpoints.swap(secureEndpoints);
}
else
{
- endpoints.insert(endpoints.end(), secureEndpoints.begin(), secureEndpoints.end());
+ endpoints.insert(endpoints.end(), secureEndpoints.begin(), secureEndpoints.end());
}
return endpoints;
diff --git a/cppe/src/IceE/Reference.h b/cppe/src/IceE/Reference.h
index 443799e6582..933c4ac4330 100644
--- a/cppe/src/IceE/Reference.h
+++ b/cppe/src/IceE/Reference.h
@@ -38,9 +38,9 @@ public:
enum Type
{
- TypeDirect,
- TypeIndirect,
- TypeFixed
+ TypeDirect,
+ TypeIndirect,
+ TypeFixed
};
//
@@ -49,12 +49,12 @@ public:
//
// enum Mode
// {
-// ModeTwoway,
-// ModeOneway,
-// ModeBatchOneway,
-// ModeDatagram,
-// ModeBatchDatagram,
-// ModeLast = ModeBatchDatagram
+// ModeTwoway,
+// ModeOneway,
+// ModeBatchOneway,
+// ModeDatagram,
+// ModeBatchDatagram,
+// ModeLast = ModeBatchDatagram
// };
ReferenceMode getMode() const { return _mode; }
@@ -122,7 +122,7 @@ public:
protected:
Reference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&,
- const std::string&, ReferenceMode, bool);
+ const std::string&, ReferenceMode, bool);
Reference(const Reference&);
void applyOverrides(std::vector<EndpointPtr>&) const;
@@ -158,7 +158,7 @@ class FixedReference : public Reference
public:
FixedReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&,
- const std::string&, ReferenceMode, const std::vector<Ice::ConnectionPtr>&);
+ const std::string&, ReferenceMode, const std::vector<Ice::ConnectionPtr>&);
virtual Type getType() const;
virtual std::vector<EndpointPtr> getEndpoints() const;
@@ -214,7 +214,7 @@ public:
protected:
RoutableReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&,
- const std::string&, ReferenceMode, bool, const RouterInfoPtr&);
+ const std::string&, ReferenceMode, bool, const RouterInfoPtr&);
RoutableReference(const RoutableReference&);
@@ -234,11 +234,11 @@ class DirectReference :
public:
DirectReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&,
- const std::string&, ReferenceMode, bool, const std::vector<EndpointPtr>&
+ const std::string&, ReferenceMode, bool, const std::vector<EndpointPtr>&
#ifdef ICEE_HAS_ROUTER
- , const RouterInfoPtr&
+ , const RouterInfoPtr&
#endif
- );
+ );
virtual Type getType() const;
virtual std::vector<EndpointPtr> getEndpoints() const;
@@ -286,11 +286,11 @@ class IndirectReference :
public:
IndirectReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&,
- const std::string&, ReferenceMode, bool, const std::string&
+ const std::string&, ReferenceMode, bool, const std::string&
#ifdef ICEE_HAS_ROUTER
- , const RouterInfoPtr&
+ , const RouterInfoPtr&
#endif
- , const LocatorInfoPtr&);
+ , const LocatorInfoPtr&);
virtual LocatorInfoPtr getLocatorInfo() const { return _locatorInfo; }
diff --git a/cppe/src/IceE/ReferenceFactory.cpp b/cppe/src/IceE/ReferenceFactory.cpp
index 9667390915a..1820be6c1a1 100644
--- a/cppe/src/IceE/ReferenceFactory.cpp
+++ b/cppe/src/IceE/ReferenceFactory.cpp
@@ -39,7 +39,7 @@ IceInternal::ReferenceFactory::copy(const Reference* r) const
if(!_instance)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
const Ice::Identity& ident = r->getIdentity();
@@ -53,21 +53,21 @@ IceInternal::ReferenceFactory::copy(const Reference* r) const
ReferencePtr
IceInternal::ReferenceFactory::create(const Identity& ident,
- const Context& context,
- const string& facet,
- ReferenceMode mode,
- bool secure,
- const vector<EndpointPtr>& endpoints
+ const Context& context,
+ const string& facet,
+ ReferenceMode mode,
+ bool secure,
+ const vector<EndpointPtr>& endpoints
#ifdef ICEE_HAS_ROUTER
- , const RouterInfoPtr& routerInfo
+ , const RouterInfoPtr& routerInfo
#endif
- )
+ )
{
Mutex::Lock sync(*this);
if(!_instance)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
if(ident.name.empty() && ident.category.empty())
@@ -89,21 +89,21 @@ IceInternal::ReferenceFactory::create(const Identity& ident,
ReferencePtr
IceInternal::ReferenceFactory::create(const Identity& ident,
- const Context& context,
- const string& facet,
- ReferenceMode mode,
- bool secure,
- const string& adapterId
+ const Context& context,
+ const string& facet,
+ ReferenceMode mode,
+ bool secure,
+ const string& adapterId
#ifdef ICEE_HAS_ROUTER
- , const RouterInfoPtr& routerInfo
+ , const RouterInfoPtr& routerInfo
#endif
- , const LocatorInfoPtr& locatorInfo)
+ , const LocatorInfoPtr& locatorInfo)
{
Mutex::Lock sync(*this);
if(!_instance)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
if(ident.name.empty() && ident.category.empty())
@@ -116,7 +116,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident,
//
#ifdef ICEE_HAS_ROUTER
return new IndirectReference(_instance, _communicator, ident, context, facet, mode, secure, adapterId, routerInfo,
- locatorInfo);
+ locatorInfo);
#else
return new IndirectReference(_instance, _communicator, ident, context, facet, mode, secure, adapterId, locatorInfo);
#endif
@@ -126,16 +126,16 @@ IceInternal::ReferenceFactory::create(const Identity& ident,
ReferencePtr
IceInternal::ReferenceFactory::create(const Identity& ident,
- const Context& context,
- const string& facet,
- ReferenceMode mode,
- const vector<Ice::ConnectionPtr>& fixedConnections)
+ const Context& context,
+ const string& facet,
+ ReferenceMode mode,
+ const vector<Ice::ConnectionPtr>& fixedConnections)
{
Mutex::Lock sync(*this);
if(!_instance)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
if(ident.name.empty() && ident.category.empty())
@@ -166,7 +166,7 @@ IceInternal::ReferenceFactory::create(const string& str)
beg = s.find_first_not_of(delim, end);
if(beg == string::npos)
{
- throw ProxyParseException(__FILE__, __LINE__, str);
+ throw ProxyParseException(__FILE__, __LINE__, str);
}
//
@@ -177,7 +177,7 @@ IceInternal::ReferenceFactory::create(const string& str)
end = IceUtil::checkQuote(s, beg);
if(end == string::npos)
{
- throw ProxyParseException(__FILE__, __LINE__, str);
+ throw ProxyParseException(__FILE__, __LINE__, str);
}
else if(end == 0)
{
@@ -197,7 +197,7 @@ IceInternal::ReferenceFactory::create(const string& str)
if(beg == end)
{
- throw ProxyParseException(__FILE__, __LINE__, str);
+ throw ProxyParseException(__FILE__, __LINE__, str);
}
//
@@ -238,50 +238,50 @@ IceInternal::ReferenceFactory::create(const string& str)
while(true)
{
- beg = s.find_first_not_of(delim, end);
- if(beg == string::npos)
- {
- break;
- }
+ beg = s.find_first_not_of(delim, end);
+ if(beg == string::npos)
+ {
+ break;
+ }
if(s[beg] == ':' || s[beg] == '@')
{
break;
}
- end = s.find_first_of(delim + ":@", beg);
- if(end == string::npos)
- {
- end = s.length();
- }
-
- if(beg == end)
- {
- break;
- }
-
- string option = s.substr(beg, end - beg);
- if(option.length() != 2 || option[0] != '-')
- {
+ end = s.find_first_of(delim + ":@", beg);
+ if(end == string::npos)
+ {
+ end = s.length();
+ }
+
+ if(beg == end)
+ {
+ break;
+ }
+
+ string option = s.substr(beg, end - beg);
+ if(option.length() != 2 || option[0] != '-')
+ {
throw ProxyParseException(__FILE__, __LINE__, str);
- }
+ }
//
// Check for the presence of an option argument. The
// argument may be enclosed in single or double
// quotation marks.
//
- string argument;
- string::size_type argumentBeg = s.find_first_not_of(delim, end);
- if(argumentBeg != string::npos)
- {
+ string argument;
+ string::size_type argumentBeg = s.find_first_not_of(delim, end);
+ if(argumentBeg != string::npos)
+ {
if(s[argumentBeg] != '@' && s[argumentBeg] != ':' && s[argumentBeg] != '-')
{
beg = argumentBeg;
end = IceUtil::checkQuote(s, beg);
if(end == string::npos)
{
- throw ProxyParseException(__FILE__, __LINE__, str);
+ throw ProxyParseException(__FILE__, __LINE__, str);
}
else if(end == 0)
{
@@ -298,26 +298,26 @@ IceInternal::ReferenceFactory::create(const string& str)
argument = s.substr(beg, end - beg);
end++; // Skip trailing quote
}
- }
- }
-
- //
- // If any new options are added here,
- // IceInternal::Reference::toString() and its derived classes must be updated as well.
- //
- switch(option[1])
- {
- case 'f':
- {
- if(argument.empty())
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
-
- if(!IceUtil::unescapeString(argument, 0, argument.size(), facet))
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
+ }
+ }
+
+ //
+ // If any new options are added here,
+ // IceInternal::Reference::toString() and its derived classes must be updated as well.
+ //
+ switch(option[1])
+ {
+ case 'f':
+ {
+ if(argument.empty())
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+
+ if(!IceUtil::unescapeString(argument, 0, argument.size(), facet))
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
#ifdef ICEE_HAS_WSTRING
if(_instance->initializationData().stringConverter)
{
@@ -328,74 +328,74 @@ IceInternal::ReferenceFactory::create(const string& str)
facet = tmpFacet;
}
#endif
- break;
- }
-
- case 't':
- {
- if(!argument.empty())
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
- mode = ReferenceModeTwoway;
- break;
- }
-
- case 'o':
- {
- if(!argument.empty())
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
- mode = ReferenceModeOneway;
- break;
- }
-
- case 'O':
- {
- if(!argument.empty())
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
- mode = ReferenceModeBatchOneway;
- break;
- }
-
- case 'd':
- {
- if(!argument.empty())
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
- mode = ReferenceModeDatagram;
- break;
- }
-
- case 'D':
- {
- if(!argument.empty())
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
- mode = ReferenceModeBatchDatagram;
- break;
- }
-
- case 's':
- {
- if(!argument.empty())
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
- secure = true;
- break;
- }
-
- default:
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
- }
+ break;
+ }
+
+ case 't':
+ {
+ if(!argument.empty())
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+ mode = ReferenceModeTwoway;
+ break;
+ }
+
+ case 'o':
+ {
+ if(!argument.empty())
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+ mode = ReferenceModeOneway;
+ break;
+ }
+
+ case 'O':
+ {
+ if(!argument.empty())
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+ mode = ReferenceModeBatchOneway;
+ break;
+ }
+
+ case 'd':
+ {
+ if(!argument.empty())
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+ mode = ReferenceModeDatagram;
+ break;
+ }
+
+ case 'D':
+ {
+ if(!argument.empty())
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+ mode = ReferenceModeBatchDatagram;
+ break;
+ }
+
+ case 's':
+ {
+ if(!argument.empty())
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+ secure = true;
+ break;
+ }
+
+ default:
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+ }
}
#ifdef ICEE_HAS_ROUTER
@@ -409,111 +409,111 @@ IceInternal::ReferenceFactory::create(const string& str)
{
#ifdef ICEE_HAS_LOCATOR
# ifdef ICEE_HAS_ROUTER
- return create(ident, Ice::Context(), facet, mode, secure, "", routerInfo, locatorInfo);
+ return create(ident, Ice::Context(), facet, mode, secure, "", routerInfo, locatorInfo);
# else
- return create(ident, Ice::Context(), facet, mode, secure, "", locatorInfo);
+ return create(ident, Ice::Context(), facet, mode, secure, "", locatorInfo);
# endif
-#else
+#else
throw FeatureNotSupportedException(__FILE__, __LINE__,
- "indirect proxy `" + str + "' (no locator support built-in)");
+ "indirect proxy `" + str + "' (no locator support built-in)");
#endif
}
vector<EndpointPtr> endpoints;
switch(s[beg])
{
- case ':':
- {
- vector<string> unknownEndpoints;
- end = beg;
-
- while(end < s.length() && s[end] == ':')
- {
- beg = end + 1;
-
- end = s.find(':', beg);
- if(end == string::npos)
- {
- end = s.length();
- }
-
- string es = s.substr(beg, end - beg);
- EndpointPtr endp = _instance->endpointFactory()->create(es);
- if(endp != 0)
- {
- vector<EndpointPtr> endps = endp->expand(false);
- endpoints.insert(endpoints.end(), endps.begin(), endps.end());
- }
- else
- {
- unknownEndpoints.push_back(es);
- }
- }
- if(endpoints.size() == 0)
- {
- throw EndpointParseException(__FILE__, __LINE__, unknownEndpoints.front());
- }
- else if(unknownEndpoints.size() != 0 &&
- _instance->initializationData().properties->getPropertyAsIntWithDefault(
- "Ice.Warn.Endpoints", 1) > 0)
- {
- Warning out(_instance->initializationData().logger);
- out << "Proxy contains unknown endpoints:";
- for(unsigned int idx = 0; idx < unknownEndpoints.size(); ++idx)
- {
- out << " `" << unknownEndpoints[idx] << "'";
- }
- }
+ case ':':
+ {
+ vector<string> unknownEndpoints;
+ end = beg;
+
+ while(end < s.length() && s[end] == ':')
+ {
+ beg = end + 1;
+
+ end = s.find(':', beg);
+ if(end == string::npos)
+ {
+ end = s.length();
+ }
+
+ string es = s.substr(beg, end - beg);
+ EndpointPtr endp = _instance->endpointFactory()->create(es);
+ if(endp != 0)
+ {
+ vector<EndpointPtr> endps = endp->expand(false);
+ endpoints.insert(endpoints.end(), endps.begin(), endps.end());
+ }
+ else
+ {
+ unknownEndpoints.push_back(es);
+ }
+ }
+ if(endpoints.size() == 0)
+ {
+ throw EndpointParseException(__FILE__, __LINE__, unknownEndpoints.front());
+ }
+ else if(unknownEndpoints.size() != 0 &&
+ _instance->initializationData().properties->getPropertyAsIntWithDefault(
+ "Ice.Warn.Endpoints", 1) > 0)
+ {
+ Warning out(_instance->initializationData().logger);
+ out << "Proxy contains unknown endpoints:";
+ for(unsigned int idx = 0; idx < unknownEndpoints.size(); ++idx)
+ {
+ out << " `" << unknownEndpoints[idx] << "'";
+ }
+ }
#ifdef ICEE_HAS_ROUTER
- return create(ident, Ice::Context(), facet, mode, secure, endpoints, routerInfo);
+ return create(ident, Ice::Context(), facet, mode, secure, endpoints, routerInfo);
#else
- return create(ident, Ice::Context(), facet, mode, secure, endpoints);
+ return create(ident, Ice::Context(), facet, mode, secure, endpoints);
#endif
- break;
- }
+ break;
+ }
- case '@':
- {
+ case '@':
+ {
#ifdef ICEE_HAS_LOCATOR
- beg = s.find_first_not_of(delim, beg + 1);
- if(beg == string::npos)
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
+ beg = s.find_first_not_of(delim, beg + 1);
+ if(beg == string::npos)
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
string adapterstr;
- end = IceUtil::checkQuote(s, beg);
- if(end == string::npos)
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
- else if(end == 0)
- {
- end = s.find_first_of(delim, beg);
- if(end == string::npos)
- {
- end = s.size();
- }
+ end = IceUtil::checkQuote(s, beg);
+ if(end == string::npos)
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
+ else if(end == 0)
+ {
+ end = s.find_first_of(delim, beg);
+ if(end == string::npos)
+ {
+ end = s.size();
+ }
adapterstr = s.substr(beg, end - beg);
- }
- else
- {
- beg++; // Skip leading quote
+ }
+ else
+ {
+ beg++; // Skip leading quote
adapterstr = s.substr(beg, end - beg);
end++; // Skip trailing quote.
- }
+ }
// Check for trailing whitespace.
if(end != string::npos && s.find_first_not_of(delim, end) != string::npos)
{
- throw ProxyParseException(__FILE__, __LINE__, str);
+ throw ProxyParseException(__FILE__, __LINE__, str);
}
- if(!IceUtil::unescapeString(adapterstr, 0, adapterstr.size(), adapter) || adapter.size() == 0)
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
+ if(!IceUtil::unescapeString(adapterstr, 0, adapterstr.size(), adapter) || adapter.size() == 0)
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
#ifdef ICEE_HAS_WSTRING
if(_instance->initializationData().stringConverter)
{
@@ -526,21 +526,21 @@ IceInternal::ReferenceFactory::create(const string& str)
#endif
#ifdef ICEE_HAS_ROUTER
- return create(ident, Ice::Context(), facet, mode, secure, adapter, routerInfo, locatorInfo);
+ return create(ident, Ice::Context(), facet, mode, secure, adapter, routerInfo, locatorInfo);
#else
- return create(ident, Ice::Context(), facet, mode, secure, adapter, locatorInfo);
+ return create(ident, Ice::Context(), facet, mode, secure, adapter, locatorInfo);
#endif
#else
throw FeatureNotSupportedException(__FILE__, __LINE__,
- "indirect proxy `" + str + "' (no locator support built-in)");
+ "indirect proxy `" + str + "' (no locator support built-in)");
#endif
- break;
- }
+ break;
+ }
- default:
- {
- throw ProxyParseException(__FILE__, __LINE__, str);
- }
+ default:
+ {
+ throw ProxyParseException(__FILE__, __LINE__, str);
+ }
}
return 0; // Unreachable, fixes compiler warning.
@@ -603,7 +603,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s)
if(ident.name.empty() && ident.category.empty())
{
- return 0;
+ return 0;
}
//
@@ -614,11 +614,11 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s)
string facet;
if(!facetPath.empty())
{
- if(facetPath.size() > 1)
- {
- throwProxyUnmarshalException(__FILE__, __LINE__);
- }
- facet.swap(facetPath[0]);
+ if(facetPath.size() > 1)
+ {
+ throwProxyUnmarshalException(__FILE__, __LINE__);
+ }
+ facet.swap(facetPath[0]);
}
Byte modeAsByte;
@@ -626,7 +626,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s)
ReferenceMode mode = static_cast<ReferenceMode>(modeAsByte);
if(mode < 0 || mode > ReferenceModeLast)
{
- throwProxyUnmarshalException(__FILE__, __LINE__);
+ throwProxyUnmarshalException(__FILE__, __LINE__);
}
vector<EndpointPtr> endpoints;
@@ -644,30 +644,30 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s)
if(sz > 0)
{
- endpoints.reserve(sz);
- while(sz--)
- {
- EndpointPtr endpoint = _instance->endpointFactory()->read(s);
- endpoints.push_back(endpoint);
- }
+ endpoints.reserve(sz);
+ while(sz--)
+ {
+ EndpointPtr endpoint = _instance->endpointFactory()->read(s);
+ endpoints.push_back(endpoint);
+ }
#ifdef ICEE_HAS_ROUTER
- return create(ident, Ice::Context(), facet, mode, secure, endpoints, routerInfo);
+ return create(ident, Ice::Context(), facet, mode, secure, endpoints, routerInfo);
#else
- return create(ident, Ice::Context(), facet, mode, secure, endpoints);
+ return create(ident, Ice::Context(), facet, mode, secure, endpoints);
#endif
}
else
{
#ifdef ICEE_HAS_LOCATOR
- LocatorInfoPtr locatorInfo = _instance->locatorManager()->get(getDefaultLocator());
- s->read(adapterId);
+ LocatorInfoPtr locatorInfo = _instance->locatorManager()->get(getDefaultLocator());
+ s->read(adapterId);
# ifdef ICEE_HAS_ROUTER
- return create(ident, Ice::Context(), facet, mode, secure, adapterId, routerInfo, locatorInfo);
+ return create(ident, Ice::Context(), facet, mode, secure, adapterId, routerInfo, locatorInfo);
# else
- return create(ident, Ice::Context(), facet, mode, secure, adapterId, locatorInfo);
+ return create(ident, Ice::Context(), facet, mode, secure, adapterId, locatorInfo);
# endif
#else
- throwProxyUnmarshalException(__FILE__, __LINE__);
+ throwProxyUnmarshalException(__FILE__, __LINE__);
return 0; // Unreachable, fixes compiler warning.
#endif
}
@@ -710,7 +710,7 @@ IceInternal::ReferenceFactory::getDefaultLocator() const
#endif
IceInternal::ReferenceFactory::ReferenceFactory(const InstancePtr& instance,
- const CommunicatorPtr& communicator) :
+ const CommunicatorPtr& communicator) :
_instance(instance),
_communicator(communicator)
{
@@ -723,7 +723,7 @@ IceInternal::ReferenceFactory::destroy()
if(!_instance)
{
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
_instance = 0;
diff --git a/cppe/src/IceE/ReferenceFactory.h b/cppe/src/IceE/ReferenceFactory.h
index 4127e453deb..d3f1ce82b3d 100644
--- a/cppe/src/IceE/ReferenceFactory.h
+++ b/cppe/src/IceE/ReferenceFactory.h
@@ -34,19 +34,19 @@ public:
ReferencePtr create(const ::Ice::Identity&, const Ice::Context&, const ::std::string&, ReferenceMode, bool,
const ::std::vector<EndpointPtr>&
#ifdef ICEE_HAS_ROUTER
- , const RouterInfoPtr&
+ , const RouterInfoPtr&
#endif
- );
+ );
//
// Create an indirect reference.
//
#ifdef ICEE_HAS_LOCATOR
ReferencePtr create(const ::Ice::Identity&, const Ice::Context&, const ::std::string&, ReferenceMode, bool,
- const ::std::string&
+ const ::std::string&
#ifdef ICEE_HAS_ROUTER
- , const RouterInfoPtr&
+ , const RouterInfoPtr&
#endif
- , const LocatorInfoPtr&);
+ , const LocatorInfoPtr&);
#endif
//
// Create a fixed reference.
diff --git a/cppe/src/IceE/RouterInfo.cpp b/cppe/src/IceE/RouterInfo.cpp
index 508c93387e6..c96d1ff2acb 100644
--- a/cppe/src/IceE/RouterInfo.cpp
+++ b/cppe/src/IceE/RouterInfo.cpp
@@ -46,7 +46,7 @@ IceInternal::RouterManager::get(const RouterPrx& rtr)
{
if(!rtr)
{
- return 0;
+ return 0;
}
RouterPrx router = RouterPrx::uncheckedCast(rtr->ice_router(0)); // The router cannot be routed.
@@ -57,24 +57,24 @@ IceInternal::RouterManager::get(const RouterPrx& rtr)
if(_tableHint != _table.end())
{
- if(_tableHint->first == router)
- {
- p = _tableHint;
- }
+ if(_tableHint->first == router)
+ {
+ p = _tableHint;
+ }
}
if(p == _table.end())
{
- p = _table.find(router);
+ p = _table.find(router);
}
if(p == _table.end())
{
- _tableHint = _table.insert(_tableHint, pair<const RouterPrx, RouterInfoPtr>(router, new RouterInfo(router)));
+ _tableHint = _table.insert(_tableHint, pair<const RouterPrx, RouterInfoPtr>(router, new RouterInfo(router)));
}
else
{
- _tableHint = p;
+ _tableHint = p;
}
return _tableHint->second;
@@ -86,26 +86,26 @@ IceInternal::RouterManager::erase(const RouterPrx& rtr)
RouterInfoPtr info;
if(rtr)
{
- RouterPrx router = RouterPrx::uncheckedCast(rtr->ice_router(0)); // The router cannot be routed.
- IceUtil::Mutex::Lock sync(*this);
-
- map<RouterPrx, RouterInfoPtr>::iterator p = _table.end();
- if(_tableHint != _table.end() && _tableHint->first == router)
- {
- p = _tableHint;
- _tableHint = _table.end();
- }
-
- if(p == _table.end())
- {
- p = _table.find(router);
- }
-
- if(p != _table.end())
- {
- info = p->second;
- _table.erase(p);
- }
+ RouterPrx router = RouterPrx::uncheckedCast(rtr->ice_router(0)); // The router cannot be routed.
+ IceUtil::Mutex::Lock sync(*this);
+
+ map<RouterPrx, RouterInfoPtr>::iterator p = _table.end();
+ if(_tableHint != _table.end() && _tableHint->first == router)
+ {
+ p = _tableHint;
+ _tableHint = _table.end();
+ }
+
+ if(p == _table.end())
+ {
+ p = _table.find(router);
+ }
+
+ if(p != _table.end())
+ {
+ info = p->second;
+ _table.erase(p);
+ }
}
return info;
@@ -164,24 +164,24 @@ IceInternal::RouterInfo::getClientEndpoints()
if(_clientEndpoints.size() == 0) // Lazy initialization.
{
- ObjectPrx clientProxy = _router->getClientProxy();
- if(!clientProxy)
- {
+ ObjectPrx clientProxy = _router->getClientProxy();
+ if(!clientProxy)
+ {
//
// If getClientProxy() return nil, use router endpoints.
//
_clientEndpoints = _router->__reference()->getEndpoints();
- }
+ }
else
{
- clientProxy = clientProxy->ice_router(0); // The client proxy cannot be routed.
+ clientProxy = clientProxy->ice_router(0); // The client proxy cannot be routed.
- //
- // In order to avoid creating a new connection to the router,
- // we must use the same timeout as the already existing
- // connection.
- //
- clientProxy = clientProxy->ice_timeout(_router->ice_getConnection()->timeout());
+ //
+ // In order to avoid creating a new connection to the router,
+ // we must use the same timeout as the already existing
+ // connection.
+ //
+ clientProxy = clientProxy->ice_timeout(_router->ice_getConnection()->timeout());
_clientEndpoints = clientProxy->__reference()->getEndpoints();
}
@@ -197,13 +197,13 @@ IceInternal::RouterInfo::getServerEndpoints()
if(_serverEndpoints.size() == 0) // Lazy initialization.
{
- ObjectPrx serverProxy = _router->getServerProxy();
- if(!serverProxy)
- {
- throw NoEndpointException(__FILE__, __LINE__);
- }
+ ObjectPrx serverProxy = _router->getServerProxy();
+ if(!serverProxy)
+ {
+ throw NoEndpointException(__FILE__, __LINE__);
+ }
- serverProxy = serverProxy->ice_router(0); // The server proxy cannot be routed.
+ serverProxy = serverProxy->ice_router(0); // The server proxy cannot be routed.
_serverEndpoints = serverProxy->__reference()->getEndpoints();
}
diff --git a/cppe/src/IceE/ServantManager.cpp b/cppe/src/IceE/ServantManager.cpp
index 98a233cc77e..4eacee31ea7 100644
--- a/cppe/src/IceE/ServantManager.cpp
+++ b/cppe/src/IceE/ServantManager.cpp
@@ -29,26 +29,26 @@ IceInternal::ServantManager::addServant(const ObjectPtr& object, const Identity&
if(p == _servantMapMap.end() || p->first != ident)
{
- p = _servantMapMap.find(ident);
+ p = _servantMapMap.find(ident);
}
if(p == _servantMapMap.end())
{
- p = _servantMapMap.insert(_servantMapMapHint, pair<const Identity, FacetMap>(ident, FacetMap()));
+ p = _servantMapMap.insert(_servantMapMapHint, pair<const Identity, FacetMap>(ident, FacetMap()));
}
else
{
- if(p->second.find(facet) != p->second.end())
- {
- AlreadyRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "servant";
- ex.id = _instance->identityToString(ident);
- if(!facet.empty())
- {
- ex.id += " -f " + IceUtil::escapeString(facet, "");
- }
- throw ex;
- }
+ if(p->second.find(facet) != p->second.end())
+ {
+ AlreadyRegisteredException ex(__FILE__, __LINE__);
+ ex.kindOfObject = "servant";
+ ex.id = _instance->identityToString(ident);
+ if(!facet.empty())
+ {
+ ex.id += " -f " + IceUtil::escapeString(facet, "");
+ }
+ throw ex;
+ }
}
_servantMapMapHint = p;
@@ -75,19 +75,19 @@ IceInternal::ServantManager::removeServant(const Identity& ident, const string&
if(p == _servantMapMap.end() || p->first != ident)
{
- p = _servantMapMap.find(ident);
+ p = _servantMapMap.find(ident);
}
if(p == _servantMapMap.end() || (q = p->second.find(facet)) == p->second.end())
{
- NotRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "servant";
- ex.id = _instance->identityToString(ident);
- if(!facet.empty())
- {
- ex.id += " -f " + IceUtil::escapeString(facet, "");
- }
- throw ex;
+ NotRegisteredException ex(__FILE__, __LINE__);
+ ex.kindOfObject = "servant";
+ ex.id = _instance->identityToString(ident);
+ if(!facet.empty())
+ {
+ ex.id += " -f " + IceUtil::escapeString(facet, "");
+ }
+ throw ex;
}
servant = q->second;
@@ -95,15 +95,15 @@ IceInternal::ServantManager::removeServant(const Identity& ident, const string&
if(p->second.empty())
{
- if(p == _servantMapMapHint)
- {
- _servantMapMap.erase(p++);
- _servantMapMapHint = p;
- }
- else
- {
- _servantMapMap.erase(p);
- }
+ if(p == _servantMapMapHint)
+ {
+ _servantMapMap.erase(p++);
+ _servantMapMapHint = p;
+ }
+ else
+ {
+ _servantMapMap.erase(p);
+ }
}
return servant;
}
@@ -119,27 +119,27 @@ IceInternal::ServantManager::removeAllFacets(const Identity& ident)
if(p == _servantMapMap.end() || p->first != ident)
{
- p = _servantMapMap.find(ident);
+ p = _servantMapMap.find(ident);
}
if(p == _servantMapMap.end())
{
- NotRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "servant";
- ex.id = _instance->identityToString(ident);
- throw ex;
+ NotRegisteredException ex(__FILE__, __LINE__);
+ ex.kindOfObject = "servant";
+ ex.id = _instance->identityToString(ident);
+ throw ex;
}
FacetMap result = p->second;
if(p == _servantMapMapHint)
{
- _servantMapMap.erase(p++);
- _servantMapMapHint = p;
+ _servantMapMap.erase(p++);
+ _servantMapMapHint = p;
}
else
{
- _servantMapMap.erase(p);
+ _servantMapMap.erase(p);
}
return result;
@@ -155,7 +155,7 @@ IceInternal::ServantManager::findServant(const Identity& ident, const string& fa
// requests from bidir connections. This method might be called if
// requests are received over the bidir connection after the
// adapter was deactivated.
- //
+ //
//assert(_instance); // Must not be called after destruction.
ServantMapMap::iterator p = _servantMapMapHint;
@@ -165,17 +165,17 @@ IceInternal::ServantManager::findServant(const Identity& ident, const string& fa
if(p == servantMapMap.end() || p->first != ident)
{
- p = servantMapMap.find(ident);
+ p = servantMapMap.find(ident);
}
if(p == servantMapMap.end() || (q = p->second.find(facet)) == p->second.end())
{
- return 0;
+ return 0;
}
else
{
- _servantMapMapHint = p;
- return q->second;
+ _servantMapMapHint = p;
+ return q->second;
}
}
@@ -192,17 +192,17 @@ IceInternal::ServantManager::findAllFacets(const Identity& ident) const
if(p == servantMapMap.end() || p->first != ident)
{
- p = servantMapMap.find(ident);
+ p = servantMapMap.find(ident);
}
if(p == servantMapMap.end())
{
- return FacetMap();
+ return FacetMap();
}
else
{
- _servantMapMapHint = p;
- return p->second;
+ _servantMapMapHint = p;
+ return p->second;
}
}
@@ -216,7 +216,7 @@ IceInternal::ServantManager::hasServant(const Identity& ident) const
// requests from bidir connections. This method might be called if
// requests are received over the bidir connection after the
// adapter was deactivated.
- //
+ //
//assert(_instance); // Must not be called after destruction.
ServantMapMap::iterator p = _servantMapMapHint;
@@ -224,18 +224,18 @@ IceInternal::ServantManager::hasServant(const Identity& ident) const
if(p == servantMapMap.end() || p->first != ident)
{
- p = servantMapMap.find(ident);
+ p = servantMapMap.find(ident);
}
if(p == servantMapMap.end())
{
- return false;
+ return false;
}
else
{
- _servantMapMapHint = p;
- assert(!p->second.empty());
- return true;
+ _servantMapMapHint = p;
+ assert(!p->second.empty());
+ return true;
}
}
@@ -262,14 +262,14 @@ IceInternal::ServantManager::destroy()
ServantMapMap servantMapMap;
{
- IceUtil::Mutex::Lock sync(*this);
-
- assert(_instance); // Must not be called after destruction.
-
- servantMapMap.swap(_servantMapMap);
- _servantMapMapHint = _servantMapMap.end();
-
- _instance = 0;
+ IceUtil::Mutex::Lock sync(*this);
+
+ assert(_instance); // Must not be called after destruction.
+
+ servantMapMap.swap(_servantMapMap);
+ _servantMapMapHint = _servantMapMap.end();
+
+ _instance = 0;
}
//
diff --git a/cppe/src/IceE/StaticMutex.cpp b/cppe/src/IceE/StaticMutex.cpp
index 6e51c9b132a..26ea365d03b 100644
--- a/cppe/src/IceE/StaticMutex.cpp
+++ b/cppe/src/IceE/StaticMutex.cpp
@@ -17,7 +17,7 @@ void IceUtil::StaticMutex::initialize() const
//
CRITICAL_SECTION* newCriticalSection = new CRITICAL_SECTION;
InitializeCriticalSection(newCriticalSection);
-
+
//
// Then assign it to _mutex
// Note that Windows performs a full memory barrier before the assignment;
@@ -25,11 +25,11 @@ void IceUtil::StaticMutex::initialize() const
//
if(InterlockedCompareExchangePointer(reinterpret_cast<void**>(&_mutex), newCriticalSection, 0) != 0)
{
- //
- // Another thread was doing the same thing
- //
- DeleteCriticalSection(newCriticalSection);
- delete newCriticalSection;
+ //
+ // Another thread was doing the same thing
+ //
+ DeleteCriticalSection(newCriticalSection);
+ delete newCriticalSection;
}
//
diff --git a/cppe/src/IceE/StringConverter.cpp b/cppe/src/IceE/StringConverter.cpp
index 837773b8e03..adf1c6d319a 100644
--- a/cppe/src/IceE/StringConverter.cpp
+++ b/cppe/src/IceE/StringConverter.cpp
@@ -23,8 +23,8 @@ namespace Ice
Byte*
UnicodeWstringConverter::toUTF8(const wchar_t* sourceStart,
- const wchar_t* sourceEnd,
- UTF8Buffer& buffer) const
+ const wchar_t* sourceEnd,
+ UTF8Buffer& buffer) const
{
//
// The "chunk size" is the maximum of the number of characters in the
@@ -38,51 +38,51 @@ UnicodeWstringConverter::toUTF8(const wchar_t* sourceStart,
ConversionResult result;
while((result =
- convertUTFWstringToUTF8(sourceStart, sourceEnd,
- targetStart, targetEnd, lenientConversion))
- == targetExhausted)
+ convertUTFWstringToUTF8(sourceStart, sourceEnd,
+ targetStart, targetEnd, lenientConversion))
+ == targetExhausted)
{
- targetStart = buffer.getMoreBytes(chunkSize, targetStart);
- targetEnd = targetStart + chunkSize;
+ targetStart = buffer.getMoreBytes(chunkSize, targetStart);
+ targetEnd = targetStart + chunkSize;
}
-
+
switch(result)
{
- case conversionOK:
- break;
- case sourceExhausted:
- throw StringConversionException(__FILE__, __LINE__, "wide string source exhausted");
- case sourceIllegal:
- throw StringConversionException(__FILE__, __LINE__, "wide string source illegal");
- default:
- {
- assert(0);
- throw StringConversionException(__FILE__, __LINE__);
- }
+ case conversionOK:
+ break;
+ case sourceExhausted:
+ throw StringConversionException(__FILE__, __LINE__, "wide string source exhausted");
+ case sourceIllegal:
+ throw StringConversionException(__FILE__, __LINE__, "wide string source illegal");
+ default:
+ {
+ assert(0);
+ throw StringConversionException(__FILE__, __LINE__);
+ }
}
return targetStart;
}
void
UnicodeWstringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd,
- wstring& target) const
+ wstring& target) const
{
ConversionResult result =
- convertUTF8ToUTFWstring(sourceStart, sourceEnd, target, lenientConversion);
+ convertUTF8ToUTFWstring(sourceStart, sourceEnd, target, lenientConversion);
switch(result)
- {
- case conversionOK:
- break;
- case sourceExhausted:
- throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source exhausted");
- case sourceIllegal:
- throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source illegal");
- default:
- {
- assert(0);
- throw StringConversionException(__FILE__, __LINE__);
- }
+ {
+ case conversionOK:
+ break;
+ case sourceExhausted:
+ throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source exhausted");
+ case sourceIllegal:
+ throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source illegal");
+ default:
+ {
+ assert(0);
+ throw StringConversionException(__FILE__, __LINE__);
+ }
}
}
diff --git a/cppe/src/IceE/StringUtil.cpp b/cppe/src/IceE/StringUtil.cpp
index c728e3151a2..7cce1177fd6 100644
--- a/cppe/src/IceE/StringUtil.cpp
+++ b/cppe/src/IceE/StringUtil.cpp
@@ -42,86 +42,86 @@ encodeChar(string::value_type b, string& s, const string& special)
{
switch(b)
{
- case '\\':
- {
- s.append("\\\\");
- break;
- }
-
- case '\'':
- {
- s.append("\\'");
- break;
- }
-
- case '"':
- {
- s.append("\\\"");
- break;
- }
-
- case '\b':
- {
- s.append("\\b");
- break;
- }
-
- case '\f':
- {
- s.append("\\f");
- break;
- }
-
- case '\n':
- {
- s.append("\\n");
- break;
- }
-
- case '\r':
- {
- s.append("\\r");
- break;
- }
-
- case '\t':
- {
- s.append("\\t");
- break;
- }
-
- default:
- {
- unsigned char i = static_cast<unsigned char>(b);
- if(!(i >= 32 && i <= 126))
- {
- s.push_back('\\');
- string octal = toOctalString(i);
- //
- // Add leading zeroes so that we avoid problems during
- // decoding. For example, consider the escaped string
- // \0013 (i.e., a character with value 1 followed by the
- // character '3'). If the leading zeroes were omitted, the
- // result would be incorrectly interpreted as a single
- // character with value 11.
- //
- for(string::size_type j = octal.size(); j < 3; j++)
- {
- s.push_back('0');
- }
- s.append(octal);
- }
- else if(special.find(b) != string::npos)
- {
- s.push_back('\\');
- s.push_back(b);
- }
- else
- {
- s.push_back(b);
- }
- break;
- }
+ case '\\':
+ {
+ s.append("\\\\");
+ break;
+ }
+
+ case '\'':
+ {
+ s.append("\\'");
+ break;
+ }
+
+ case '"':
+ {
+ s.append("\\\"");
+ break;
+ }
+
+ case '\b':
+ {
+ s.append("\\b");
+ break;
+ }
+
+ case '\f':
+ {
+ s.append("\\f");
+ break;
+ }
+
+ case '\n':
+ {
+ s.append("\\n");
+ break;
+ }
+
+ case '\r':
+ {
+ s.append("\\r");
+ break;
+ }
+
+ case '\t':
+ {
+ s.append("\\t");
+ break;
+ }
+
+ default:
+ {
+ unsigned char i = static_cast<unsigned char>(b);
+ if(!(i >= 32 && i <= 126))
+ {
+ s.push_back('\\');
+ string octal = toOctalString(i);
+ //
+ // Add leading zeroes so that we avoid problems during
+ // decoding. For example, consider the escaped string
+ // \0013 (i.e., a character with value 1 followed by the
+ // character '3'). If the leading zeroes were omitted, the
+ // result would be incorrectly interpreted as a single
+ // character with value 11.
+ //
+ for(string::size_type j = octal.size(); j < 3; j++)
+ {
+ s.push_back('0');
+ }
+ s.append(octal);
+ }
+ else if(special.find(b) != string::npos)
+ {
+ s.push_back('\\');
+ s.push_back(b);
+ }
+ else
+ {
+ s.push_back(b);
+ }
+ break;
+ }
}
}
@@ -136,16 +136,16 @@ IceUtil::escapeString(const string& s, const string& special)
string::size_type i;
for(i = 0; i < special.size(); ++i)
{
- if(static_cast<unsigned char>(special[i]) < 32 || static_cast<unsigned char>(special[i]) > 126)
- {
- throw IllegalArgumentException(__FILE__, __LINE__, "special characters must be in ASCII range 32-126");
- }
+ if(static_cast<unsigned char>(special[i]) < 32 || static_cast<unsigned char>(special[i]) > 126)
+ {
+ throw IllegalArgumentException(__FILE__, __LINE__, "special characters must be in ASCII range 32-126");
+ }
}
string result;
for(i = 0; i < s.size(); ++i)
{
- encodeChar(s[i], result, special);
+ encodeChar(s[i], result, special);
}
return result;
@@ -178,86 +178,86 @@ decodeChar(const string& s, string::size_type start, string::size_type end, stri
if(s[start] != '\\')
{
- c = checkChar(s[start++]);
+ c = checkChar(s[start++]);
}
else
{
- if(start + 1 == end)
- {
- throw IllegalArgumentException(__FILE__, __LINE__, "trailing backslash in argument");
- }
- switch(s[++start])
- {
- case '\\':
- case '\'':
- case '"':
- {
- c = s[start++];
- break;
- }
- case 'b':
- {
- ++start;
- c = '\b';
- break;
- }
- case 'f':
- {
- ++start;
- c = '\f';
- break;
- }
- case 'n':
- {
- ++start;
- c = '\n';
- break;
- }
- case 'r':
- {
- ++start;
- c = '\r';
- break;
- }
- case 't':
- {
- ++start;
- c = '\t';
- break;
- }
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- int oct = 0;
- for(int j = 0; j < 3 && start < end; ++j)
- {
- int charVal = s[start++] - '0';
- if(charVal < 0 || charVal > 7)
- {
- --start;
- break;
- }
- oct = oct * 8 + charVal;
- }
- if(oct > 255)
- {
- throw IllegalArgumentException(__FILE__, __LINE__, "octal value out of range");
- }
- c = (char)oct;
- break;
- }
- default:
- {
- c = checkChar(s[start++]);
- break;
- }
- }
+ if(start + 1 == end)
+ {
+ throw IllegalArgumentException(__FILE__, __LINE__, "trailing backslash in argument");
+ }
+ switch(s[++start])
+ {
+ case '\\':
+ case '\'':
+ case '"':
+ {
+ c = s[start++];
+ break;
+ }
+ case 'b':
+ {
+ ++start;
+ c = '\b';
+ break;
+ }
+ case 'f':
+ {
+ ++start;
+ c = '\f';
+ break;
+ }
+ case 'n':
+ {
+ ++start;
+ c = '\n';
+ break;
+ }
+ case 'r':
+ {
+ ++start;
+ c = '\r';
+ break;
+ }
+ case 't':
+ {
+ ++start;
+ c = '\t';
+ break;
+ }
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ {
+ int oct = 0;
+ for(int j = 0; j < 3 && start < end; ++j)
+ {
+ int charVal = s[start++] - '0';
+ if(charVal < 0 || charVal > 7)
+ {
+ --start;
+ break;
+ }
+ oct = oct * 8 + charVal;
+ }
+ if(oct > 255)
+ {
+ throw IllegalArgumentException(__FILE__, __LINE__, "octal value out of range");
+ }
+ c = (char)oct;
+ break;
+ }
+ default:
+ {
+ c = checkChar(s[start++]);
+ break;
+ }
+ }
}
nextStart = start;
return c;
@@ -271,7 +271,7 @@ static void decodeString(const string& s, string::size_type start, string::size_
{
while(start < end)
{
- sb.push_back(decodeChar(s, start, end, start));
+ sb.push_back(decodeChar(s, start, end, start));
}
}
@@ -291,20 +291,20 @@ IceUtil::unescapeString(const string& s, string::size_type start, string::size_t
}
if(start > end)
{
- throw IllegalArgumentException(__FILE__, __LINE__, "start offset must <= end offset");
+ throw IllegalArgumentException(__FILE__, __LINE__, "start offset must <= end offset");
}
result.reserve(end - start);
try
{
- result.clear();
- decodeString(s, start, end, result);
- return true;
+ result.clear();
+ decodeString(s, start, end, result);
+ return true;
}
catch(...)
{
- return false;
+ return false;
}
}
@@ -373,29 +373,29 @@ IceUtil::match(const string& s, const string& pat, bool matchPeriod)
do
{
if(pat[patIndex] == '*')
- {
- //
- // Don't allow matching x..y against x.*.y if requested -- star matches non-empty sequence only.
- //
- if(!matchPeriod && s[sIndex] == '.')
- {
- return false;
- }
- while(sIndex < s.size() && (matchPeriod || s[sIndex] != '.'))
- {
- ++sIndex;
- }
- patIndex++;
- }
- else
- {
- if(pat[patIndex] != s[sIndex])
- {
- return false;
- }
- ++sIndex;
- ++patIndex;
- }
+ {
+ //
+ // Don't allow matching x..y against x.*.y if requested -- star matches non-empty sequence only.
+ //
+ if(!matchPeriod && s[sIndex] == '.')
+ {
+ return false;
+ }
+ while(sIndex < s.size() && (matchPeriod || s[sIndex] != '.'))
+ {
+ ++sIndex;
+ }
+ patIndex++;
+ }
+ else
+ {
+ if(pat[patIndex] != s[sIndex])
+ {
+ return false;
+ }
+ ++sIndex;
+ ++patIndex;
+ }
}
while(sIndex < s.size() && patIndex < pat.size());
diff --git a/cppe/src/IceE/Thread.cpp b/cppe/src/IceE/Thread.cpp
index 1b195cd44b7..c3ca404c47b 100644
--- a/cppe/src/IceE/Thread.cpp
+++ b/cppe/src/IceE/Thread.cpp
@@ -44,13 +44,13 @@ IceUtil::ThreadControl::join()
{
if(_handle == 0)
{
- throw BadThreadControlException(__FILE__, __LINE__);
+ throw BadThreadControlException(__FILE__, __LINE__);
}
int rc = WaitForSingleObject(_handle, INFINITE);
if(rc != WAIT_OBJECT_0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
detach();
@@ -61,12 +61,12 @@ IceUtil::ThreadControl::detach()
{
if(_handle == 0)
{
- throw BadThreadControlException(__FILE__, __LINE__);
+ throw BadThreadControlException(__FILE__, __LINE__);
}
if(CloseHandle(_handle) == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -120,7 +120,7 @@ WINAPI startHook(void* arg)
try
{
- IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg);
+ IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg);
//
// Initialize the random number generator in each thread.
@@ -128,25 +128,25 @@ WINAPI startHook(void* arg)
unsigned int seed = static_cast<unsigned int>(IceUtil::Time::now().toMicroSeconds());
srand(seed);
- //
- // Ensure that the thread doesn't go away until run() has
- // completed.
- //
- thread = rawThread;
-
- //
- // See the comment in IceUtil::Thread::start() for details.
- //
- rawThread->__decRef();
- thread->run();
+ //
+ // Ensure that the thread doesn't go away until run() has
+ // completed.
+ //
+ thread = rawThread;
+
+ //
+ // See the comment in IceUtil::Thread::start() for details.
+ //
+ rawThread->__decRef();
+ thread->run();
}
catch(const IceUtil::Exception& e)
{
- fprintf(stderr, "IceUtil::Thread::run(): uncaught exception: %s\n", e.toString().c_str());
+ fprintf(stderr, "IceUtil::Thread::run(): uncaught exception: %s\n", e.toString().c_str());
}
catch(...)
{
- fprintf(stderr, "IceUtil::Thread::run(): uncaught exception\n");
+ fprintf(stderr, "IceUtil::Thread::run(): uncaught exception\n");
}
thread->_done();
@@ -169,7 +169,7 @@ IceUtil::Thread::start(size_t stackSize)
if(_started)
{
- throw ThreadStartedException(__FILE__, __LINE__);
+ throw ThreadStartedException(__FILE__, __LINE__);
}
//
@@ -185,26 +185,26 @@ IceUtil::Thread::start(size_t stackSize)
#ifdef _WIN32_WCE
_handle = CreateThread(0, stackSize,
- startHook, this, 0, &_id);
+ startHook, this, 0, &_id);
#else
unsigned int id;
_handle =
- reinterpret_cast<HANDLE>(
- _beginthreadex(0,
- static_cast<unsigned int>(stackSize),
- startHook, this, 0, &id));
+ reinterpret_cast<HANDLE>(
+ _beginthreadex(0,
+ static_cast<unsigned int>(stackSize),
+ startHook, this, 0, &id));
_id = id;
#endif
if(_handle == 0)
{
- __decRef();
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ __decRef();
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
_started = true;
_running = true;
-
+
return ThreadControl(_handle, _id);
}
@@ -214,7 +214,7 @@ IceUtil::Thread::getThreadControl() const
IceUtil::Mutex::Lock lock(_stateMutex);
if(!_started)
{
- throw ThreadNotStartedException(__FILE__, __LINE__);
+ throw ThreadNotStartedException(__FILE__, __LINE__);
}
return ThreadControl(_handle, _id);
}
@@ -283,14 +283,14 @@ IceUtil::ThreadControl::join()
{
if(!_detachable)
{
- throw BadThreadControlException(__FILE__, __LINE__);
+ throw BadThreadControlException(__FILE__, __LINE__);
}
void* ignore = 0;
int rc = pthread_join(_thread, &ignore);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -299,13 +299,13 @@ IceUtil::ThreadControl::detach()
{
if(!_detachable)
{
- throw BadThreadControlException(__FILE__, __LINE__);
+ throw BadThreadControlException(__FILE__, __LINE__);
}
int rc = pthread_detach(_thread);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -354,23 +354,23 @@ startHook(void* arg)
try
{
- IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg);
+ IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg);
- thread = rawThread;
+ thread = rawThread;
- //
- // See the comment in IceUtil::Thread::start() for details.
- //
- rawThread->__decRef();
- thread->run();
+ //
+ // See the comment in IceUtil::Thread::start() for details.
+ //
+ rawThread->__decRef();
+ thread->run();
}
catch(const IceUtil::Exception& e)
{
- fprintf(stderr, "IceUtil::Thread::run(): uncaught exception: %s\n", e.toString().c_str());
+ fprintf(stderr, "IceUtil::Thread::run(): uncaught exception: %s\n", e.toString().c_str());
}
catch(...)
{
- fprintf(stderr, "IceUtil::Thread::run(): uncaught exception\n");
+ fprintf(stderr, "IceUtil::Thread::run(): uncaught exception\n");
}
thread->_done();
@@ -390,7 +390,7 @@ IceUtil::Thread::start(size_t stackSize)
if(_started)
{
- throw ThreadStartedException(__FILE__, __LINE__);
+ throw ThreadStartedException(__FILE__, __LINE__);
}
//
@@ -406,34 +406,34 @@ IceUtil::Thread::start(size_t stackSize)
if(stackSize > 0)
{
- pthread_attr_t attr;
- int rc = pthread_attr_init(&attr);
- if(rc != 0)
- {
- __decRef();
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
- rc = pthread_attr_setstacksize(&attr, stackSize);
- if(rc != 0)
- {
- __decRef();
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
- rc = pthread_create(&_thread, &attr, startHook, this);
- if(rc != 0)
- {
- __decRef();
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
+ pthread_attr_t attr;
+ int rc = pthread_attr_init(&attr);
+ if(rc != 0)
+ {
+ __decRef();
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
+ rc = pthread_attr_setstacksize(&attr, stackSize);
+ if(rc != 0)
+ {
+ __decRef();
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
+ rc = pthread_create(&_thread, &attr, startHook, this);
+ if(rc != 0)
+ {
+ __decRef();
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
}
else
{
- int rc = pthread_create(&_thread, 0, startHook, this);
- if(rc != 0)
- {
- __decRef();
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
+ int rc = pthread_create(&_thread, 0, startHook, this);
+ if(rc != 0)
+ {
+ __decRef();
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
}
_started = true;
@@ -448,7 +448,7 @@ IceUtil::Thread::getThreadControl() const
IceUtil::Mutex::Lock lock(_stateMutex);
if(!_started)
{
- throw ThreadNotStartedException(__FILE__, __LINE__);
+ throw ThreadNotStartedException(__FILE__, __LINE__);
}
return ThreadControl(_thread);
}
diff --git a/cppe/src/IceE/ThreadException.cpp b/cppe/src/IceE/ThreadException.cpp
index 0cde7200156..1915f7f6431 100644
--- a/cppe/src/IceE/ThreadException.cpp
+++ b/cppe/src/IceE/ThreadException.cpp
@@ -32,33 +32,33 @@ IceUtil::ThreadSyscallException::toString() const
string out = Exception::toString();
if(_error != 0)
{
- out += ":\nthread syscall exception: ";
+ out += ":\nthread syscall exception: ";
#ifdef _WIN32_WCE
- out += Ice::printfToString("thread error: %d", _error);
+ out += Ice::printfToString("thread error: %d", _error);
#elif defined(_WIN32)
- LPVOID lpMsgBuf = 0;
- DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- _error,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR)&lpMsgBuf,
- 0,
- NULL);
-
- if(ok)
- {
- LPCTSTR msg = (LPCTSTR)lpMsgBuf;
- assert(msg && strlen((char*)msg) > 0);
- out += reinterpret_cast<const char*>(msg);
- LocalFree(lpMsgBuf);
- }
- else
- {
- out += "unknown thread error: ";
- out += Ice::printfToString("error=%d", _error);
- }
+ LPVOID lpMsgBuf = 0;
+ DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ _error,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR)&lpMsgBuf,
+ 0,
+ NULL);
+
+ if(ok)
+ {
+ LPCTSTR msg = (LPCTSTR)lpMsgBuf;
+ assert(msg && strlen((char*)msg) > 0);
+ out += reinterpret_cast<const char*>(msg);
+ LocalFree(lpMsgBuf);
+ }
+ else
+ {
+ out += "unknown thread error: ";
+ out += Ice::printfToString("error=%d", _error);
+ }
#else
out += strerror(_error);
#endif
diff --git a/cppe/src/IceE/TraceUtil.cpp b/cppe/src/IceE/TraceUtil.cpp
index fe5f9e2b68f..f0267bdf595 100644
--- a/cppe/src/IceE/TraceUtil.cpp
+++ b/cppe/src/IceE/TraceUtil.cpp
@@ -55,29 +55,29 @@ printRequestHeader(string& s, BasicStream& stream)
s += Ice::printfToString("\nmode = %d ", static_cast<int>(mode));
switch(mode)
{
- case Normal:
- {
- s += "(normal)";
- break;
- }
-
- case Nonmutating:
- {
- s += "(nonmutating)";
- break;
- }
-
- case Idempotent:
- {
- s += "(idempotent)";
- break;
- }
-
- default:
- {
- s += "(unknown)";
- break;
- }
+ case Normal:
+ {
+ s += "(normal)";
+ break;
+ }
+
+ case Nonmutating:
+ {
+ s += "(nonmutating)";
+ break;
+ }
+
+ case Idempotent:
+ {
+ s += "(idempotent)";
+ break;
+ }
+
+ default:
+ {
+ s += "(unknown)";
+ break;
+ }
}
Int sz;
@@ -85,16 +85,16 @@ printRequestHeader(string& s, BasicStream& stream)
s += "\ncontext = ";
while(sz--)
{
- pair<string, string> pair;
- stream.read(pair.first);
- stream.read(pair.second);
- s += pair.first;
- s += "/";
- s += pair.second;
- if(sz)
- {
- s += ", ";
- }
+ pair<string, string> pair;
+ stream.read(pair.first);
+ stream.read(pair.second);
+ s += pair.first;
+ s += "/";
+ s += pair.second;
+ if(sz)
+ {
+ s += ", ";
+ }
}
}
@@ -102,7 +102,7 @@ static void
printHeader(string& s, BasicStream& stream)
{
Byte magicNumber;
- stream.read(magicNumber); // Don't bother printing the magic number
+ stream.read(magicNumber); // Don't bother printing the magic number
stream.read(magicNumber);
stream.read(magicNumber);
stream.read(magicNumber);
@@ -127,41 +127,41 @@ printHeader(string& s, BasicStream& stream)
switch(type)
{
- case requestMsg:
- {
- s += "(request)";
- break;
- }
-
- case requestBatchMsg:
- {
- s += "(batch request)";
- break;
- }
-
- case replyMsg:
- {
- s += "(reply)";
- break;
- }
-
- case closeConnectionMsg:
- {
- s += "(close connection)";
- break;
- }
-
- case validateConnectionMsg:
- {
- s += "(validate connection)";
- break;
- }
-
- default:
- {
- s += "(unknown)";
- break;
- }
+ case requestMsg:
+ {
+ s += "(request)";
+ break;
+ }
+
+ case requestBatchMsg:
+ {
+ s += "(batch request)";
+ break;
+ }
+
+ case replyMsg:
+ {
+ s += "(reply)";
+ break;
+ }
+
+ case closeConnectionMsg:
+ {
+ s += "(close connection)";
+ break;
+ }
+
+ case validateConnectionMsg:
+ {
+ s += "(validate connection)";
+ break;
+ }
+
+ default:
+ {
+ s += "(unknown)";
+ break;
+ }
}
Byte compress;
@@ -170,29 +170,29 @@ printHeader(string& s, BasicStream& stream)
switch(compress)
{
- case 0:
- {
- s += "(not compressed; do not compress response, if any)";
- break;
- }
-
- case 1:
- {
- s += "(not compressed; compress response, if any)";
- break;
- }
-
- case 2:
- {
- s += "(compressed; compress response, if any)";
- break;
- }
-
- default:
- {
- s += "(unknown)";
- break;
- }
+ case 0:
+ {
+ s += "(not compressed; do not compress response, if any)";
+ break;
+ }
+
+ case 1:
+ {
+ s += "(not compressed; compress response, if any)";
+ break;
+ }
+
+ case 2:
+ {
+ s += "(compressed; compress response, if any)";
+ break;
+ }
+
+ default:
+ {
+ s += "(unknown)";
+ break;
+ }
}
Int size;
@@ -202,7 +202,7 @@ printHeader(string& s, BasicStream& stream)
void
IceInternal::traceHeader(const char* heading, const BasicStream& str, const LoggerPtr& logger,
- const TraceLevelsPtr& tl)
+ const TraceLevelsPtr& tl)
{
BasicStream& stream = const_cast<BasicStream&>(str);
BasicStream::Container::iterator p = stream.i;
@@ -217,7 +217,7 @@ IceInternal::traceHeader(const char* heading, const BasicStream& str, const Logg
void
IceInternal::traceRequest(const char* heading, const BasicStream& str, const LoggerPtr& logger,
- const TraceLevelsPtr& tl)
+ const TraceLevelsPtr& tl)
{
BasicStream& stream = const_cast<BasicStream&>(str);
BasicStream::Container::iterator p = stream.i;
@@ -231,7 +231,7 @@ IceInternal::traceRequest(const char* heading, const BasicStream& str, const Log
s += Ice::printfToString("\nrequest id = %d", requestId);
if(requestId == 0)
{
- s += " (oneway)";
+ s += " (oneway)";
}
printRequestHeader(s, stream);
@@ -243,7 +243,7 @@ IceInternal::traceRequest(const char* heading, const BasicStream& str, const Log
#ifdef ICEE_HAS_BATCH
void
IceInternal::traceBatchRequest(const char* heading, const BasicStream& str, const LoggerPtr& logger,
- const TraceLevelsPtr& tl)
+ const TraceLevelsPtr& tl)
{
BasicStream& stream = const_cast<BasicStream&>(str);
BasicStream::Container::iterator p = stream.i;
@@ -258,9 +258,9 @@ IceInternal::traceBatchRequest(const char* heading, const BasicStream& str, cons
for(int i = 0; i < batchRequestNum; ++i)
{
- s += Ice::printfToString("\nrequest #%d:", i);
- printRequestHeader(s, stream);
- stream.skipEncaps();
+ s += Ice::printfToString("\nrequest #%d:", i);
+ printRequestHeader(s, stream);
+ stream.skipEncaps();
}
logger->trace(tl->protocolCat, s);
@@ -270,7 +270,7 @@ IceInternal::traceBatchRequest(const char* heading, const BasicStream& str, cons
void
IceInternal::traceReply(const char* heading, const BasicStream& str, const LoggerPtr& logger,
- const TraceLevelsPtr& tl)
+ const TraceLevelsPtr& tl)
{
BasicStream& stream = const_cast<BasicStream&>(str);
BasicStream::Container::iterator p = stream.i;
@@ -290,93 +290,93 @@ IceInternal::traceReply(const char* heading, const BasicStream& str, const Logge
{
case replyOK:
{
- s += "(ok)";
- break;
+ s += "(ok)";
+ break;
}
case replyUserException:
{
- s += "(user exception)";
- break;
+ s += "(user exception)";
+ break;
}
case replyObjectNotExist:
case replyFacetNotExist:
case replyOperationNotExist:
{
- switch(replyStatus)
- {
- case replyObjectNotExist:
- {
- s += "(object not exist)";
- break;
- }
-
- case replyFacetNotExist:
- {
- s += "(facet not exist)";
- break;
- }
-
- case replyOperationNotExist:
- {
- s += "(operation not exist)";
- break;
- }
-
- default:
- {
- assert(false);
- break;
- }
- }
-
- printIdentityFacetOperation(s, stream);
- break;
+ switch(replyStatus)
+ {
+ case replyObjectNotExist:
+ {
+ s += "(object not exist)";
+ break;
+ }
+
+ case replyFacetNotExist:
+ {
+ s += "(facet not exist)";
+ break;
+ }
+
+ case replyOperationNotExist:
+ {
+ s += "(operation not exist)";
+ break;
+ }
+
+ default:
+ {
+ assert(false);
+ break;
+ }
+ }
+
+ printIdentityFacetOperation(s, stream);
+ break;
}
case replyUnknownException:
case replyUnknownLocalException:
case replyUnknownUserException:
{
- switch(replyStatus)
- {
- case replyUnknownException:
- {
- s += "(unknown exception)";
- break;
- }
-
- case replyUnknownLocalException:
- {
- s += "(unknown local exception)";
- break;
- }
-
- case replyUnknownUserException:
- {
- s += "(unknown user exception)";
- break;
- }
-
- default:
- {
- assert(false);
- break;
- }
- }
-
- string unknown;
- stream.read(unknown);
- s += "\nunknown = ";
- s += unknown;
- break;
+ switch(replyStatus)
+ {
+ case replyUnknownException:
+ {
+ s += "(unknown exception)";
+ break;
+ }
+
+ case replyUnknownLocalException:
+ {
+ s += "(unknown local exception)";
+ break;
+ }
+
+ case replyUnknownUserException:
+ {
+ s += "(unknown user exception)";
+ break;
+ }
+
+ default:
+ {
+ assert(false);
+ break;
+ }
+ }
+
+ string unknown;
+ stream.read(unknown);
+ s += "\nunknown = ";
+ s += unknown;
+ break;
}
default:
{
- s += "(unknown)";
- break;
+ s += "(unknown)";
+ break;
}
}
diff --git a/cppe/src/IceE/Transceiver.h b/cppe/src/IceE/Transceiver.h
index 36a7ecaa8bf..a3cbbaafdec 100644
--- a/cppe/src/IceE/Transceiver.h
+++ b/cppe/src/IceE/Transceiver.h
@@ -45,12 +45,12 @@ public:
void write(Buffer& buf)
{
- writeWithTimeout(buf, _writeTimeout);
+ writeWithTimeout(buf, _writeTimeout);
}
void read(Buffer& buf)
{
- readWithTimeout(buf, _readTimeout);
+ readWithTimeout(buf, _readTimeout);
}
std::string type() const;
diff --git a/cppe/src/IceE/UUID.cpp b/cppe/src/IceE/UUID.cpp
index de7fba90512..d3847e581cd 100644
--- a/cppe/src/IceE/UUID.cpp
+++ b/cppe/src/IceE/UUID.cpp
@@ -42,11 +42,11 @@ inline void halfByteToHex(unsigned char hb, char*& hexBuffer)
{
if(hb < 10)
{
- *hexBuffer++ = '0' + hb;
+ *hexBuffer++ = '0' + hb;
}
else
{
- *hexBuffer++ = 'A' + (hb - 10);
+ *hexBuffer++ = 'A' + (hb - 10);
}
}
@@ -54,8 +54,8 @@ inline void bytesToHex(unsigned char* bytes, size_t len, char*& hexBuffer)
{
for(size_t i = 0; i < len; i++)
{
- halfByteToHex((bytes[i] & 0xF0) >> 4, hexBuffer);
- halfByteToHex((bytes[i] & 0x0F), hexBuffer);
+ halfByteToHex((bytes[i] & 0xF0) >> 4, hexBuffer);
+ halfByteToHex((bytes[i] & 0x0F), hexBuffer);
}
}
@@ -84,12 +84,12 @@ public:
~UUIDCleanup()
{
- IceUtil::StaticMutex::Lock lock(staticMutex);
- if(cryptProv != 0)
- {
- CryptReleaseContext(cryptProv, 0);
- cryptProv = 0;
- }
+ IceUtil::StaticMutex::Lock lock(staticMutex);
+ if(cryptProv != 0)
+ {
+ CryptReleaseContext(cryptProv, 0);
+ cryptProv = 0;
+ }
}
};
@@ -125,12 +125,12 @@ public:
~UUIDCleanup()
{
- IceUtil::StaticMutex::Lock lock(staticMutex);
- if(fd != -1)
- {
- close(fd);
- fd = -1;
- }
+ IceUtil::StaticMutex::Lock lock(staticMutex);
+ if(fd != -1)
+ {
+ close(fd);
+ fd = -1;
+ }
}
};
static UUIDCleanup uuidCleanup;
@@ -179,12 +179,12 @@ IceUtil::generateUUID()
struct UUID
{
- unsigned char timeLow[4];
- unsigned char timeMid[2];
- unsigned char timeHighAndVersion[2];
- unsigned char clockSeqHiAndReserved;
- unsigned char clockSeqLow;
- unsigned char node[6];
+ unsigned char timeLow[4];
+ unsigned char timeMid[2];
+ unsigned char timeHighAndVersion[2];
+ unsigned char clockSeqHiAndReserved;
+ unsigned char clockSeqLow;
+ unsigned char node[6];
};
UUID uuid;
@@ -199,74 +199,74 @@ IceUtil::generateUUID()
HCRYPTPROV localProv;
{
- IceUtil::StaticMutex::Lock lock(staticMutex);
- if(cryptProv == 0)
- {
- if(!CryptAcquireContext(&cryptProv, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
- {
- throw UUIDGenerationException(__FILE__, __LINE__);
- }
- }
- localProv = cryptProv;
+ IceUtil::StaticMutex::Lock lock(staticMutex);
+ if(cryptProv == 0)
+ {
+ if(!CryptAcquireContext(&cryptProv, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
+ {
+ throw UUIDGenerationException(__FILE__, __LINE__);
+ }
+ }
+ localProv = cryptProv;
}
memset(buffer, 0, 16);
if(!CryptGenRandom(localProv, 16, (unsigned char*)buffer))
{
- throw UUIDGenerationException(__FILE__, __LINE__);
+ throw UUIDGenerationException(__FILE__, __LINE__);
}
#else
{
- //
- // Serialize access to /dev/urandom; see comment above.
- //
- IceUtil::StaticMutex::Lock lock(staticMutex);
- if(fd == -1)
- {
- fd = open("/dev/urandom", O_RDONLY);
- if (fd == -1)
- {
- assert(0);
- throw UUIDGenerationException(__FILE__, __LINE__);
- }
-
- //
- // Initialize myPid as well
- //
- pid_t pid = getpid();
- myPid[0] = (pid >> 8) & 0x7F;
- myPid[1] = pid & 0xFF;
- }
-
-
- //
- // Limit the number of attempts to 20 reads to avoid
- // a potential "for ever" loop
- //
- while(reads <= 20 && index != sizeof(UUID))
- {
- ssize_t bytesRead = read(fd, buffer + index, sizeof(UUID) - index);
-
- if(bytesRead == -1 && errno != EINTR)
- {
- int err = errno;
- fprintf(stderr, "Reading /dev/urandom returned %s\n", strerror(err));
- assert(0);
- throw UUIDGenerationException(__FILE__, __LINE__);
- }
- else
- {
- index += bytesRead;
- reads++;
- }
- }
+ //
+ // Serialize access to /dev/urandom; see comment above.
+ //
+ IceUtil::StaticMutex::Lock lock(staticMutex);
+ if(fd == -1)
+ {
+ fd = open("/dev/urandom", O_RDONLY);
+ if (fd == -1)
+ {
+ assert(0);
+ throw UUIDGenerationException(__FILE__, __LINE__);
+ }
+
+ //
+ // Initialize myPid as well
+ //
+ pid_t pid = getpid();
+ myPid[0] = (pid >> 8) & 0x7F;
+ myPid[1] = pid & 0xFF;
+ }
+
+
+ //
+ // Limit the number of attempts to 20 reads to avoid
+ // a potential "for ever" loop
+ //
+ while(reads <= 20 && index != sizeof(UUID))
+ {
+ ssize_t bytesRead = read(fd, buffer + index, sizeof(UUID) - index);
+
+ if(bytesRead == -1 && errno != EINTR)
+ {
+ int err = errno;
+ fprintf(stderr, "Reading /dev/urandom returned %s\n", strerror(err));
+ assert(0);
+ throw UUIDGenerationException(__FILE__, __LINE__);
+ }
+ else
+ {
+ index += bytesRead;
+ reads++;
+ }
+ }
}
-
+
if (index != sizeof(UUID))
{
- assert(0);
- throw UUIDGenerationException(__FILE__, __LINE__);
+ assert(0);
+ throw UUIDGenerationException(__FILE__, __LINE__);
}
//
diff --git a/cppe/src/IceE/Unicode.cpp b/cppe/src/IceE/Unicode.cpp
index c1a17286041..facd380e1a3 100644
--- a/cppe/src/IceE/Unicode.cpp
+++ b/cppe/src/IceE/Unicode.cpp
@@ -27,35 +27,35 @@ template<size_t wcharSize>
struct WstringHelper
{
static ConversionResult toUTF8(
- const wchar_t*& sourceStart, const wchar_t* sourceEnd,
- Byte*& targetStart, Byte* targetEnd, ConversionFlags flags);
+ const wchar_t*& sourceStart, const wchar_t* sourceEnd,
+ Byte*& targetStart, Byte* targetEnd, ConversionFlags flags);
static ConversionResult fromUTF8(
- const Byte*& sourceStart, const Byte* sourceEnd,
- wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags);
+ const Byte*& sourceStart, const Byte* sourceEnd,
+ wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags);
};
template<>
struct WstringHelper<2>
{
static ConversionResult toUTF8(
- const wchar_t*& sourceStart, const wchar_t* sourceEnd,
- Byte*& targetStart, Byte* targetEnd, ConversionFlags flags)
+ const wchar_t*& sourceStart, const wchar_t* sourceEnd,
+ Byte*& targetStart, Byte* targetEnd, ConversionFlags flags)
{
- return ConvertUTF16toUTF8(
- reinterpret_cast<const UTF16**>(&sourceStart),
- reinterpret_cast<const UTF16*>(sourceEnd),
- &targetStart, targetEnd, flags);
+ return ConvertUTF16toUTF8(
+ reinterpret_cast<const UTF16**>(&sourceStart),
+ reinterpret_cast<const UTF16*>(sourceEnd),
+ &targetStart, targetEnd, flags);
}
static ConversionResult fromUTF8(
- const Byte*& sourceStart, const Byte* sourceEnd,
- wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags)
+ const Byte*& sourceStart, const Byte* sourceEnd,
+ wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags)
{
- return ConvertUTF8toUTF16(
- &sourceStart, sourceEnd,
- reinterpret_cast<UTF16**>(&targetStart),
- reinterpret_cast<UTF16*>(targetEnd), flags);
+ return ConvertUTF8toUTF16(
+ &sourceStart, sourceEnd,
+ reinterpret_cast<UTF16**>(&targetStart),
+ reinterpret_cast<UTF16*>(targetEnd), flags);
}
};
@@ -63,23 +63,23 @@ template<>
struct WstringHelper<4>
{
static ConversionResult toUTF8(
- const wchar_t*& sourceStart, const wchar_t* sourceEnd,
- Byte*& targetStart, Byte* targetEnd, ConversionFlags flags)
+ const wchar_t*& sourceStart, const wchar_t* sourceEnd,
+ Byte*& targetStart, Byte* targetEnd, ConversionFlags flags)
{
- return ConvertUTF32toUTF8(
- reinterpret_cast<const UTF32**>(&sourceStart),
- reinterpret_cast<const UTF32*>(sourceEnd),
- &targetStart, targetEnd, flags);
+ return ConvertUTF32toUTF8(
+ reinterpret_cast<const UTF32**>(&sourceStart),
+ reinterpret_cast<const UTF32*>(sourceEnd),
+ &targetStart, targetEnd, flags);
}
static ConversionResult fromUTF8(
- const Byte*& sourceStart, const Byte* sourceEnd,
- wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags)
+ const Byte*& sourceStart, const Byte* sourceEnd,
+ wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags)
{
- return ConvertUTF8toUTF32(
- &sourceStart, sourceEnd,
- reinterpret_cast<UTF32**>(&targetStart),
- reinterpret_cast<UTF32*>(targetEnd), flags);
+ return ConvertUTF8toUTF32(
+ &sourceStart, sourceEnd,
+ reinterpret_cast<UTF32**>(&targetStart),
+ reinterpret_cast<UTF32*>(targetEnd), flags);
}
};
}
@@ -94,7 +94,7 @@ IceUtil::convertUTFWstringToUTF8(
Byte*& targetStart, Byte* targetEnd, ConversionFlags flags)
{
return WstringHelper<sizeof(wchar_t)>::toUTF8(
- sourceStart, sourceEnd, targetStart, targetEnd, flags);
+ sourceStart, sourceEnd, targetStart, targetEnd, flags);
}
ConversionResult
@@ -103,12 +103,12 @@ IceUtil::convertUTF8ToUTFWstring(
wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags)
{
return WstringHelper<sizeof(wchar_t)>::fromUTF8(
- sourceStart, sourceEnd, targetStart, targetEnd, flags);
+ sourceStart, sourceEnd, targetStart, targetEnd, flags);
}
ConversionResult
IceUtil::convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd,
- std::wstring& target, ConversionFlags flags)
+ std::wstring& target, ConversionFlags flags)
{
//
// Could be reimplemented without this temporary wchar_t buffer
@@ -119,13 +119,13 @@ IceUtil::convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd
wchar_t* targetEnd = targetStart + size;
ConversionResult result =
- convertUTF8ToUTFWstring(sourceStart, sourceEnd, targetStart,
- targetEnd, flags);
+ convertUTF8ToUTFWstring(sourceStart, sourceEnd, targetStart,
+ targetEnd, flags);
if(result == conversionOK)
{
- std::wstring s(outBuf, static_cast<size_t>(targetStart - outBuf));
- s.swap(target);
+ std::wstring s(outBuf, static_cast<size_t>(targetStart - outBuf));
+ s.swap(target);
}
delete[] outBuf;
return result;
@@ -139,7 +139,7 @@ IceUtil::convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd
const char* IceUtil::UTFConversionException::_name = "IceUtil::UTFConversionException";
IceUtil::UTFConversionException::UTFConversionException(const char* file, int line,
- ConversionResult cr):
+ ConversionResult cr):
Exception(file, line),
_conversionResult(cr)
{}
@@ -156,18 +156,18 @@ IceUtil::UTFConversionException::toString() const
string str = Exception::toString();
switch(_conversionResult)
{
- case sourceExhausted:
- str += ": source exhausted";
- break;
- case targetExhausted:
- str += ": target exhausted";
- break;
- case sourceIllegal:
- str += ": illegal source";
- break;
- default:
- assert(0);
- break;
+ case sourceExhausted:
+ str += ": source exhausted";
+ break;
+ case targetExhausted:
+ str += ": target exhausted";
+ break;
+ case sourceIllegal:
+ str += ": illegal source";
+ break;
+ default:
+ assert(0);
+ break;
};
return str;
}
@@ -205,18 +205,18 @@ IceUtil::wstringToString(const wstring& wstr)
const wchar_t* sourceStart = wstr.data();
ConversionResult cr =
- convertUTFWstringToUTF8(
- sourceStart, sourceStart + wstr.size(),
- targetStart, targetEnd, lenientConversion);
-
+ convertUTFWstringToUTF8(
+ sourceStart, sourceStart + wstr.size(),
+ targetStart, targetEnd, lenientConversion);
+
if(cr != conversionOK)
{
- delete[] outBuf;
- throw UTFConversionException(__FILE__, __LINE__, cr);
+ delete[] outBuf;
+ throw UTFConversionException(__FILE__, __LINE__, cr);
}
string s(reinterpret_cast<char*>(outBuf),
- static_cast<size_t>(targetStart - outBuf));
+ static_cast<size_t>(targetStart - outBuf));
s.swap(target);
delete[] outBuf;
return target;
@@ -229,12 +229,12 @@ IceUtil::stringToWstring(const string& str)
const Byte* sourceStart = reinterpret_cast<const Byte*>(str.data());
ConversionResult cr
- = convertUTF8ToUTFWstring(sourceStart, sourceStart + str.size(),
- result, lenientConversion);
+ = convertUTF8ToUTFWstring(sourceStart, sourceStart + str.size(),
+ result, lenientConversion);
if(cr != conversionOK)
{
- throw UTFConversionException(__FILE__, __LINE__, cr);
+ throw UTFConversionException(__FILE__, __LINE__, cr);
}
return result;
}
diff --git a/cppe/src/IceE/UnknownEndpoint.cpp b/cppe/src/IceE/UnknownEndpoint.cpp
index dee2bd5004f..3792a012c16 100644
--- a/cppe/src/IceE/UnknownEndpoint.cpp
+++ b/cppe/src/IceE/UnknownEndpoint.cpp
@@ -114,12 +114,12 @@ IceInternal::UnknownEndpoint::operator==(const Endpoint& r) const
const UnknownEndpoint* p = dynamic_cast<const UnknownEndpoint*>(&r);
if(!p)
{
- return false;
+ return false;
}
if(this == p)
{
- return true;
+ return true;
}
if(_type != p->_type)
@@ -129,7 +129,7 @@ IceInternal::UnknownEndpoint::operator==(const Endpoint& r) const
if(_rawBytes != p->_rawBytes)
{
- return false;
+ return false;
}
return true;
@@ -152,25 +152,25 @@ IceInternal::UnknownEndpoint::operator<(const Endpoint& r) const
if(this == p)
{
- return false;
+ return false;
}
if(_type < p->_type)
{
- return true;
+ return true;
}
else if(p->_type < _type)
{
- return false;
+ return false;
}
if(_rawBytes < p->_rawBytes)
{
- return true;
+ return true;
}
else if(p->_rawBytes < _rawBytes)
{
- return false;
+ return false;
}
return false;
diff --git a/cppe/src/TcpTransport/Acceptor.cpp b/cppe/src/TcpTransport/Acceptor.cpp
index 28f2b74b43a..477eb7b7adb 100644
--- a/cppe/src/TcpTransport/Acceptor.cpp
+++ b/cppe/src/TcpTransport/Acceptor.cpp
@@ -32,8 +32,8 @@ IceInternal::Acceptor::close()
{
if(_traceLevels->network >= 1)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "stopping to accept tcp connections at " << toString();
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "stopping to accept tcp connections at " << toString();
}
SOCKET fd = _fd;
@@ -46,18 +46,18 @@ IceInternal::Acceptor::listen()
{
try
{
- doListen(_fd, _backlog);
+ doListen(_fd, _backlog);
}
catch(...)
{
- _fd = INVALID_SOCKET;
- throw;
+ _fd = INVALID_SOCKET;
+ throw;
}
if(_traceLevels->network >= 1)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "accepting tcp connections at " << toString();
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "accepting tcp connections at " << toString();
}
}
@@ -72,8 +72,8 @@ IceInternal::Acceptor::accept()
if(_traceLevels->network >= 1)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "accepted tcp connection\n" << fdToString(fd);
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "accepted tcp connection\n" << fdToString(fd);
}
return new Transceiver(_instance, fd);
@@ -113,8 +113,8 @@ IceInternal::Acceptor::Acceptor(const InstancePtr& instance, const string& host,
try
{
- _fd = createSocket();
- getAddress(host, port, _addr);
+ _fd = createSocket();
+ getAddress(host, port, _addr);
setTcpBufSize(_fd, _instance->initializationData().properties, _logger);
#ifndef _WIN32
//
@@ -131,17 +131,17 @@ IceInternal::Acceptor::Acceptor(const InstancePtr& instance, const string& host,
//
setReuseAddress(_fd, true);
#endif
- if(_traceLevels->network >= 2)
- {
- Trace out(_logger, _traceLevels->networkCat);
- out << "attempting to bind to tcp socket " << toString();
- }
- doBind(_fd, _addr);
+ if(_traceLevels->network >= 2)
+ {
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "attempting to bind to tcp socket " << toString();
+ }
+ doBind(_fd, _addr);
}
catch(...)
{
- _fd = INVALID_SOCKET;
- throw;
+ _fd = INVALID_SOCKET;
+ throw;
}
}
diff --git a/cppe/src/TcpTransport/Connector.cpp b/cppe/src/TcpTransport/Connector.cpp
index 98d3b95a364..52209fcda50 100644
--- a/cppe/src/TcpTransport/Connector.cpp
+++ b/cppe/src/TcpTransport/Connector.cpp
@@ -26,8 +26,8 @@ Connector::connect(int timeout)
{
if(_traceLevels->network >= 2)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "trying to establish tcp connection to " << toString();
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "trying to establish tcp connection to " << toString();
}
SOCKET fd = createSocket();
@@ -40,8 +40,8 @@ Connector::connect(int timeout)
if(_traceLevels->network >= 1)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "tcp connection established\n" << fdToString(fd);
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "tcp connection established\n" << fdToString(fd);
}
return new Transceiver(_instance, fd);
diff --git a/cppe/src/TcpTransport/EndpointFactory.cpp b/cppe/src/TcpTransport/EndpointFactory.cpp
index 7ac68524733..c6207020d38 100644
--- a/cppe/src/TcpTransport/EndpointFactory.cpp
+++ b/cppe/src/TcpTransport/EndpointFactory.cpp
@@ -51,7 +51,7 @@ IceInternal::EndpointFactory::create(const std::string& str) const
if(protocol == "default" || protocol == "tcp")
{
- return new TcpEndpoint(_instance, str.substr(end));
+ return new TcpEndpoint(_instance, str.substr(end));
}
return 0;
diff --git a/cppe/src/TcpTransport/TcpEndpoint.cpp b/cppe/src/TcpTransport/TcpEndpoint.cpp
index 93e4a9efdca..88adf42bf94 100644
--- a/cppe/src/TcpTransport/TcpEndpoint.cpp
+++ b/cppe/src/TcpTransport/TcpEndpoint.cpp
@@ -46,90 +46,90 @@ IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string&
while(true)
{
- beg = str.find_first_not_of(delim, end);
- if(beg == string::npos)
- {
- break;
- }
-
- end = str.find_first_of(delim, beg);
- if(end == string::npos)
- {
- end = str.length();
- }
-
- string option = str.substr(beg, end - beg);
- if(option.length() != 2 || option[0] != '-')
- {
- EndpointParseException ex(__FILE__, __LINE__);
- ex.str = "tcp " + str;
- throw ex;
- }
-
- string argument;
- string::size_type argumentBeg = str.find_first_not_of(delim, end);
- if(argumentBeg != string::npos && str[argumentBeg] != '-')
- {
- beg = argumentBeg;
- end = str.find_first_of(delim, beg);
- if(end == string::npos)
- {
- end = str.length();
- }
- argument = str.substr(beg, end - beg);
- }
-
- switch(option[1])
- {
- case 'h':
- {
- if(argument.empty())
- {
- EndpointParseException ex(__FILE__, __LINE__);
- ex.str = "tcp " + str;
- throw ex;
- }
- const_cast<string&>(_host) = argument;
- break;
- }
-
- case 'p':
- {
- const_cast<Int&>(_port) = atoi(argument.c_str());
- if(_port <= 0 || _port > 65535)
- {
- EndpointParseException ex(__FILE__, __LINE__);
- ex.str = "tcp " + str;
- throw ex;
- }
- break;
- }
-
- case 't':
- {
- const_cast<Int&>(_timeout) = atoi(argument.c_str());
- if(_timeout == 0)
- {
- EndpointParseException ex(__FILE__, __LINE__);
- ex.str = "tcp " + str;
- throw ex;
- }
- break;
- }
-
- case 'z':
- {
- // Ignore compression flag.
- break;
- }
-
- default:
- {
- EndpointParseException ex(__FILE__, __LINE__);
- ex.str = "tcp " + str;
- throw ex;
- }
- }
+ beg = str.find_first_not_of(delim, end);
+ if(beg == string::npos)
+ {
+ break;
+ }
+
+ end = str.find_first_of(delim, beg);
+ if(end == string::npos)
+ {
+ end = str.length();
+ }
+
+ string option = str.substr(beg, end - beg);
+ if(option.length() != 2 || option[0] != '-')
+ {
+ EndpointParseException ex(__FILE__, __LINE__);
+ ex.str = "tcp " + str;
+ throw ex;
+ }
+
+ string argument;
+ string::size_type argumentBeg = str.find_first_not_of(delim, end);
+ if(argumentBeg != string::npos && str[argumentBeg] != '-')
+ {
+ beg = argumentBeg;
+ end = str.find_first_of(delim, beg);
+ if(end == string::npos)
+ {
+ end = str.length();
+ }
+ argument = str.substr(beg, end - beg);
+ }
+
+ switch(option[1])
+ {
+ case 'h':
+ {
+ if(argument.empty())
+ {
+ EndpointParseException ex(__FILE__, __LINE__);
+ ex.str = "tcp " + str;
+ throw ex;
+ }
+ const_cast<string&>(_host) = argument;
+ break;
+ }
+
+ case 'p':
+ {
+ const_cast<Int&>(_port) = atoi(argument.c_str());
+ if(_port <= 0 || _port > 65535)
+ {
+ EndpointParseException ex(__FILE__, __LINE__);
+ ex.str = "tcp " + str;
+ throw ex;
+ }
+ break;
+ }
+
+ case 't':
+ {
+ const_cast<Int&>(_timeout) = atoi(argument.c_str());
+ if(_timeout == 0)
+ {
+ EndpointParseException ex(__FILE__, __LINE__);
+ ex.str = "tcp " + str;
+ throw ex;
+ }
+ break;
+ }
+
+ case 'z':
+ {
+ // Ignore compression flag.
+ break;
+ }
+
+ default:
+ {
+ EndpointParseException ex(__FILE__, __LINE__);
+ ex.str = "tcp " + str;
+ throw ex;
+ }
+ }
}
}
@@ -194,11 +194,11 @@ IceInternal::TcpEndpoint::timeout(Int timeout) const
{
if(timeout == _timeout)
{
- return const_cast<TcpEndpoint*>(this);
+ return const_cast<TcpEndpoint*>(this);
}
else
{
- return new TcpEndpoint(_instance, _host, _port, timeout, _publish);
+ return new TcpEndpoint(_instance, _host, _port, timeout, _publish);
}
}
@@ -232,42 +232,42 @@ IceInternal::TcpEndpoint::operator==(const Endpoint& r) const
const TcpEndpoint* p = dynamic_cast<const TcpEndpoint*>(&r);
if(!p)
{
- return false;
+ return false;
}
if(this == p)
{
- return true;
+ return true;
}
if(_port != p->_port)
{
- return false;
+ return false;
}
if(_timeout != p->_timeout)
{
- return false;
+ return false;
}
if(_host != p->_host)
{
- //
- // We do the most time-consuming part of the comparison last.
- //
- struct sockaddr_in laddr;
- struct sockaddr_in raddr;
- try
- {
- getAddress(_host, _port, laddr);
- getAddress(p->_host, p->_port, raddr);
- }
- catch(const DNSException&)
- {
- return false;
- }
-
- return compareAddress(laddr, raddr);
+ //
+ // We do the most time-consuming part of the comparison last.
+ //
+ struct sockaddr_in laddr;
+ struct sockaddr_in raddr;
+ try
+ {
+ getAddress(_host, _port, laddr);
+ getAddress(p->_host, p->_port, raddr);
+ }
+ catch(const DNSException&)
+ {
+ return false;
+ }
+
+ return compareAddress(laddr, raddr);
}
return true;
@@ -285,63 +285,63 @@ IceInternal::TcpEndpoint::operator<(const Endpoint& r) const
const TcpEndpoint* p = dynamic_cast<const TcpEndpoint*>(&r);
if(!p)
{
- return type() < r.type();
+ return type() < r.type();
}
if(this == p)
{
- return false;
+ return false;
}
if(_port < p->_port)
{
- return true;
+ return true;
}
else if(p->_port < _port)
{
- return false;
+ return false;
}
if(_timeout < p->_timeout)
{
- return true;
+ return true;
}
else if(p->_timeout < _timeout)
{
- return false;
+ return false;
}
if(_host != p->_host)
{
- //
- // We do the most time-consuming part of the comparison last.
- //
- struct sockaddr_in laddr;
- try
- {
- getAddress(_host, _port, laddr);
- }
- catch(const DNSException&)
- {
- }
-
- struct sockaddr_in raddr;
- try
- {
- getAddress(p->_host, p->_port, raddr);
- }
- catch(const DNSException&)
- {
- }
-
- if(laddr.sin_addr.s_addr < raddr.sin_addr.s_addr)
- {
- return true;
- }
- else if(raddr.sin_addr.s_addr < laddr.sin_addr.s_addr)
- {
- return false;
- }
+ //
+ // We do the most time-consuming part of the comparison last.
+ //
+ struct sockaddr_in laddr;
+ try
+ {
+ getAddress(_host, _port, laddr);
+ }
+ catch(const DNSException&)
+ {
+ }
+
+ struct sockaddr_in raddr;
+ try
+ {
+ getAddress(p->_host, p->_port, raddr);
+ }
+ catch(const DNSException&)
+ {
+ }
+
+ if(laddr.sin_addr.s_addr < raddr.sin_addr.s_addr)
+ {
+ return true;
+ }
+ else if(raddr.sin_addr.s_addr < laddr.sin_addr.s_addr)
+ {
+ return false;
+ }
}
return false;
@@ -355,14 +355,14 @@ IceInternal::TcpEndpoint::expand(bool server) const
const_cast<string&>(_host) = _instance->defaultsAndOverrides()->defaultHost;
if(_host.empty())
{
- if(server)
- {
+ if(server)
+ {
const_cast<string&>(_host) = "0.0.0.0";
- }
- else
- {
+ }
+ else
+ {
const_cast<string&>(_host) = "127.0.0.1";
- }
+ }
}
}
else if(_host == "*")
diff --git a/cppe/src/TcpTransport/Transceiver.cpp b/cppe/src/TcpTransport/Transceiver.cpp
index 6ab0d9b06c8..fa31d1cdd29 100644
--- a/cppe/src/TcpTransport/Transceiver.cpp
+++ b/cppe/src/TcpTransport/Transceiver.cpp
@@ -48,8 +48,8 @@ IceInternal::Transceiver::close()
{
if(_traceLevels->network >= 1)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "closing tcp connection\n" << toString();
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "closing tcp connection\n" << toString();
}
#ifdef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS
@@ -67,13 +67,13 @@ IceInternal::Transceiver::close()
assert(_fd != INVALID_SOCKET);
try
{
- closeSocket(_fd);
- _fd = INVALID_SOCKET;
+ closeSocket(_fd);
+ _fd = INVALID_SOCKET;
}
catch(const SocketException&)
{
- _fd = INVALID_SOCKET;
- throw;
+ _fd = INVALID_SOCKET;
+ throw;
}
}
@@ -82,8 +82,8 @@ IceInternal::Transceiver::shutdownWrite()
{
if(_traceLevels->network >= 2)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "shutting down tcp connection for writing\n" << toString();
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "shutting down tcp connection for writing\n" << toString();
}
assert(_fd != INVALID_SOCKET);
@@ -95,8 +95,8 @@ IceInternal::Transceiver::shutdownReadWrite()
{
if(_traceLevels->network >= 2)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "shutting down tcp connection for reading and writing\n" << toString();
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "shutting down tcp connection for reading and writing\n" << toString();
}
assert(_fd != INVALID_SOCKET);
@@ -115,113 +115,113 @@ IceInternal::Transceiver::writeWithTimeout(Buffer& buf, int timeout)
//
if(packetSize > _maxPacketSize)
{
- packetSize = _maxPacketSize;
+ packetSize = _maxPacketSize;
}
#endif
#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS
if(timeout > 0 && timeout != _writeTimeout)
{
- setTimeout(_fd, false, timeout);
+ setTimeout(_fd, false, timeout);
}
try
- {
+ {
#endif
- while(buf.i != buf.b.end())
- {
- repeatSend:
- assert(_fd != INVALID_SOCKET);
- ssize_t ret = ::send(_fd, reinterpret_cast<const char*>(&*buf.i), packetSize, 0);
-
- if(ret == 0)
- {
- ConnectionLostException ex(__FILE__, __LINE__);
- ex.error = 0;
- throw ex;
- }
-
- if(ret == SOCKET_ERROR)
- {
- if(interrupted())
- {
- goto repeatSend;
- }
-
- if(noBuffers() && packetSize > 1024)
- {
- packetSize /= 2;
- goto repeatSend;
- }
-
+ while(buf.i != buf.b.end())
+ {
+ repeatSend:
+ assert(_fd != INVALID_SOCKET);
+ ssize_t ret = ::send(_fd, reinterpret_cast<const char*>(&*buf.i), packetSize, 0);
+
+ if(ret == 0)
+ {
+ ConnectionLostException ex(__FILE__, __LINE__);
+ ex.error = 0;
+ throw ex;
+ }
+
+ if(ret == SOCKET_ERROR)
+ {
+ if(interrupted())
+ {
+ goto repeatSend;
+ }
+
+ if(noBuffers() && packetSize > 1024)
+ {
+ packetSize /= 2;
+ goto repeatSend;
+ }
+
#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS
- if(timedout())
- {
- throw TimeoutException(__FILE__, __LINE__);
- }
+ if(timedout())
+ {
+ throw TimeoutException(__FILE__, __LINE__);
+ }
#else
- if(wouldBlock())
- {
- doSelect(false, timeout > 0 ? timeout : _writeTimeout);
- continue;
- }
+ if(wouldBlock())
+ {
+ doSelect(false, timeout > 0 ? timeout : _writeTimeout);
+ continue;
+ }
#endif
- if(connectionLost())
- {
- ConnectionLostException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- else
- {
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- }
-
- if(_traceLevels->network >= 3)
- {
- Trace out(_logger, _traceLevels->networkCat);
- out << Ice::printfToString("sent %d of %d", ret, packetSize) << " bytes via tcp\n" << toString();
- }
-
- buf.i += ret;
-
- if(packetSize > buf.b.end() - buf.i)
- {
- packetSize = static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i);
- }
- }
+ if(connectionLost())
+ {
+ ConnectionLostException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ else
+ {
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ }
+
+ if(_traceLevels->network >= 3)
+ {
+ Trace out(_logger, _traceLevels->networkCat);
+ out << Ice::printfToString("sent %d of %d", ret, packetSize) << " bytes via tcp\n" << toString();
+ }
+
+ buf.i += ret;
+
+ if(packetSize > buf.b.end() - buf.i)
+ {
+ packetSize = static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i);
+ }
+ }
#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS
}
catch(const Ice::LocalException&)
{
- if(timeout > 0 && timeout != _writeTimeout)
- {
- try
- {
- setTimeout(_fd, false, _writeTimeout);
- }
- catch(const Ice::LocalException&)
- {
- // IGNORE
- }
- }
- throw;
+ if(timeout > 0 && timeout != _writeTimeout)
+ {
+ try
+ {
+ setTimeout(_fd, false, _writeTimeout);
+ }
+ catch(const Ice::LocalException&)
+ {
+ // IGNORE
+ }
+ }
+ throw;
}
if(timeout > 0 && timeout != _writeTimeout)
{
- try
- {
- setTimeout(_fd, false, _writeTimeout);
- }
- catch(const Ice::LocalException&)
- {
- // IGNORE
- }
+ try
+ {
+ setTimeout(_fd, false, _writeTimeout);
+ }
+ catch(const Ice::LocalException&)
+ {
+ // IGNORE
+ }
}
#endif
}
@@ -232,129 +232,129 @@ IceInternal::Transceiver::readWithTimeout(Buffer& buf, int timeout)
assert(timeout != 0);
Buffer::Container::difference_type packetSize =
- static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i);
+ static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i);
#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS
if(timeout > 0 && timeout != _readTimeout)
{
- setTimeout(_fd, true, timeout);
+ setTimeout(_fd, true, timeout);
}
try
{
#endif
- while(buf.i != buf.b.end())
- {
- repeatRead:
- assert(_fd != INVALID_SOCKET);
- ssize_t ret = ::recv(_fd, reinterpret_cast<char*>(&*buf.i), packetSize, 0);
-
- if(ret == 0)
- {
- //
- // If the connection is lost when reading data, we shut
- // down the write end of the socket. This helps to unblock
- // threads that are stuck in send() or select() while
- // sending data. Note: I don't really understand why
- // send() or select() sometimes don't detect a connection
- // loss. Therefore this helper to make them detect it.
- //
- //assert(_fd != INVALID_SOCKET);
- //shutdownSocketReadWrite(_fd);
-
- ConnectionLostException ex(__FILE__, __LINE__);
- ex.error = 0;
- throw ex;
- }
-
- if(ret == SOCKET_ERROR)
- {
- if(interrupted())
- {
- goto repeatRead;
- }
-
- if(noBuffers() && packetSize > 1024)
- {
- packetSize /= 2;
- goto repeatRead;
- }
-
+ while(buf.i != buf.b.end())
+ {
+ repeatRead:
+ assert(_fd != INVALID_SOCKET);
+ ssize_t ret = ::recv(_fd, reinterpret_cast<char*>(&*buf.i), packetSize, 0);
+
+ if(ret == 0)
+ {
+ //
+ // If the connection is lost when reading data, we shut
+ // down the write end of the socket. This helps to unblock
+ // threads that are stuck in send() or select() while
+ // sending data. Note: I don't really understand why
+ // send() or select() sometimes don't detect a connection
+ // loss. Therefore this helper to make them detect it.
+ //
+ //assert(_fd != INVALID_SOCKET);
+ //shutdownSocketReadWrite(_fd);
+
+ ConnectionLostException ex(__FILE__, __LINE__);
+ ex.error = 0;
+ throw ex;
+ }
+
+ if(ret == SOCKET_ERROR)
+ {
+ if(interrupted())
+ {
+ goto repeatRead;
+ }
+
+ if(noBuffers() && packetSize > 1024)
+ {
+ packetSize /= 2;
+ goto repeatRead;
+ }
+
#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS
- if(timedout())
- {
- throw TimeoutException(__FILE__, __LINE__);
- }
+ if(timedout())
+ {
+ throw TimeoutException(__FILE__, __LINE__);
+ }
#else
- if(wouldBlock())
- {
- doSelect(true, timeout > 0 ? timeout : _readTimeout);
- continue;
- }
+ if(wouldBlock())
+ {
+ doSelect(true, timeout > 0 ? timeout : _readTimeout);
+ continue;
+ }
#endif
-
- if(connectionLost())
- {
- //
- // See the commment above about shutting down the
- // socket if the connection is lost while reading
- // data.
- //
- //assert(_fd != INVALID_SOCKET);
- //shutdownSocketReadWrite(_fd);
-
- ConnectionLostException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- else
- {
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- }
-
- if(_traceLevels->network >= 3)
- {
- Trace out(_logger, _traceLevels->networkCat);
- out << Ice::printfToString("received %d of %d", ret, packetSize) << " bytes via tcp\n" << toString();
- }
-
- buf.i += ret;
-
- if(packetSize > buf.b.end() - buf.i)
- {
- packetSize = static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i);
- }
- }
+
+ if(connectionLost())
+ {
+ //
+ // See the commment above about shutting down the
+ // socket if the connection is lost while reading
+ // data.
+ //
+ //assert(_fd != INVALID_SOCKET);
+ //shutdownSocketReadWrite(_fd);
+
+ ConnectionLostException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ else
+ {
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ }
+
+ if(_traceLevels->network >= 3)
+ {
+ Trace out(_logger, _traceLevels->networkCat);
+ out << Ice::printfToString("received %d of %d", ret, packetSize) << " bytes via tcp\n" << toString();
+ }
+
+ buf.i += ret;
+
+ if(packetSize > buf.b.end() - buf.i)
+ {
+ packetSize = static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i);
+ }
+ }
#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS
}
catch(const Ice::LocalException&)
{
- if(timeout > 0 && timeout != _readTimeout)
- {
- try
- {
- setTimeout(_fd, true, _readTimeout);
- }
- catch(const Ice::LocalException&)
- {
- // IGNORE
- }
- }
- throw;
+ if(timeout > 0 && timeout != _readTimeout)
+ {
+ try
+ {
+ setTimeout(_fd, true, _readTimeout);
+ }
+ catch(const Ice::LocalException&)
+ {
+ // IGNORE
+ }
+ }
+ throw;
}
if(timeout > 0 && timeout != _readTimeout)
{
- try
- {
- setTimeout(_fd, true, _readTimeout);
- }
- catch(const Ice::LocalException&)
- {
- // IGNORE
- }
+ try
+ {
+ setTimeout(_fd, true, _readTimeout);
+ }
+ catch(const Ice::LocalException&)
+ {
+ // IGNORE
+ }
}
#endif
}
@@ -386,24 +386,24 @@ IceInternal::Transceiver::Transceiver(const InstancePtr& instance, SOCKET fd) :
_writeEvent = WSACreateEvent();
if(_event == 0 || _readEvent == 0 || _writeEvent == 0)
{
- int error = WSAGetLastError();
- if(_event != 0)
- {
- WSACloseEvent(_event);
- }
- if(_readEvent != 0)
- {
- WSACloseEvent(_readEvent);
- }
- if(_writeEvent != 0)
- {
- WSACloseEvent(_writeEvent);
- }
- closeSocket(_fd);
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = error;
- throw ex;
+ int error = WSAGetLastError();
+ if(_event != 0)
+ {
+ WSACloseEvent(_event);
+ }
+ if(_readEvent != 0)
+ {
+ WSACloseEvent(_readEvent);
+ }
+ if(_writeEvent != 0)
+ {
+ WSACloseEvent(_writeEvent);
+ }
+ closeSocket(_fd);
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = error;
+ throw ex;
}
//
@@ -411,16 +411,16 @@ IceInternal::Transceiver::Transceiver(const InstancePtr& instance, SOCKET fd) :
//
if(WSAEventSelect(_fd, _event, FD_READ|FD_WRITE|FD_CLOSE) == SOCKET_ERROR)
{
- int error = WSAGetLastError();
+ int error = WSAGetLastError();
- WSACloseEvent(_event);
- WSACloseEvent(_readEvent);
- WSACloseEvent(_writeEvent);
- closeSocket(_fd);
+ WSACloseEvent(_event);
+ WSACloseEvent(_readEvent);
+ WSACloseEvent(_writeEvent);
+ closeSocket(_fd);
- SocketException ex(__FILE__, __LINE__);
- ex.error = error;
- throw ex;
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = error;
+ throw ex;
}
#else
FD_ZERO(&_wFdSet);
@@ -461,151 +461,151 @@ IceInternal::Transceiver::doSelect(bool read, int timeout)
while(true)
{
#ifdef _WIN32
- //
- // This code is basically the same as the code in
- // ::send above. Check that for detailed comments.
- //
- WSAEVENT events[2];
- events[0] = _event;
- events[1] = read ? _readEvent : _writeEvent;
- long tout = (timeout >= 0) ? timeout : WSA_INFINITE;
- DWORD rc = WSAWaitForMultipleEvents(2, events, FALSE, tout, FALSE);
- if(rc == WSA_WAIT_FAILED)
- {
- SocketException ex(__FILE__, __LINE__);
- ex.error = WSAGetLastError();
- throw ex;
- }
- if(rc == WSA_WAIT_TIMEOUT)
- {
- assert(timeout >= 0);
- throw TimeoutException(__FILE__, __LINE__);
- }
-
- if(rc == WSA_WAIT_EVENT_0)
- {
- WSANETWORKEVENTS nevents;
- if(WSAEnumNetworkEvents(_fd, _event, &nevents) == SOCKET_ERROR)
- {
- SocketException ex(__FILE__, __LINE__);
- ex.error = WSAGetLastError();
- throw ex;
- }
-
- //
- // If we're selecting for reading and have consumed a WRITE
- // event, set the _writeEvent event. Otherwise, if we're
- // selecting for writing have consumed a READ event, set the
- // _readEvent event.
- //
- if(read && nevents.lNetworkEvents & FD_WRITE)
- {
- WSASetEvent(_writeEvent);
- }
- else if(!read && nevents.lNetworkEvents & FD_READ)
- {
- WSASetEvent(_readEvent);
- }
-
-
- //
- // This checks for an error on the fd (this would
- // be same as recv itself returning an error). In
- // the event of an error we set the error code,
- // and repeat the error handling.
- //
- if(read && nevents.lNetworkEvents & FD_READ && nevents.iErrorCode[FD_READ_BIT] != 0)
- {
- WSASetLastError(nevents.iErrorCode[FD_READ_BIT]);
- }
- else if(!read && nevents.lNetworkEvents & FD_WRITE && nevents.iErrorCode[FD_WRITE_BIT] != 0)
- {
- WSASetLastError(nevents.iErrorCode[FD_WRITE_BIT]);
- }
- else if(nevents.lNetworkEvents & FD_CLOSE && nevents.iErrorCode[FD_CLOSE_BIT] != 0)
- {
- WSASetLastError(nevents.iErrorCode[FD_CLOSE_BIT]);
- }
- else
- {
- return; // No errors: we're done.
- }
-
- if(interrupted())
- {
- continue;
- }
-
- if(connectionLost())
- {
- //
- // See the commment above about shutting down the
- // socket if the connection is lost while reading
- // data.
- //
- //assert(_fd != INVALID_SOCKET);
- //shutdownSocketReadWrite(_fd);
-
- ConnectionLostException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- else
- {
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
- }
- else
- {
- //
- // Otherwise the _readEvent or _writeEvent is set, reset it.
- //
- if(read)
- {
- WSAResetEvent(_readEvent);
- }
- else
- {
- WSAResetEvent(_writeEvent);
- }
- return;
- }
+ //
+ // This code is basically the same as the code in
+ // ::send above. Check that for detailed comments.
+ //
+ WSAEVENT events[2];
+ events[0] = _event;
+ events[1] = read ? _readEvent : _writeEvent;
+ long tout = (timeout >= 0) ? timeout : WSA_INFINITE;
+ DWORD rc = WSAWaitForMultipleEvents(2, events, FALSE, tout, FALSE);
+ if(rc == WSA_WAIT_FAILED)
+ {
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = WSAGetLastError();
+ throw ex;
+ }
+ if(rc == WSA_WAIT_TIMEOUT)
+ {
+ assert(timeout >= 0);
+ throw TimeoutException(__FILE__, __LINE__);
+ }
+
+ if(rc == WSA_WAIT_EVENT_0)
+ {
+ WSANETWORKEVENTS nevents;
+ if(WSAEnumNetworkEvents(_fd, _event, &nevents) == SOCKET_ERROR)
+ {
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = WSAGetLastError();
+ throw ex;
+ }
+
+ //
+ // If we're selecting for reading and have consumed a WRITE
+ // event, set the _writeEvent event. Otherwise, if we're
+ // selecting for writing have consumed a READ event, set the
+ // _readEvent event.
+ //
+ if(read && nevents.lNetworkEvents & FD_WRITE)
+ {
+ WSASetEvent(_writeEvent);
+ }
+ else if(!read && nevents.lNetworkEvents & FD_READ)
+ {
+ WSASetEvent(_readEvent);
+ }
+
+
+ //
+ // This checks for an error on the fd (this would
+ // be same as recv itself returning an error). In
+ // the event of an error we set the error code,
+ // and repeat the error handling.
+ //
+ if(read && nevents.lNetworkEvents & FD_READ && nevents.iErrorCode[FD_READ_BIT] != 0)
+ {
+ WSASetLastError(nevents.iErrorCode[FD_READ_BIT]);
+ }
+ else if(!read && nevents.lNetworkEvents & FD_WRITE && nevents.iErrorCode[FD_WRITE_BIT] != 0)
+ {
+ WSASetLastError(nevents.iErrorCode[FD_WRITE_BIT]);
+ }
+ else if(nevents.lNetworkEvents & FD_CLOSE && nevents.iErrorCode[FD_CLOSE_BIT] != 0)
+ {
+ WSASetLastError(nevents.iErrorCode[FD_CLOSE_BIT]);
+ }
+ else
+ {
+ return; // No errors: we're done.
+ }
+
+ if(interrupted())
+ {
+ continue;
+ }
+
+ if(connectionLost())
+ {
+ //
+ // See the commment above about shutting down the
+ // socket if the connection is lost while reading
+ // data.
+ //
+ //assert(_fd != INVALID_SOCKET);
+ //shutdownSocketReadWrite(_fd);
+
+ ConnectionLostException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ else
+ {
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+ }
+ else
+ {
+ //
+ // Otherwise the _readEvent or _writeEvent is set, reset it.
+ //
+ if(read)
+ {
+ WSAResetEvent(_readEvent);
+ }
+ else
+ {
+ WSAResetEvent(_writeEvent);
+ }
+ return;
+ }
#else
- int rs;
- assert(_fd != INVALID_SOCKET);
- if(read)
- {
- FD_SET(_fd, &_rFdSet);
- }
- else
- {
- FD_SET(_fd, &_wFdSet);
- }
-
+ int rs;
+ assert(_fd != INVALID_SOCKET);
+ if(read)
+ {
+ FD_SET(_fd, &_rFdSet);
+ }
+ else
+ {
+ FD_SET(_fd, &_wFdSet);
+ }
+
struct pollfd pollFd[1];
pollFd[0].fd = _fd;
pollFd[0].events = read ? POLLIN : POLLOUT;
rs = ::poll(pollFd, 1, timeout);
- if(rs == SOCKET_ERROR)
- {
- if(interrupted())
- {
- continue;
- }
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
- }
-
- if(rs == 0)
- {
- throw TimeoutException(__FILE__, __LINE__);
- }
-
- return;
+ if(rs == SOCKET_ERROR)
+ {
+ if(interrupted())
+ {
+ continue;
+ }
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+
+ if(rs == 0)
+ {
+ throw TimeoutException(__FILE__, __LINE__);
+ }
+
+ return;
#endif
}
}
diff --git a/cppe/test/Common/TestCommon.cpp b/cppe/test/Common/TestCommon.cpp
index c3988919070..1986f42b3d6 100644
--- a/cppe/test/Common/TestCommon.cpp
+++ b/cppe/test/Common/TestCommon.cpp
@@ -29,53 +29,53 @@ public:
virtual void
print(const string& message)
{
- IceUtil::StaticMutex::Lock sync(globalMutex);
- tprintf("%s\n", message.c_str());
+ IceUtil::StaticMutex::Lock sync(globalMutex);
+ tprintf("%s\n", message.c_str());
}
virtual void
trace(const string& category, const string& message)
{
- IceUtil::StaticMutex::Lock sync(globalMutex);
- string s = "[ ";
- {
- char buf[1024];
+ IceUtil::StaticMutex::Lock sync(globalMutex);
+ string s = "[ ";
+ {
+ char buf[1024];
#ifdef _WIN32
- sprintf(buf, "%ld", GetTickCount());
+ sprintf(buf, "%ld", GetTickCount());
#else
- sprintf(buf, "%lu", (long)IceUtil::Time::now().toMilliSeconds());
+ sprintf(buf, "%lu", (long)IceUtil::Time::now().toMilliSeconds());
#endif
- s += buf;
- }
- s += ' ';
-
- if(!category.empty())
- {
- s += category + ": ";
- }
- s += message + " ]";
-
- string::size_type idx = 0;
- while((idx = s.find("\n", idx)) != string::npos)
- {
- s.insert(idx + 1, " ");
- ++idx;
- }
- tprintf("%s\n", s.c_str());
+ s += buf;
+ }
+ s += ' ';
+
+ if(!category.empty())
+ {
+ s += category + ": ";
+ }
+ s += message + " ]";
+
+ string::size_type idx = 0;
+ while((idx = s.find("\n", idx)) != string::npos)
+ {
+ s.insert(idx + 1, " ");
+ ++idx;
+ }
+ tprintf("%s\n", s.c_str());
}
virtual void
warning(const string& message)
{
- IceUtil::StaticMutex::Lock sync(globalMutex);
- tprintf("warning: %s\n", message.c_str());
+ IceUtil::StaticMutex::Lock sync(globalMutex);
+ tprintf("warning: %s\n", message.c_str());
}
virtual void
error(const string& message)
{
- IceUtil::StaticMutex::Lock sync(globalMutex);
- tprintf("error: %s\n", message.c_str());
+ IceUtil::StaticMutex::Lock sync(globalMutex);
+ tprintf("error: %s\n", message.c_str());
}
};
@@ -86,7 +86,7 @@ static bool appTerminated= false;
const TCHAR windowClassName[] = L"Test Driver";
-#define IDC_MAIN_EDIT 101
+#define IDC_MAIN_EDIT 101
class TestSuiteFailed
{
@@ -110,9 +110,9 @@ tprintf(const char* fmt, ...)
if(_tprintfp)
{
- fwrite(buf, strlen(buf), 1, _tprintfp);
- fflush(_tprintfp);
- return;
+ fwrite(buf, strlen(buf), 1, _tprintfp);
+ fflush(_tprintfp);
+ return;
}
char* start = buf;
@@ -120,49 +120,49 @@ tprintf(const char* fmt, ...)
char* curr = start;
while(curr < end)
{
- bool nl = false;
- while(curr < end && *curr != '\n')
- {
- // Not designed to handle \r
- assert(*curr != '\r');
- ++curr;
- }
- if(*curr == '\n')
- {
- nl = true;
- }
- *curr = '\0';
- static TCHAR nlStr[] = L"\r\n";
-
- //
- // If the thread is not the main thread we have to post a message
- // to the main thread to do the EM_REPLACESEL. Calling SendMessage
- // from a thread other than main is not permitted.
- //
- if(IceUtil::ThreadControl() != mainThread)
- {
- wchar_t* wtext = new wchar_t[sizeof(wchar_t) * (curr - start)+1];
- mbstowcs(wtext, start, (curr - start) + 1);
- ::PostMessage(mainWnd, WM_USER, (WPARAM)FALSE, (LPARAM)wtext);
- if(nl)
- {
- wchar_t* wtext = new wchar_t[sizeof(nlStr)];
- wcscpy(wtext, nlStr);
- ::PostMessage(mainWnd, WM_USER, (WPARAM)FALSE, (LPARAM)wtext);
- }
- }
- else
- {
- TCHAR wtext[1024];
- mbstowcs(wtext, start, (curr - start) + 1);
- ::SendMessage(hEdit, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)wtext);
- if(nl)
- {
- ::SendMessage(hEdit, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)nlStr);
- }
- }
- ++curr;
- start = curr;
+ bool nl = false;
+ while(curr < end && *curr != '\n')
+ {
+ // Not designed to handle \r
+ assert(*curr != '\r');
+ ++curr;
+ }
+ if(*curr == '\n')
+ {
+ nl = true;
+ }
+ *curr = '\0';
+ static TCHAR nlStr[] = L"\r\n";
+
+ //
+ // If the thread is not the main thread we have to post a message
+ // to the main thread to do the EM_REPLACESEL. Calling SendMessage
+ // from a thread other than main is not permitted.
+ //
+ if(IceUtil::ThreadControl() != mainThread)
+ {
+ wchar_t* wtext = new wchar_t[sizeof(wchar_t) * (curr - start)+1];
+ mbstowcs(wtext, start, (curr - start) + 1);
+ ::PostMessage(mainWnd, WM_USER, (WPARAM)FALSE, (LPARAM)wtext);
+ if(nl)
+ {
+ wchar_t* wtext = new wchar_t[sizeof(nlStr)];
+ wcscpy(wtext, nlStr);
+ ::PostMessage(mainWnd, WM_USER, (WPARAM)FALSE, (LPARAM)wtext);
+ }
+ }
+ else
+ {
+ TCHAR wtext[1024];
+ mbstowcs(wtext, start, (curr - start) + 1);
+ ::SendMessage(hEdit, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)wtext);
+ if(nl)
+ {
+ ::SendMessage(hEdit, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)nlStr);
+ }
+ }
+ ++curr;
+ start = curr;
}
//
@@ -170,12 +170,12 @@ tprintf(const char* fmt, ...)
//
if(IceUtil::ThreadControl() == mainThread)
{
- MSG Msg;
- while(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
+ MSG Msg;
+ while(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
}
}
@@ -186,50 +186,50 @@ WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_USER:
{
- // tprint from a thread other than main. lParam holds a pointer to the text.
- ::SendMessage(hEdit, EM_REPLACESEL, (WPARAM)wParam, (LPARAM)lParam);
- wchar_t* text = (wchar_t*)lParam;
- delete[] text;
+ // tprint from a thread other than main. lParam holds a pointer to the text.
+ ::SendMessage(hEdit, EM_REPLACESEL, (WPARAM)wParam, (LPARAM)lParam);
+ wchar_t* text = (wchar_t*)lParam;
+ delete[] text;
}
break;
case WM_CREATE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
- WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE,
- 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
- hWnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL);
- assert(hEdit != NULL);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
+ WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE,
+ 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
+ hWnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL);
+ assert(hEdit != NULL);
}
break;
case WM_SIZE:
{
- RECT rcClient;
- GetClientRect(hWnd, &rcClient);
- SetWindowPos(hEdit, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ SetWindowPos(hEdit, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
}
break;
case WM_CLOSE:
{
- DestroyWindow(hWnd);
- break;
+ DestroyWindow(hWnd);
+ break;
}
case WM_QUIT:
case WM_DESTROY:
{
- PostQuitMessage(0);
- IceUtil::StaticMutex::Lock sync(terminatedMutex);
- appTerminated = true;
- break;
+ PostQuitMessage(0);
+ IceUtil::StaticMutex::Lock sync(terminatedMutex);
+ appTerminated = true;
+ break;
}
default:
- return DefWindowProc(hWnd, msg, wParam, lParam);
+ return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
@@ -239,33 +239,33 @@ TestApplication::main(HINSTANCE hInstance)
{
WNDCLASS wc;
- wc.style = CS_HREDRAW|CS_VREDRAW;
- wc.lpfnWndProc = (WNDPROC)WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(NULL, 0);
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
+ wc.style = CS_HREDRAW|CS_VREDRAW;
+ wc.lpfnWndProc = (WNDPROC)WndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = LoadIcon(NULL, 0);
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = windowClassName;
if(!RegisterClass(&wc))
{
- MessageBox(NULL, L"Window Registration Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Registration Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
wchar_t wName[1024] = L"Test";
if(_name.size() > 0)
{
- int len = _name.size();
- if(len > 1023)
- {
- len = 1023;
- }
+ int len = _name.size();
+ if(len > 1023)
+ {
+ len = 1023;
+ }
mbstowcs(wName, _name.c_str(), len);
- wName[len] = L'\0';
+ wName[len] = L'\0';
}
RECT rect;
@@ -273,20 +273,20 @@ TestApplication::main(HINSTANCE hInstance)
int width = rect.right - rect.left;
if(width > 320)
{
- width = 320;
+ width = 320;
}
int height = rect.bottom - rect.top;
if(height > 200)
{
- height = 200;
+ height = 200;
}
mainWnd = CreateWindow(windowClassName, wName, WS_VISIBLE|WS_OVERLAPPED|WS_SYSMENU|WS_SIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, width, height,
- NULL, NULL, hInstance, NULL);
+ CW_USEDEFAULT, CW_USEDEFAULT, width, height,
+ NULL, NULL, hInstance, NULL);
if(mainWnd == NULL)
{
- MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
- return 0;
+ MessageBox(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK);
+ return 0;
}
ShowWindow(mainWnd, SW_SHOW);
@@ -295,59 +295,59 @@ TestApplication::main(HINSTANCE hInstance)
try
{
- extern int __argc;
- extern char **__argv;
- status = run(__argc, __argv);
+ extern int __argc;
+ extern char **__argv;
+ status = run(__argc, __argv);
}
catch(const TestSuiteFailed&)
{
- tprintf("test failed\n");
+ tprintf("test failed\n");
}
catch(const Exception& ex)
{
- tprintf("%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ tprintf("%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
catch(const std::exception& ex)
{
- tprintf("std::exception: %s\n", ex.what());
- status = EXIT_FAILURE;
+ tprintf("std::exception: %s\n", ex.what());
+ status = EXIT_FAILURE;
}
catch(const string& msg)
{
- tprintf("std::string: %s\n", msg.c_str());
- status = EXIT_FAILURE;
+ tprintf("std::string: %s\n", msg.c_str());
+ status = EXIT_FAILURE;
}
catch(const char* msg)
{
- tprintf("const char*: %s\n", msg);
- status = EXIT_FAILURE;
+ tprintf("const char*: %s\n", msg);
+ status = EXIT_FAILURE;
}
catch(...)
{
- tprintf("unknown exception\n");
- status = EXIT_FAILURE;
+ tprintf("unknown exception\n");
+ status = EXIT_FAILURE;
}
MSG Msg;
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
}
if(_communicator)
{
- try
- {
- _communicator->destroy();
- }
- catch(const Exception& ex)
- {
- tprintf("communicator::destroy() failed: %s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
- _communicator = 0;
+ try
+ {
+ _communicator->destroy();
+ }
+ catch(const Exception& ex)
+ {
+ tprintf("communicator::destroy() failed: %s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
+ _communicator = 0;
}
return status;
@@ -366,18 +366,18 @@ TestApplication::loadConfig(const PropertiesPtr& properties)
HANDLE h = FindFirstFile(L"config", &data);
if(h == INVALID_HANDLE_VALUE)
{
- config = "config.txt";
- HANDLE h = FindFirstFile(L"config.txt", &data);
- if(h == INVALID_HANDLE_VALUE)
- {
- return;
- }
+ config = "config.txt";
+ HANDLE h = FindFirstFile(L"config.txt", &data);
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ return;
+ }
}
FindClose(h);
try
{
- properties->load(config);
+ properties->load(config);
}
catch(const FileException&)
{
@@ -407,45 +407,45 @@ TestApplication::main(int ac, char* av[])
int status;
try
{
- status = run(ac, av);
+ status = run(ac, av);
}
catch(const Exception& ex)
{
- tprintf("%s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
+ tprintf("%s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
}
catch(const std::exception& ex)
{
- tprintf("std::exception: %s\n", ex.what());
- status = EXIT_FAILURE;
+ tprintf("std::exception: %s\n", ex.what());
+ status = EXIT_FAILURE;
}
catch(const string& msg)
{
- tprintf("std::string: %s\n", msg.c_str());
- status = EXIT_FAILURE;
+ tprintf("std::string: %s\n", msg.c_str());
+ status = EXIT_FAILURE;
}
catch(const char* msg)
{
- tprintf("const char*: %s\n", msg);
- status = EXIT_FAILURE;
+ tprintf("const char*: %s\n", msg);
+ status = EXIT_FAILURE;
}
catch(...)
{
- tprintf("unknown exception\n");
- status = EXIT_FAILURE;
+ tprintf("unknown exception\n");
+ status = EXIT_FAILURE;
}
if(_communicator)
{
- try
- {
- _communicator->destroy();
- }
- catch(const Exception& ex)
- {
- tprintf("communicator::destroy() failed: %s\n", ex.toString().c_str());
- status = EXIT_FAILURE;
- }
- _communicator = 0;
+ try
+ {
+ _communicator->destroy();
+ }
+ catch(const Exception& ex)
+ {
+ tprintf("communicator::destroy() failed: %s\n", ex.toString().c_str());
+ status = EXIT_FAILURE;
+ }
+ _communicator = 0;
}
return status;
@@ -456,17 +456,17 @@ TestApplication::loadConfig(const PropertiesPtr& properties)
{
try
{
- properties->load("config");
+ properties->load("config");
}
catch(const FileException&)
{
- try
- {
- properties->load("config.txt");
- }
- catch(const FileException&)
- {
- }
+ try
+ {
+ properties->load("config.txt");
+ }
+ catch(const FileException&)
+ {
+ }
}
}
@@ -490,7 +490,7 @@ TestApplication::setCommunicator(const CommunicatorPtr& communicator)
#ifdef _WIN32_WCE
if(communicator->getProperties()->getPropertyWithDefault("LogToFile", "0") != "0")
{
- _tprintfp = fopen(("log-" + _name + ".txt").c_str(), "w");
+ _tprintfp = fopen(("log-" + _name + ".txt").c_str(), "w");
}
#endif
diff --git a/cppe/test/IceE/adapterDeactivation/AllTests.cpp b/cppe/test/IceE/adapterDeactivation/AllTests.cpp
index 6a79adc8808..757d6a8b4f9 100644
--- a/cppe/test/IceE/adapterDeactivation/AllTests.cpp
+++ b/cppe/test/IceE/adapterDeactivation/AllTests.cpp
@@ -37,7 +37,7 @@ allTests(const CommunicatorPtr& communicator)
try
{
communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998");
- test(false);
+ test(false);
}
catch(const AlreadyRegisteredException&)
{
@@ -59,12 +59,12 @@ allTests(const CommunicatorPtr& communicator)
printf("testing whether server is gone...");
try
{
- obj->ice_ping();
- test(false);
+ obj->ice_ping();
+ test(false);
}
catch(const LocalException&)
{
- printf("ok\n");
+ printf("ok\n");
}
return obj;
diff --git a/cppe/test/IceE/adapterDeactivation/Client.cpp b/cppe/test/IceE/adapterDeactivation/Client.cpp
index 26ac34eb9ea..d9fe3d3a7bd 100644
--- a/cppe/test/IceE/adapterDeactivation/Client.cpp
+++ b/cppe/test/IceE/adapterDeactivation/Client.cpp
@@ -27,10 +27,10 @@ public:
virtual int
run(int argc, char* argv[])
{
- Ice::InitializationData initData;
+ Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- loadConfig(initData.properties);
- initData.logger = getLogger();
+ loadConfig(initData.properties);
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
TestIntfPrx allTests(const CommunicatorPtr&);
diff --git a/cppe/test/IceE/adapterDeactivation/Collocated.cpp b/cppe/test/IceE/adapterDeactivation/Collocated.cpp
index 4f250056786..3d7ea8af838 100644
--- a/cppe/test/IceE/adapterDeactivation/Collocated.cpp
+++ b/cppe/test/IceE/adapterDeactivation/Collocated.cpp
@@ -29,10 +29,10 @@ public:
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
diff --git a/cppe/test/IceE/adapterDeactivation/Server.cpp b/cppe/test/IceE/adapterDeactivation/Server.cpp
index 1d9966a9584..e5157db546e 100644
--- a/cppe/test/IceE/adapterDeactivation/Server.cpp
+++ b/cppe/test/IceE/adapterDeactivation/Server.cpp
@@ -32,7 +32,7 @@ public:
initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
diff --git a/cppe/test/IceE/adapterDeactivation/TestI.cpp b/cppe/test/IceE/adapterDeactivation/TestI.cpp
index e75be7a8bb2..31b08d7ba6f 100644
--- a/cppe/test/IceE/adapterDeactivation/TestI.cpp
+++ b/cppe/test/IceE/adapterDeactivation/TestI.cpp
@@ -19,7 +19,7 @@ TestI::transient(const Current& current)
CommunicatorPtr communicator = current.adapter->getCommunicator();
ObjectAdapterPtr adapter =
- communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999");
+ communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999");
adapter->activate();
adapter->deactivate();
adapter->waitForDeactivate();
diff --git a/cppe/test/IceE/custom/AllTests.cpp b/cppe/test/IceE/custom/AllTests.cpp
index 813749e7c8e..24394e1b86d 100644
--- a/cppe/test/IceE/custom/AllTests.cpp
+++ b/cppe/test/IceE/custom/AllTests.cpp
@@ -20,7 +20,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
{
tprintf("testing stringToProxy... ");
string ref = communicator->getProperties()->getPropertyWithDefault(
- "Custom.Proxy", "test:default -p 12010 -t 10000");
+ "Custom.Proxy", "test:default -p 12010 -t 10000");
Ice::ObjectPrx base = communicator->stringToProxy(ref);
test(base);
tprintf("ok\n");
@@ -35,428 +35,428 @@ allTests(const Ice::CommunicatorPtr& communicator)
{
Test::BoolSeq in(5);
- in[0] = false;
- in[1] = true;
- in[2] = true;
- in[3] = false;
- in[4] = true;
- bool inArray[5];
- for(int i = 0; i < 5; ++i)
- {
- inArray[i] = in[i];
- }
- pair<const bool*, const bool*> inPair(inArray, inArray + 5);
-
- Test::BoolSeq out;
- Test::BoolSeq ret = t->opBoolArray(inPair, out);
- test(out == in);
- test(ret == in);
+ in[0] = false;
+ in[1] = true;
+ in[2] = true;
+ in[3] = false;
+ in[4] = true;
+ bool inArray[5];
+ for(int i = 0; i < 5; ++i)
+ {
+ inArray[i] = in[i];
+ }
+ pair<const bool*, const bool*> inPair(inArray, inArray + 5);
+
+ Test::BoolSeq out;
+ Test::BoolSeq ret = t->opBoolArray(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
Test::ByteList in;
- Ice::Byte inArray[5];
- inArray[0] = '1';
- in.push_back(inArray[0]);
- inArray[1] = '2';
- in.push_back(inArray[1]);
- inArray[2] = '3';
- in.push_back(inArray[2]);
- inArray[3] = '4';
- in.push_back(inArray[3]);
- inArray[4] = '5';
- in.push_back(inArray[4]);
- pair<const Ice::Byte*, const Ice::Byte*> inPair(inArray, inArray + 5);
-
- Test::ByteList out;
- Test::ByteList ret = t->opByteArray(inPair, out);
- test(out == in);
- test(ret == in);
+ Ice::Byte inArray[5];
+ inArray[0] = '1';
+ in.push_back(inArray[0]);
+ inArray[1] = '2';
+ in.push_back(inArray[1]);
+ inArray[2] = '3';
+ in.push_back(inArray[2]);
+ inArray[3] = '4';
+ in.push_back(inArray[3]);
+ inArray[4] = '5';
+ in.push_back(inArray[4]);
+ pair<const Ice::Byte*, const Ice::Byte*> inPair(inArray, inArray + 5);
+
+ Test::ByteList out;
+ Test::ByteList ret = t->opByteArray(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
Test::VariableList in;
- Test::Variable inArray[5];
- inArray[0].s = "These";
- in.push_back(inArray[0]);
- inArray[1].s = "are";
- in.push_back(inArray[1]);
- inArray[2].s = "five";
- in.push_back(inArray[2]);
- inArray[3].s = "short";
- in.push_back(inArray[3]);
- inArray[4].s = "strings.";
- in.push_back(inArray[4]);
- pair<const Test::Variable*, const Test::Variable*> inPair(inArray, inArray + 5);
-
- Test::VariableList out;
- Test::VariableList ret = t->opVariableArray(inPair, out);
- test(out == in);
- test(ret == in);
+ Test::Variable inArray[5];
+ inArray[0].s = "These";
+ in.push_back(inArray[0]);
+ inArray[1].s = "are";
+ in.push_back(inArray[1]);
+ inArray[2].s = "five";
+ in.push_back(inArray[2]);
+ inArray[3].s = "short";
+ in.push_back(inArray[3]);
+ inArray[4].s = "strings.";
+ in.push_back(inArray[4]);
+ pair<const Test::Variable*, const Test::Variable*> inPair(inArray, inArray + 5);
+
+ Test::VariableList out;
+ Test::VariableList ret = t->opVariableArray(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
Test::BoolSeq in(5);
- in[0] = false;
- in[1] = true;
- in[2] = true;
- in[3] = false;
- in[4] = true;
- pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> inPair(in.begin(), in.end());
-
- Test::BoolSeq out;
- Test::BoolSeq ret = t->opBoolRange(inPair, out);
- test(out == in);
- test(ret == in);
+ in[0] = false;
+ in[1] = true;
+ in[2] = true;
+ in[3] = false;
+ in[4] = true;
+ pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> inPair(in.begin(), in.end());
+
+ Test::BoolSeq out;
+ Test::BoolSeq ret = t->opBoolRange(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
Test::ByteList in;
- in.push_back('1');
- in.push_back('2');
- in.push_back('3');
- in.push_back('4');
- in.push_back('5');
- pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end());
-
- Test::ByteList out;
- Test::ByteList ret = t->opByteRange(inPair, out);
- test(out == in);
- test(ret == in);
+ in.push_back('1');
+ in.push_back('2');
+ in.push_back('3');
+ in.push_back('4');
+ in.push_back('5');
+ pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end());
+
+ Test::ByteList out;
+ Test::ByteList ret = t->opByteRange(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
Test::VariableList in;
- Test::Variable v;
- v.s = "These";
- in.push_back(v);
- v.s = "are";
- in.push_back(v);
- v.s = "five";
- in.push_back(v);
- v.s = "short";
- in.push_back(v);
- v.s = "strings.";
- in.push_back(v);
- pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> inPair(in.begin(), in.end());
-
- Test::VariableList out;
- Test::VariableList ret = t->opVariableRange(inPair, out);
- test(out == in);
- test(ret == in);
+ Test::Variable v;
+ v.s = "These";
+ in.push_back(v);
+ v.s = "are";
+ in.push_back(v);
+ v.s = "five";
+ in.push_back(v);
+ v.s = "short";
+ in.push_back(v);
+ v.s = "strings.";
+ in.push_back(v);
+ pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> inPair(in.begin(), in.end());
+
+ Test::VariableList out;
+ Test::VariableList ret = t->opVariableRange(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
Test::BoolSeq in(5);
- in[0] = false;
- in[1] = true;
- in[2] = true;
- in[3] = false;
- in[4] = true;
- bool inArray[5];
- for(int i = 0; i < 5; ++i)
- {
- inArray[i] = in[i];
- }
- pair<const bool*, const bool*> inPair(inArray, inArray + 5);
-
- Test::BoolSeq out;
- Test::BoolSeq ret = t->opBoolRangeType(inPair, out);
- test(out == in);
- test(ret == in);
+ in[0] = false;
+ in[1] = true;
+ in[2] = true;
+ in[3] = false;
+ in[4] = true;
+ bool inArray[5];
+ for(int i = 0; i < 5; ++i)
+ {
+ inArray[i] = in[i];
+ }
+ pair<const bool*, const bool*> inPair(inArray, inArray + 5);
+
+ Test::BoolSeq out;
+ Test::BoolSeq ret = t->opBoolRangeType(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
Test::ByteList in;
- in.push_back('1');
- in.push_back('2');
- in.push_back('3');
- in.push_back('4');
- in.push_back('5');
- pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end());
-
- Test::ByteList out;
- Test::ByteList ret = t->opByteRangeType(inPair, out);
- test(out == in);
- test(ret == in);
+ in.push_back('1');
+ in.push_back('2');
+ in.push_back('3');
+ in.push_back('4');
+ in.push_back('5');
+ pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end());
+
+ Test::ByteList out;
+ Test::ByteList ret = t->opByteRangeType(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
Test::VariableList in;
- deque<Test::Variable> inSeq;
- Test::Variable v;
- v.s = "These";
- in.push_back(v);
- inSeq.push_back(v);
- v.s = "are";
- in.push_back(v);
- inSeq.push_back(v);
- v.s = "five";
- in.push_back(v);
- inSeq.push_back(v);
- v.s = "short";
- in.push_back(v);
- inSeq.push_back(v);
- v.s = "strings.";
- in.push_back(v);
- inSeq.push_back(v);
- pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator>
- inPair(inSeq.begin(), inSeq.end());
-
- Test::VariableList out;
- Test::VariableList ret = t->opVariableRangeType(inPair, out);
- test(out == in);
- test(ret == in);
+ deque<Test::Variable> inSeq;
+ Test::Variable v;
+ v.s = "These";
+ in.push_back(v);
+ inSeq.push_back(v);
+ v.s = "are";
+ in.push_back(v);
+ inSeq.push_back(v);
+ v.s = "five";
+ in.push_back(v);
+ inSeq.push_back(v);
+ v.s = "short";
+ in.push_back(v);
+ inSeq.push_back(v);
+ v.s = "strings.";
+ in.push_back(v);
+ inSeq.push_back(v);
+ pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator>
+ inPair(inSeq.begin(), inSeq.end());
+
+ Test::VariableList out;
+ Test::VariableList ret = t->opVariableRangeType(inPair, out);
+ test(out == in);
+ test(ret == in);
}
{
deque<bool> in(5);
- in[0] = false;
- in[1] = true;
- in[2] = true;
- in[3] = false;
- in[4] = true;
-
- deque<bool> out;
- deque<bool> ret = t->opBoolSeq(in, out);
- test(out == in);
- test(ret == in);
+ in[0] = false;
+ in[1] = true;
+ in[2] = true;
+ in[3] = false;
+ in[4] = true;
+
+ deque<bool> out;
+ deque<bool> ret = t->opBoolSeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
list<bool> in;
- in.push_back(false);
- in.push_back(true);
- in.push_back(true);
- in.push_back(false);
- in.push_back(true);
-
- list<bool> out;
- list<bool> ret = t->opBoolList(in, out);
- test(out == in);
- test(ret == in);
+ in.push_back(false);
+ in.push_back(true);
+ in.push_back(true);
+ in.push_back(false);
+ in.push_back(true);
+
+ list<bool> out;
+ list<bool> ret = t->opBoolList(in, out);
+ test(out == in);
+ test(ret == in);
}
{
deque< ::Ice::Byte> in(5);
- in[0] = '1';
- in[1] = '2';
- in[2] = '3';
- in[3] = '4';
- in[4] = '5';
-
- deque< ::Ice::Byte> out;
- deque< ::Ice::Byte> ret = t->opByteSeq(in, out);
- test(out == in);
- test(ret == in);
+ in[0] = '1';
+ in[1] = '2';
+ in[2] = '3';
+ in[3] = '4';
+ in[4] = '5';
+
+ deque< ::Ice::Byte> out;
+ deque< ::Ice::Byte> ret = t->opByteSeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
list< ::Ice::Byte> in;
- in.push_back('1');
- in.push_back('2');
- in.push_back('3');
- in.push_back('4');
- in.push_back('5');
-
- list< ::Ice::Byte> out;
- list< ::Ice::Byte> ret = t->opByteList(in, out);
- test(out == in);
- test(ret == in);
+ in.push_back('1');
+ in.push_back('2');
+ in.push_back('3');
+ in.push_back('4');
+ in.push_back('5');
+
+ list< ::Ice::Byte> out;
+ list< ::Ice::Byte> ret = t->opByteList(in, out);
+ test(out == in);
+ test(ret == in);
}
{
MyByteSeq in(5);
- int i = 0;
- for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p)
- {
- *p = '1' + i++;
- }
-
- MyByteSeq out;
- MyByteSeq ret = t->opMyByteSeq(in, out);
- test(out == in);
- test(ret == in);
+ int i = 0;
+ for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p)
+ {
+ *p = '1' + i++;
+ }
+
+ MyByteSeq out;
+ MyByteSeq ret = t->opMyByteSeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
deque<string> in(5);
- in[0] = "These";
- in[1] = "are";
- in[2] = "five";
- in[3] = "short";
- in[4] = "strings.";
-
- deque<string> out;
- deque<string> ret = t->opStringSeq(in, out);
- test(out == in);
- test(ret == in);
+ in[0] = "These";
+ in[1] = "are";
+ in[2] = "five";
+ in[3] = "short";
+ in[4] = "strings.";
+
+ deque<string> out;
+ deque<string> ret = t->opStringSeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
list<string> in;
- in.push_back("These");
- in.push_back("are");
- in.push_back("five");
- in.push_back("short");
- in.push_back("strings.");
-
- list<string> out;
- list<string> ret = t->opStringList(in, out);
- test(out == in);
- test(ret == in);
+ in.push_back("These");
+ in.push_back("are");
+ in.push_back("five");
+ in.push_back("short");
+ in.push_back("strings.");
+
+ list<string> out;
+ list<string> ret = t->opStringList(in, out);
+ test(out == in);
+ test(ret == in);
}
{
deque<Test::Fixed> in(5);
- in[0].s = 1;
- in[1].s = 2;
- in[2].s = 3;
- in[3].s = 4;
- in[4].s = 5;
-
- deque<Test::Fixed> out;
- deque<Test::Fixed> ret = t->opFixedSeq(in, out);
- test(out == in);
- test(ret == in);
+ in[0].s = 1;
+ in[1].s = 2;
+ in[2].s = 3;
+ in[3].s = 4;
+ in[4].s = 5;
+
+ deque<Test::Fixed> out;
+ deque<Test::Fixed> ret = t->opFixedSeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
list<Test::Fixed> in(5);
- short num = 1;
- for(list<Test::Fixed>::iterator p = in.begin(); p != in.end(); ++p)
- {
- (*p).s = num++;
- }
-
- list<Test::Fixed> out;
- list<Test::Fixed> ret = t->opFixedList(in, out);
- test(out == in);
- test(ret == in);
+ short num = 1;
+ for(list<Test::Fixed>::iterator p = in.begin(); p != in.end(); ++p)
+ {
+ (*p).s = num++;
+ }
+
+ list<Test::Fixed> out;
+ list<Test::Fixed> ret = t->opFixedList(in, out);
+ test(out == in);
+ test(ret == in);
}
{
deque<Test::Variable> in(5);
- in[0].s = "These";
- in[1].s = "are";
- in[2].s = "five";
- in[3].s = "short";
- in[4].s = "strings.";
-
- deque<Test::Variable> out;
- deque<Test::Variable> ret = t->opVariableSeq(in, out);
- test(out == in);
- test(ret == in);
+ in[0].s = "These";
+ in[1].s = "are";
+ in[2].s = "five";
+ in[3].s = "short";
+ in[4].s = "strings.";
+
+ deque<Test::Variable> out;
+ deque<Test::Variable> ret = t->opVariableSeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
list<Test::Variable> in;
- Test::Variable v;
- v.s = "These";
- in.push_back(v);
- v.s = "are";
- in.push_back(v);
- v.s = "five";
- in.push_back(v);
- v.s = "short";
- in.push_back(v);
- v.s = "strings.";
- in.push_back(v);
-
- list<Test::Variable> out;
- list<Test::Variable> ret = t->opVariableList(in, out);
- test(out == in);
- test(ret == in);
+ Test::Variable v;
+ v.s = "These";
+ in.push_back(v);
+ v.s = "are";
+ in.push_back(v);
+ v.s = "five";
+ in.push_back(v);
+ v.s = "short";
+ in.push_back(v);
+ v.s = "strings.";
+ in.push_back(v);
+
+ list<Test::Variable> out;
+ list<Test::Variable> ret = t->opVariableList(in, out);
+ test(out == in);
+ test(ret == in);
}
{
deque<Test::StringStringDict> in(5);
- in[0]["A"] = "a";
- in[1]["B"] = "b";
- in[2]["C"] = "c";
- in[3]["D"] = "d";
- in[4]["E"] = "e";
-
- deque<Test::StringStringDict> out;
- deque<Test::StringStringDict> ret = t->opStringStringDictSeq(in, out);
- test(out == in);
- test(ret == in);
+ in[0]["A"] = "a";
+ in[1]["B"] = "b";
+ in[2]["C"] = "c";
+ in[3]["D"] = "d";
+ in[4]["E"] = "e";
+
+ deque<Test::StringStringDict> out;
+ deque<Test::StringStringDict> ret = t->opStringStringDictSeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
list<Test::StringStringDict> in;
- Test::StringStringDict ssd;
- ssd["A"] = "a";
- in.push_back(ssd);
- ssd["B"] = "b";
- in.push_back(ssd);
- ssd["C"] = "c";
- in.push_back(ssd);
- ssd["D"] = "d";
- in.push_back(ssd);
- ssd["E"] = "e";
- in.push_back(ssd);
-
- list<Test::StringStringDict> out;
- list<Test::StringStringDict> ret = t->opStringStringDictList(in, out);
- test(out == in);
- test(ret == in);
+ Test::StringStringDict ssd;
+ ssd["A"] = "a";
+ in.push_back(ssd);
+ ssd["B"] = "b";
+ in.push_back(ssd);
+ ssd["C"] = "c";
+ in.push_back(ssd);
+ ssd["D"] = "d";
+ in.push_back(ssd);
+ ssd["E"] = "e";
+ in.push_back(ssd);
+
+ list<Test::StringStringDict> out;
+ list<Test::StringStringDict> ret = t->opStringStringDictList(in, out);
+ test(out == in);
+ test(ret == in);
}
{
deque<Test::E> in(5);
- in[0] = Test::E1;
- in[1] = Test::E2;
- in[2] = Test::E3;
- in[3] = Test::E1;
- in[4] = Test::E3;
-
- deque<Test::E> out;
- deque<Test::E> ret = t->opESeq(in, out);
- test(out == in);
- test(ret == in);
+ in[0] = Test::E1;
+ in[1] = Test::E2;
+ in[2] = Test::E3;
+ in[3] = Test::E1;
+ in[4] = Test::E3;
+
+ deque<Test::E> out;
+ deque<Test::E> ret = t->opESeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
list<Test::E> in;
- in.push_back(Test::E1);
- in.push_back(Test::E2);
- in.push_back(Test::E3);
- in.push_back(Test::E1);
- in.push_back(Test::E3);
-
- list<Test::E> out;
- list<Test::E> ret = t->opEList(in, out);
- test(out == in);
- test(ret == in);
+ in.push_back(Test::E1);
+ in.push_back(Test::E2);
+ in.push_back(Test::E3);
+ in.push_back(Test::E1);
+ in.push_back(Test::E3);
+
+ list<Test::E> out;
+ list<Test::E> ret = t->opEList(in, out);
+ test(out == in);
+ test(ret == in);
}
{
deque<Test::CPrx> in(5);
- in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"));
- in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"));
- in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"));
- in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"));
- in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"));
-
- deque<Test::CPrx> out;
- deque<Test::CPrx> ret = t->opCPrxSeq(in, out);
- test(out == in);
- test(ret == in);
+ in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"));
+ in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"));
+ in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"));
+ in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"));
+ in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"));
+
+ deque<Test::CPrx> out;
+ deque<Test::CPrx> ret = t->opCPrxSeq(in, out);
+ test(out == in);
+ test(ret == in);
}
{
list<Test::CPrx> in;
- in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")));
- in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")));
- in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")));
- in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")));
- in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")));
-
- list<Test::CPrx> out;
- list<Test::CPrx> ret = t->opCPrxList(in, out);
- test(out == in);
- test(ret == in);
+ in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")));
+ in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")));
+ in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")));
+ in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")));
+ in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")));
+
+ list<Test::CPrx> out;
+ list<Test::CPrx> ret = t->opCPrxList(in, out);
+ test(out == in);
+ test(ret == in);
}
tprintf("ok\n");
diff --git a/cppe/test/IceE/custom/Client.cpp b/cppe/test/IceE/custom/Client.cpp
index cc2e0e9ca97..cf26bbd15eb 100644
--- a/cppe/test/IceE/custom/Client.cpp
+++ b/cppe/test/IceE/custom/Client.cpp
@@ -28,15 +28,15 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ initData.properties = Ice::createProperties();
#ifdef ICEE_HAS_WSTRING
initData.stringConverter = new Test::StringConverterI();
initData.wstringConverter = new Test::WstringConverterI();
#endif
- loadConfig(initData.properties);
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
+ loadConfig(initData.properties);
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
Test::TestIntfPrx allTests(const Ice::CommunicatorPtr&);
Test::TestIntfPrx test = allTests(communicator());
diff --git a/cppe/test/IceE/custom/Collocated.cpp b/cppe/test/IceE/custom/Collocated.cpp
index 80ce3d19e08..59a5193fd4a 100644
--- a/cppe/test/IceE/custom/Collocated.cpp
+++ b/cppe/test/IceE/custom/Collocated.cpp
@@ -28,21 +28,21 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ initData.properties = Ice::createProperties();
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
- //initData.properties->setProperty("Ice.Trace.Network", "5");
- //initData.properties->setProperty("Ice.Trace.Protocol", "5");
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ //initData.properties->setProperty("Ice.Trace.Network", "5");
+ //initData.properties->setProperty("Ice.Trace.Protocol", "5");
- loadConfig(initData.properties);
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
+ loadConfig(initData.properties);
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
adapter->add(new TestIntfI(communicator()), communicator()->stringToIdentity("test"));
#ifdef ICEE_HAS_WSTRING
- adapter->add(new Test1::WstringClassI, communicator()->stringToIdentity("wstring1"));
- adapter->add(new Test2::WstringClassI, communicator()->stringToIdentity("wstring2"));
+ adapter->add(new Test1::WstringClassI, communicator()->stringToIdentity("wstring1"));
+ adapter->add(new Test2::WstringClassI, communicator()->stringToIdentity("wstring2"));
#endif
adapter->activate();
diff --git a/cppe/test/IceE/custom/MyByteSeq.cpp b/cppe/test/IceE/custom/MyByteSeq.cpp
index 8a24df1026b..d8d346879d9 100644
--- a/cppe/test/IceE/custom/MyByteSeq.cpp
+++ b/cppe/test/IceE/custom/MyByteSeq.cpp
@@ -32,7 +32,7 @@ MyByteSeq::MyByteSeq(const MyByteSeq& seq)
if(_size != 0)
{
_data = (Ice::Byte*)malloc(_size);
- memcpy(_data, seq._data, _size);
+ memcpy(_data, seq._data, _size);
}
else
{
@@ -83,13 +83,13 @@ MyByteSeq::operator=(const MyByteSeq& rhs)
if(_data != 0)
{
free(_data);
- _data = 0;
+ _data = 0;
}
_size = rhs._size;
if(_size != 0)
{
_data = (Ice::Byte*)malloc(_size);
- memcpy(_data, rhs._data, _size);
+ memcpy(_data, rhs._data, _size);
}
}
diff --git a/cppe/test/IceE/custom/Server.cpp b/cppe/test/IceE/custom/Server.cpp
index 30e7fb7bcb4..7c6c556880a 100644
--- a/cppe/test/IceE/custom/Server.cpp
+++ b/cppe/test/IceE/custom/Server.cpp
@@ -29,27 +29,27 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ initData.properties = Ice::createProperties();
#ifdef ICEE_HAS_WSTRING
initData.stringConverter = new Test::StringConverterI();
initData.wstringConverter = new Test::WstringConverterI();
#endif
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
- //initData.properties->setProperty("Ice.Trace.Network", "5");
- //initData.properties->setProperty("Ice.Trace.Protocol", "5");
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ //initData.properties->setProperty("Ice.Trace.Network", "5");
+ //initData.properties->setProperty("Ice.Trace.Protocol", "5");
- loadConfig(initData.properties);
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
-
+ loadConfig(initData.properties);
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
+
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
adapter->add(new TestIntfI(communicator()), communicator()->stringToIdentity("test"));
#ifdef ICEE_HAS_WSTRING
- adapter->add(new Test1::WstringClassI, communicator()->stringToIdentity("wstring1"));
- adapter->add(new Test2::WstringClassI, communicator()->stringToIdentity("wstring2"));
+ adapter->add(new Test1::WstringClassI, communicator()->stringToIdentity("wstring1"));
+ adapter->add(new Test2::WstringClassI, communicator()->stringToIdentity("wstring2"));
#endif
- adapter->activate();
+ adapter->activate();
#ifndef _WIN32_WCE
communicator()->waitForShutdown();
diff --git a/cppe/test/IceE/custom/StringConverterI.cpp b/cppe/test/IceE/custom/StringConverterI.cpp
index 52357b5d9c8..e606044ed70 100644
--- a/cppe/test/IceE/custom/StringConverterI.cpp
+++ b/cppe/test/IceE/custom/StringConverterI.cpp
@@ -34,7 +34,7 @@ Test::StringConverterI::toUTF8(const char* sourceStart, const char* sourceEnd, I
void
Test::StringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd,
- string& target) const
+ string& target) const
{
size_t size = static_cast<size_t>(sourceEnd - sourceStart);
target.resize(size);
@@ -67,7 +67,7 @@ Test::WstringConverterI::toUTF8(const wchar_t* sourceStart, const wchar_t* sourc
void
Test::WstringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd,
- wstring& target) const
+ wstring& target) const
{
size_t size = static_cast<size_t>(sourceEnd - sourceStart);
string s;
diff --git a/cppe/test/IceE/custom/StringConverterI.h b/cppe/test/IceE/custom/StringConverterI.h
index c264ce5e5fc..1981729dc7f 100644
--- a/cppe/test/IceE/custom/StringConverterI.h
+++ b/cppe/test/IceE/custom/StringConverterI.h
@@ -30,7 +30,7 @@ public:
virtual Ice::Byte* toUTF8(const char*, const char*, Ice::UTF8Buffer&) const;
virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd,
- std::string& target) const;
+ std::string& target) const;
};
class WstringConverterI : public Ice::WstringConverter
@@ -39,7 +39,7 @@ public:
virtual Ice::Byte* toUTF8(const wchar_t*, const wchar_t*, Ice::UTF8Buffer&) const;
virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd,
- std::wstring& target) const;
+ std::wstring& target) const;
};
}
diff --git a/cppe/test/IceE/custom/Test.ice b/cppe/test/IceE/custom/Test.ice
index 0fb6800313f..bfa77fb7f58 100644
--- a/cppe/test/IceE/custom/Test.ice
+++ b/cppe/test/IceE/custom/Test.ice
@@ -114,7 +114,7 @@ class TestIntf
["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq
opByteSeq(["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq inSeq,
- out ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq outSeq);
+ out ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq outSeq);
ByteList opByteList(ByteList inSeq, out ByteList outSeq);
@@ -123,7 +123,7 @@ class TestIntf
["cpp:type:std::deque<std::string>"] StringSeq
opStringSeq(["cpp:type:std::deque<std::string>"] StringSeq inSeq,
- out ["cpp:type:std::deque<std::string>"] StringSeq outSeq);
+ out ["cpp:type:std::deque<std::string>"] StringSeq outSeq);
StringList opStringList(StringList inSeq, out StringList outSeq);
@@ -135,13 +135,13 @@ class TestIntf
["cpp:type:std::deque< ::Test::Variable>"] VariableSeq
opVariableSeq(["cpp:type:std::deque< ::Test::Variable>"] VariableSeq inSeq,
- out ["cpp:type:std::deque< ::Test::Variable>"] VariableSeq outSeq);
+ out ["cpp:type:std::deque< ::Test::Variable>"] VariableSeq outSeq);
VariableList opVariableList(VariableList inSeq, out VariableList outSeq);
["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq
opStringStringDictSeq(["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq inSeq,
- out ["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq outSeq);
+ out ["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq outSeq);
StringStringDictList opStringStringDictList(StringStringDictList inSeq, out StringStringDictList outSeq);
@@ -152,7 +152,7 @@ class TestIntf
["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq
opCPrxSeq(["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq inSeq,
- out ["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq outSeq);
+ out ["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq outSeq);
CPrxList opCPrxList(CPrxList inSeq, out CPrxList outSeq);
diff --git a/cppe/test/IceE/custom/TestI.cpp b/cppe/test/IceE/custom/TestI.cpp
index 4e5a8753ed0..26b38f05282 100644
--- a/cppe/test/IceE/custom/TestI.cpp
+++ b/cppe/test/IceE/custom/TestI.cpp
@@ -17,8 +17,8 @@ TestIntfI::TestIntfI(const Ice::CommunicatorPtr& communicator)
Test::BoolSeq
TestIntfI::opBoolArray(const std::pair<const bool*, const bool*>& inSeq,
- Test::BoolSeq& outSeq,
- const Ice::Current& current)
+ Test::BoolSeq& outSeq,
+ const Ice::Current& current)
{
Test::BoolSeq(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -26,8 +26,8 @@ TestIntfI::opBoolArray(const std::pair<const bool*, const bool*>& inSeq,
Test::ByteList
TestIntfI::opByteArray(const std::pair<const Ice::Byte*, const Ice::Byte*>& inSeq,
- Test::ByteList& outSeq,
- const Ice::Current& current)
+ Test::ByteList& outSeq,
+ const Ice::Current& current)
{
Test::ByteList(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -35,8 +35,8 @@ TestIntfI::opByteArray(const std::pair<const Ice::Byte*, const Ice::Byte*>& inSe
Test::VariableList
TestIntfI::opVariableArray(const std::pair<const Test::Variable*, const Test::Variable*>& inSeq,
- Test::VariableList& outSeq,
- const Ice::Current& current)
+ Test::VariableList& outSeq,
+ const Ice::Current& current)
{
Test::VariableList(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -44,8 +44,8 @@ TestIntfI::opVariableArray(const std::pair<const Test::Variable*, const Test::Va
Test::BoolSeq
TestIntfI::opBoolRange(const std::pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>& inSeq,
- Test::BoolSeq& outSeq,
- const Ice::Current&)
+ Test::BoolSeq& outSeq,
+ const Ice::Current&)
{
Test::BoolSeq(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -53,8 +53,8 @@ TestIntfI::opBoolRange(const std::pair<Test::BoolSeq::const_iterator, Test::Bool
Test::ByteList
TestIntfI::opByteRange(const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& inSeq,
- Test::ByteList& outSeq,
- const Ice::Current&)
+ Test::ByteList& outSeq,
+ const Ice::Current&)
{
Test::ByteList(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -62,9 +62,9 @@ TestIntfI::opByteRange(const std::pair<Test::ByteList::const_iterator, Test::Byt
Test::VariableList
TestIntfI::opVariableRange(
- const std::pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>& inSeq,
- Test::VariableList& outSeq,
- const Ice::Current&)
+ const std::pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>& inSeq,
+ Test::VariableList& outSeq,
+ const Ice::Current&)
{
Test::VariableList(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -72,8 +72,8 @@ TestIntfI::opVariableRange(
Test::BoolSeq
TestIntfI::opBoolRangeType(const std::pair<const bool*, const bool*>& inSeq,
- Test::BoolSeq& outSeq,
- const Ice::Current&)
+ Test::BoolSeq& outSeq,
+ const Ice::Current&)
{
Test::BoolSeq(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -81,8 +81,8 @@ TestIntfI::opBoolRangeType(const std::pair<const bool*, const bool*>& inSeq,
Test::ByteList
TestIntfI::opByteRangeType(const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& inSeq,
- Test::ByteList& outSeq,
- const Ice::Current&)
+ Test::ByteList& outSeq,
+ const Ice::Current&)
{
Test::ByteList(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -90,9 +90,9 @@ TestIntfI::opByteRangeType(const std::pair<Test::ByteList::const_iterator, Test:
Test::VariableList
TestIntfI::opVariableRangeType(
- const std::pair<std::deque<Test::Variable>::const_iterator, std::deque<Test::Variable>::const_iterator>& inSeq,
- Test::VariableList& outSeq,
- const Ice::Current&)
+ const std::pair<std::deque<Test::Variable>::const_iterator, std::deque<Test::Variable>::const_iterator>& inSeq,
+ Test::VariableList& outSeq,
+ const Ice::Current&)
{
Test::VariableList(inSeq.first, inSeq.second).swap(outSeq);
return outSeq;
@@ -100,8 +100,8 @@ TestIntfI::opVariableRangeType(
std::deque<bool>
TestIntfI::opBoolSeq(const std::deque<bool>& inSeq,
- std::deque<bool>& outSeq,
- const Ice::Current& current)
+ std::deque<bool>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -109,8 +109,8 @@ TestIntfI::opBoolSeq(const std::deque<bool>& inSeq,
std::list<bool>
TestIntfI::opBoolList(const std::list<bool>& inSeq,
- std::list<bool>& outSeq,
- const Ice::Current& current)
+ std::list<bool>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -118,8 +118,8 @@ TestIntfI::opBoolList(const std::list<bool>& inSeq,
std::deque< ::Ice::Byte>
TestIntfI::opByteSeq(const std::deque< ::Ice::Byte>& inSeq,
- std::deque< ::Ice::Byte>& outSeq,
- const Ice::Current& current)
+ std::deque< ::Ice::Byte>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -127,8 +127,8 @@ TestIntfI::opByteSeq(const std::deque< ::Ice::Byte>& inSeq,
std::list< ::Ice::Byte>
TestIntfI::opByteList(const std::list< ::Ice::Byte>& inSeq,
- std::list< ::Ice::Byte>& outSeq,
- const Ice::Current& current)
+ std::list< ::Ice::Byte>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -136,8 +136,8 @@ TestIntfI::opByteList(const std::list< ::Ice::Byte>& inSeq,
MyByteSeq
TestIntfI::opMyByteSeq(const MyByteSeq& inSeq,
- MyByteSeq& outSeq,
- const Ice::Current& current)
+ MyByteSeq& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -145,8 +145,8 @@ TestIntfI::opMyByteSeq(const MyByteSeq& inSeq,
std::deque< ::std::string>
TestIntfI::opStringSeq(const std::deque< ::std::string>& inSeq,
- std::deque< ::std::string>& outSeq,
- const Ice::Current& current)
+ std::deque< ::std::string>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -154,8 +154,8 @@ TestIntfI::opStringSeq(const std::deque< ::std::string>& inSeq,
std::list< ::std::string>
TestIntfI::opStringList(const std::list< ::std::string>& inSeq,
- std::list< ::std::string>& outSeq,
- const Ice::Current& current)
+ std::list< ::std::string>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -163,8 +163,8 @@ TestIntfI::opStringList(const std::list< ::std::string>& inSeq,
std::deque< ::Test::Fixed>
TestIntfI::opFixedSeq(const std::deque< ::Test::Fixed>& inSeq,
- std::deque< ::Test::Fixed>& outSeq,
- const Ice::Current& current)
+ std::deque< ::Test::Fixed>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -172,8 +172,8 @@ TestIntfI::opFixedSeq(const std::deque< ::Test::Fixed>& inSeq,
std::list< ::Test::Fixed>
TestIntfI::opFixedList(const std::list< ::Test::Fixed>& inSeq,
- std::list< ::Test::Fixed>& outSeq,
- const Ice::Current& current)
+ std::list< ::Test::Fixed>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -181,8 +181,8 @@ TestIntfI::opFixedList(const std::list< ::Test::Fixed>& inSeq,
std::deque< ::Test::Variable>
TestIntfI::opVariableSeq(const std::deque< ::Test::Variable>& inSeq,
- std::deque< ::Test::Variable>& outSeq,
- const Ice::Current& current)
+ std::deque< ::Test::Variable>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
@@ -190,8 +190,8 @@ TestIntfI::opVariableSeq(const std::deque< ::Test::Variable>& inSeq,
std::list< ::Test::Variable>
TestIntfI::opVariableList(const std::list< ::Test::Variable>& inSeq,
- std::list< ::Test::Variable>& outSeq,
- const Ice::Current& current)
+ std::list< ::Test::Variable>& outSeq,
+ const Ice::Current& current)
{
outSeq = inSeq;
return inSeq;
diff --git a/cppe/test/IceE/custom/TestI.h b/cppe/test/IceE/custom/TestI.h
index f9b95108f21..a9e5f529415 100644
--- a/cppe/test/IceE/custom/TestI.h
+++ b/cppe/test/IceE/custom/TestI.h
@@ -19,88 +19,88 @@ public:
TestIntfI(const Ice::CommunicatorPtr&);
virtual Test::BoolSeq opBoolArray(const std::pair<const bool*, const bool*>&,
- Test::BoolSeq&,
- const Ice::Current&);
+ Test::BoolSeq&,
+ const Ice::Current&);
virtual Test::ByteList opByteArray(const std::pair<const Ice::Byte*, const Ice::Byte*>&,
- Test::ByteList&,
- const Ice::Current&);
+ Test::ByteList&,
+ const Ice::Current&);
virtual Test::VariableList opVariableArray(const std::pair<const Test::Variable*, const Test::Variable*>&,
- Test::VariableList&,
- const Ice::Current&);
+ Test::VariableList&,
+ const Ice::Current&);
virtual Test::BoolSeq opBoolRange(const std::pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>&,
- Test::BoolSeq&,
- const Ice::Current&);
+ Test::BoolSeq&,
+ const Ice::Current&);
virtual Test::ByteList opByteRange(const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>&,
- Test::ByteList&,
- const Ice::Current&);
+ Test::ByteList&,
+ const Ice::Current&);
virtual Test::VariableList
opVariableRange(const std::pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>&,
- Test::VariableList&,
- const Ice::Current&);
+ Test::VariableList&,
+ const Ice::Current&);
virtual Test::BoolSeq opBoolRangeType(const std::pair<const bool*, const bool*>&,
- Test::BoolSeq&,
- const Ice::Current&);
+ Test::BoolSeq&,
+ const Ice::Current&);
virtual Test::ByteList opByteRangeType(const std::pair<Test::ByteList::const_iterator,
- Test::ByteList::const_iterator>&,
- Test::ByteList&,
- const Ice::Current&);
+ Test::ByteList::const_iterator>&,
+ Test::ByteList&,
+ const Ice::Current&);
virtual Test::VariableList
opVariableRangeType(const std::pair<std::deque<Test::Variable>::const_iterator,
- std::deque<Test::Variable>::const_iterator>&,
- Test::VariableList&,
- const Ice::Current&);
+ std::deque<Test::Variable>::const_iterator>&,
+ Test::VariableList&,
+ const Ice::Current&);
virtual std::deque<bool> opBoolSeq(const std::deque<bool>&,
- std::deque<bool>&,
- const Ice::Current&);
+ std::deque<bool>&,
+ const Ice::Current&);
virtual std::list<bool> opBoolList(const std::list<bool>&,
- std::list<bool>&,
- const Ice::Current&);
+ std::list<bool>&,
+ const Ice::Current&);
virtual std::deque< ::Ice::Byte> opByteSeq(const std::deque< ::Ice::Byte>&,
- std::deque< ::Ice::Byte>&,
- const Ice::Current&);
+ std::deque< ::Ice::Byte>&,
+ const Ice::Current&);
virtual std::list< ::Ice::Byte> opByteList(const std::list< ::Ice::Byte>&,
- std::list< ::Ice::Byte>&,
- const Ice::Current&);
+ std::list< ::Ice::Byte>&,
+ const Ice::Current&);
virtual MyByteSeq opMyByteSeq(const MyByteSeq&,
- MyByteSeq&,
- const Ice::Current&);
+ MyByteSeq&,
+ const Ice::Current&);
virtual std::deque< ::std::string> opStringSeq(const std::deque< ::std::string>&,
- std::deque< ::std::string>&,
- const Ice::Current&);
+ std::deque< ::std::string>&,
+ const Ice::Current&);
virtual std::list< ::std::string> opStringList(const std::list< ::std::string>&,
- std::list< ::std::string>&,
- const Ice::Current&);
+ std::list< ::std::string>&,
+ const Ice::Current&);
virtual std::deque< ::Test::Fixed> opFixedSeq(const std::deque< ::Test::Fixed>&,
- std::deque< ::Test::Fixed>&,
- const Ice::Current&);
+ std::deque< ::Test::Fixed>&,
+ const Ice::Current&);
virtual std::list< ::Test::Fixed> opFixedList(const std::list< ::Test::Fixed>&,
- std::list< ::Test::Fixed>&,
- const Ice::Current&);
+ std::list< ::Test::Fixed>&,
+ const Ice::Current&);
virtual std::deque< ::Test::Variable> opVariableSeq(const std::deque< ::Test::Variable>&,
- std::deque< ::Test::Variable>&,
- const Ice::Current&);
+ std::deque< ::Test::Variable>&,
+ const Ice::Current&);
virtual std::list< ::Test::Variable> opVariableList(const std::list< ::Test::Variable>&,
- std::list< ::Test::Variable>&,
- const Ice::Current&);
+ std::list< ::Test::Variable>&,
+ const Ice::Current&);
virtual std::deque< ::Test::StringStringDict> opStringStringDictSeq(const std::deque< ::Test::StringStringDict>&,
std::deque< ::Test::StringStringDict>&,
diff --git a/cppe/test/IceE/custom/WstringI.cpp b/cppe/test/IceE/custom/WstringI.cpp
index 46b2208fc9d..05e5fd94e57 100644
--- a/cppe/test/IceE/custom/WstringI.cpp
+++ b/cppe/test/IceE/custom/WstringI.cpp
@@ -15,8 +15,8 @@
::std::wstring
Test1::WstringClassI::opString(const ::std::wstring& s1,
- ::std::wstring& s2,
- const Ice::Current& current)
+ ::std::wstring& s2,
+ const Ice::Current& current)
{
s2 = s1;
return s1;
@@ -24,8 +24,8 @@ Test1::WstringClassI::opString(const ::std::wstring& s1,
::Test1::WstringStruct
Test1::WstringClassI::opStruct(const ::Test1::WstringStruct& s1,
- ::Test1::WstringStruct& s2,
- const Ice::Current& current)
+ ::Test1::WstringStruct& s2,
+ const Ice::Current& current)
{
s2 = s1;
return s1;
@@ -33,7 +33,7 @@ Test1::WstringClassI::opStruct(const ::Test1::WstringStruct& s1,
void
Test1::WstringClassI::throwExcept(const ::std::wstring& reason,
- const Ice::Current& current)
+ const Ice::Current& current)
{
Test1::WstringException ex;
ex.reason = reason;
@@ -42,8 +42,8 @@ Test1::WstringClassI::throwExcept(const ::std::wstring& reason,
::std::wstring
Test2::WstringClassI::opString(const ::std::wstring& s1,
- ::std::wstring& s2,
- const Ice::Current& current)
+ ::std::wstring& s2,
+ const Ice::Current& current)
{
s2 = s1;
return s1;
@@ -51,8 +51,8 @@ Test2::WstringClassI::opString(const ::std::wstring& s1,
::Test2::WstringStruct
Test2::WstringClassI::opStruct(const ::Test2::WstringStruct& s1,
- ::Test2::WstringStruct& s2,
- const Ice::Current& current)
+ ::Test2::WstringStruct& s2,
+ const Ice::Current& current)
{
s2 = s1;
return s1;
@@ -60,7 +60,7 @@ Test2::WstringClassI::opStruct(const ::Test2::WstringStruct& s1,
void
Test2::WstringClassI::throwExcept(const ::std::wstring& reason,
- const Ice::Current& current)
+ const Ice::Current& current)
{
Test2::WstringException ex;
ex.reason = reason;
diff --git a/cppe/test/IceE/custom/WstringI.h b/cppe/test/IceE/custom/WstringI.h
index 7b5104a6ae8..3077a1b3f58 100644
--- a/cppe/test/IceE/custom/WstringI.h
+++ b/cppe/test/IceE/custom/WstringI.h
@@ -24,15 +24,15 @@ class WstringClassI : virtual public WstringClass
public:
virtual ::std::wstring opString(const ::std::wstring&,
- ::std::wstring&,
- const Ice::Current&);
+ ::std::wstring&,
+ const Ice::Current&);
virtual ::Test1::WstringStruct opStruct(const ::Test1::WstringStruct&,
- ::Test1::WstringStruct&,
- const Ice::Current&);
+ ::Test1::WstringStruct&,
+ const Ice::Current&);
virtual void throwExcept(const ::std::wstring&,
- const Ice::Current&);
+ const Ice::Current&);
};
}
@@ -45,15 +45,15 @@ class WstringClassI : virtual public WstringClass
public:
virtual ::std::wstring opString(const ::std::wstring&,
- ::std::wstring&,
- const Ice::Current&);
+ ::std::wstring&,
+ const Ice::Current&);
virtual ::Test2::WstringStruct opStruct(const ::Test2::WstringStruct&,
- ::Test2::WstringStruct&,
- const Ice::Current&);
+ ::Test2::WstringStruct&,
+ const Ice::Current&);
virtual void throwExcept(const ::std::wstring&,
- const Ice::Current&);
+ const Ice::Current&);
};
}
diff --git a/cppe/test/IceE/exceptions/AllTests.cpp b/cppe/test/IceE/exceptions/AllTests.cpp
index f9c3fbc7ebc..142ffc13218 100644
--- a/cppe/test/IceE/exceptions/AllTests.cpp
+++ b/cppe/test/IceE/exceptions/AllTests.cpp
@@ -23,7 +23,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex>
public:
CallbackBase() :
- _called(false)
+ _called(false)
{
}
@@ -33,26 +33,26 @@ public:
bool check()
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- while(!_called)
- {
- if(!timedWait(IceUtil::Time::seconds(5)))
- {
- return false;
- }
- }
- _called = false;
- return true;
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ while(!_called)
+ {
+ if(!timedWait(IceUtil::Time::seconds(5)))
+ {
+ return false;
+ }
+ }
+ _called = false;
+ return true;
}
protected:
void called()
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- assert(!_called);
- _called = true;
- notify();
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ assert(!_called);
+ _called = true;
+ notify();
}
private:
@@ -90,67 +90,67 @@ allTests(const Ice::CommunicatorPtr& communicator)
tprintf("testing object adapter registration exceptions... ");
{
- Ice::ObjectAdapterPtr first = communicator->createObjectAdapter("TestAdapter0");
- try
- {
- Ice::ObjectAdapterPtr second = communicator->createObjectAdapter("TestAdapter0");
- test(false);
- }
- catch(const Ice::AlreadyRegisteredException&)
- {
- // Expected
- }
-
- communicator->getProperties()->setProperty("TestAdapter0.Endpoints", "");
- try
- {
- Ice::ObjectAdapterPtr second =
- communicator->createObjectAdapterWithEndpoints("TestAdapter0", "ssl -h foo -p 12011 -t 10000");
- test(false);
- }
- catch(const Ice::AlreadyRegisteredException&)
- {
- // Expected.
- }
- //
- // Properties must remain unaffected if an exception occurs.
- //
- test(communicator->getProperties()->getProperty("TestAdapter0.Endpoints") == "");
- first->deactivate();
+ Ice::ObjectAdapterPtr first = communicator->createObjectAdapter("TestAdapter0");
+ try
+ {
+ Ice::ObjectAdapterPtr second = communicator->createObjectAdapter("TestAdapter0");
+ test(false);
+ }
+ catch(const Ice::AlreadyRegisteredException&)
+ {
+ // Expected
+ }
+
+ communicator->getProperties()->setProperty("TestAdapter0.Endpoints", "");
+ try
+ {
+ Ice::ObjectAdapterPtr second =
+ communicator->createObjectAdapterWithEndpoints("TestAdapter0", "ssl -h foo -p 12011 -t 10000");
+ test(false);
+ }
+ catch(const Ice::AlreadyRegisteredException&)
+ {
+ // Expected.
+ }
+ //
+ // Properties must remain unaffected if an exception occurs.
+ //
+ test(communicator->getProperties()->getProperty("TestAdapter0.Endpoints") == "");
+ first->deactivate();
}
tprintf("ok\n");
tprintf("testing servant registration exceptions...");
{
- Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter1");
- Ice::ObjectPtr obj = new EmptyI;
- adapter->add(obj, communicator->stringToIdentity("x"));
- try
- {
- adapter->add(obj, communicator->stringToIdentity("x"));
- test(false);
- }
- catch(const Ice::AlreadyRegisteredException&)
- {
- }
-
- adapter->remove(communicator->stringToIdentity("x"));
- try
- {
- adapter->remove(communicator->stringToIdentity("x"));
- test(false);
- }
- catch(const Ice::NotRegisteredException&)
- {
- }
-
- adapter->deactivate();
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter1");
+ Ice::ObjectPtr obj = new EmptyI;
+ adapter->add(obj, communicator->stringToIdentity("x"));
+ try
+ {
+ adapter->add(obj, communicator->stringToIdentity("x"));
+ test(false);
+ }
+ catch(const Ice::AlreadyRegisteredException&)
+ {
+ }
+
+ adapter->remove(communicator->stringToIdentity("x"));
+ try
+ {
+ adapter->remove(communicator->stringToIdentity("x"));
+ test(false);
+ }
+ catch(const Ice::NotRegisteredException&)
+ {
+ }
+
+ adapter->deactivate();
}
tprintf("ok\n");
tprintf("testing stringToProxy...");
string ref = communicator->getProperties()->getPropertyWithDefault(
- "Exception.Proxy", "thrower:default -p 12010 -t 10000");
+ "Exception.Proxy", "thrower:default -p 12010 -t 10000");
Ice::ObjectPrx base = communicator->stringToProxy(ref);
test(base);
tprintf("ok\n");
@@ -165,80 +165,80 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
- thrower->throwAasA(1);
- test(false);
+ thrower->throwAasA(1);
+ test(false);
}
catch(const A& ex)
{
- test(ex.aMem == 1);
+ test(ex.aMem == 1);
}
catch(const Ice::Exception& ex)
{
- tprintf("%s\n", ex.toString().c_str());
- test(false);
+ tprintf("%s\n", ex.toString().c_str());
+ test(false);
}
catch(...)
{
- test(false);
+ test(false);
}
try
{
- thrower->throwAorDasAorD(1);
- test(false);
+ thrower->throwAorDasAorD(1);
+ test(false);
}
catch(const A& ex)
{
- test(ex.aMem == 1);
+ test(ex.aMem == 1);
}
catch(...)
{
- test(false);
+ test(false);
}
try
{
- thrower->throwAorDasAorD(-1);
- test(false);
+ thrower->throwAorDasAorD(-1);
+ test(false);
}
catch(const D& ex)
{
- test(ex.dMem == -1);
+ test(ex.dMem == -1);
}
catch(...)
{
- test(false);
+ test(false);
}
try
{
- thrower->throwBasB(1, 2);
- test(false);
+ thrower->throwBasB(1, 2);
+ test(false);
}
catch(const B& ex)
{
- test(ex.aMem == 1);
- test(ex.bMem == 2);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
}
catch(...)
{
- test(false);
+ test(false);
}
try
{
- thrower->throwCasC(1, 2, 3);
- test(false);
+ thrower->throwCasC(1, 2, 3);
+ test(false);
}
catch(const C& ex)
{
- test(ex.aMem == 1);
- test(ex.bMem == 2);
- test(ex.cMem == 3);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
}
catch(...)
{
- test(false);
+ test(false);
}
#if (!defined(_MSC_VER) || _MSC_VER >= 1300)
@@ -247,23 +247,23 @@ allTests(const Ice::CommunicatorPtr& communicator)
//
try
{
- thrower->throwModA(1, 2);
- test(false);
+ thrower->throwModA(1, 2);
+ test(false);
}
catch(const Mod::A& ex)
{
- test(ex.aMem == 1);
- test(ex.a2Mem == 2);
+ test(ex.aMem == 1);
+ test(ex.a2Mem == 2);
}
catch(const Ice::OperationNotExistException&)
{
- //
+ //
// This operation is not supported in Java.
//
}
catch(...)
{
- test(false);
+ test(false);
}
#endif
@@ -273,31 +273,31 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
- thrower->throwBasB(1, 2);
- test(false);
+ thrower->throwBasB(1, 2);
+ test(false);
}
catch(const A& ex)
{
- test(ex.aMem == 1);
+ test(ex.aMem == 1);
}
catch(...)
{
- test(false);
+ test(false);
}
try
{
- thrower->throwCasC(1, 2, 3);
- test(false);
+ thrower->throwCasC(1, 2, 3);
+ test(false);
}
catch(const B& ex)
{
- test(ex.aMem == 1);
- test(ex.bMem == 2);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
}
catch(...)
{
- test(false);
+ test(false);
}
#if (!defined(_MSC_VER) || _MSC_VER >= 1300)
@@ -306,122 +306,122 @@ allTests(const Ice::CommunicatorPtr& communicator)
//
try
{
- thrower->throwModA(1, 2);
- test(false);
+ thrower->throwModA(1, 2);
+ test(false);
}
catch(const A& ex)
{
- test(ex.aMem == 1);
+ test(ex.aMem == 1);
}
catch(const Ice::OperationNotExistException&)
{
- //
+ //
// This operation is not supported in Java.
//
}
catch(...)
{
- test(false);
+ test(false);
}
#endif
tprintf("ok\n");
tprintf("catching derived types...");
-
+
try
{
- thrower->throwBasA(1, 2);
- test(false);
+ thrower->throwBasA(1, 2);
+ test(false);
}
catch(const B& ex)
{
- test(ex.aMem == 1);
- test(ex.bMem == 2);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
}
catch(...)
{
- test(false);
+ test(false);
}
try
{
- thrower->throwCasA(1, 2, 3);
- test(false);
+ thrower->throwCasA(1, 2, 3);
+ test(false);
}
catch(const C& ex)
{
- test(ex.aMem == 1);
- test(ex.bMem == 2);
- test(ex.cMem == 3);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
}
catch(...)
{
- test(false);
+ test(false);
}
try
{
- thrower->throwCasB(1, 2, 3);
- test(false);
+ thrower->throwCasB(1, 2, 3);
+ test(false);
}
catch(const C& ex)
{
- test(ex.aMem == 1);
- test(ex.bMem == 2);
- test(ex.cMem == 3);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
}
catch(...)
{
- test(false);
+ test(false);
}
tprintf("ok\n");
if(thrower->supportsUndeclaredExceptions())
{
- tprintf("catching unknown user exception...");
-
- try
- {
- thrower->throwUndeclaredA(1);
- test(false);
- }
- catch(const Ice::UnknownUserException&)
- {
- }
- catch(...)
- {
- test(false);
- }
-
- try
- {
- thrower->throwUndeclaredB(1, 2);
- test(false);
- }
- catch(const Ice::UnknownUserException&)
- {
- }
- catch(...)
- {
- test(false);
- }
-
- try
- {
- thrower->throwUndeclaredC(1, 2, 3);
- test(false);
- }
- catch(const Ice::UnknownUserException&)
- {
- }
- catch(...)
- {
- test(false);
- }
-
- tprintf("ok\n");
+ tprintf("catching unknown user exception...");
+
+ try
+ {
+ thrower->throwUndeclaredA(1);
+ test(false);
+ }
+ catch(const Ice::UnknownUserException&)
+ {
+ }
+ catch(...)
+ {
+ test(false);
+ }
+
+ try
+ {
+ thrower->throwUndeclaredB(1, 2);
+ test(false);
+ }
+ catch(const Ice::UnknownUserException&)
+ {
+ }
+ catch(...)
+ {
+ test(false);
+ }
+
+ try
+ {
+ thrower->throwUndeclaredC(1, 2, 3);
+ test(false);
+ }
+ catch(const Ice::UnknownUserException&)
+ {
+ }
+ catch(...)
+ {
+ test(false);
+ }
+
+ tprintf("ok\n");
}
tprintf("catching object not exist exception...");
@@ -429,18 +429,18 @@ allTests(const Ice::CommunicatorPtr& communicator)
Ice::Identity id = communicator->stringToIdentity("does not exist");
try
{
- ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower->ice_identity(id));
- thrower2->throwAasA(1);
-// thrower2->ice_ping();
- test(false);
+ ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower->ice_identity(id));
+ thrower2->throwAasA(1);
+// thrower2->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException& ex)
{
- test(ex.id == id);
+ test(ex.id == id);
}
catch(...)
{
- test(false);
+ test(false);
}
tprintf("ok\n");
@@ -450,12 +450,12 @@ allTests(const Ice::CommunicatorPtr& communicator)
ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower, "no such facet");
try
{
- thrower2->ice_ping();
- test(false);
+ thrower2->ice_ping();
+ test(false);
}
catch(const Ice::FacetNotExistException& ex)
{
- test(ex.facet == "no such facet");
+ test(ex.facet == "no such facet");
}
tprintf("ok\n");
@@ -463,17 +463,17 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
- WrongOperationPrx thrower2 = WrongOperationPrx::uncheckedCast(thrower);
- thrower2->noSuchOperation();
- test(false);
+ WrongOperationPrx thrower2 = WrongOperationPrx::uncheckedCast(thrower);
+ thrower2->noSuchOperation();
+ test(false);
}
catch(const Ice::OperationNotExistException& ex)
{
- test(ex.operation == "noSuchOperation");
+ test(ex.operation == "noSuchOperation");
}
catch(...)
{
- test(false);
+ test(false);
}
tprintf("ok\n");
@@ -482,15 +482,15 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
- thrower->throwLocalException();
- test(false);
+ thrower->throwLocalException();
+ test(false);
}
catch(const Ice::UnknownLocalException&)
{
}
catch(...)
{
- test(false);
+ test(false);
}
tprintf("ok\n");
@@ -499,15 +499,15 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
- thrower->throwNonIceException();
- test(false);
+ thrower->throwNonIceException();
+ test(false);
}
catch(const Ice::UnknownException&)
{
}
catch(...)
{
- assert(false);
+ assert(false);
}
tprintf("ok\n");
diff --git a/cppe/test/IceE/exceptions/Client.cpp b/cppe/test/IceE/exceptions/Client.cpp
index db5a032376c..8eb51491752 100644
--- a/cppe/test/IceE/exceptions/Client.cpp
+++ b/cppe/test/IceE/exceptions/Client.cpp
@@ -29,7 +29,7 @@ public:
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
ThrowerPrx allTests(const Ice::CommunicatorPtr&);
diff --git a/cppe/test/IceE/exceptions/Collocated.cpp b/cppe/test/IceE/exceptions/Collocated.cpp
index 840c87b2cac..1f782485520 100644
--- a/cppe/test/IceE/exceptions/Collocated.cpp
+++ b/cppe/test/IceE/exceptions/Collocated.cpp
@@ -27,13 +27,13 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ initData.properties = Ice::createProperties();
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
diff --git a/cppe/test/IceE/exceptions/Server.cpp b/cppe/test/IceE/exceptions/Server.cpp
index 74d40626abd..3766b81011f 100644
--- a/cppe/test/IceE/exceptions/Server.cpp
+++ b/cppe/test/IceE/exceptions/Server.cpp
@@ -26,12 +26,12 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ initData.properties = Ice::createProperties();
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
@@ -40,7 +40,7 @@ public:
adapter->activate();
#ifndef _WIN32_WCE
- communicator()->waitForShutdown();
+ communicator()->waitForShutdown();
#endif
return EXIT_SUCCESS;
diff --git a/cppe/test/IceE/exceptions/Test.ice b/cppe/test/IceE/exceptions/Test.ice
index aaa85038674..a8446418555 100644
--- a/cppe/test/IceE/exceptions/Test.ice
+++ b/cppe/test/IceE/exceptions/Test.ice
@@ -43,7 +43,7 @@ module Mod
{
exception A extends ::Test::A
{
- int a2Mem;
+ int a2Mem;
};
};
diff --git a/cppe/test/IceE/exceptions/TestI.cpp b/cppe/test/IceE/exceptions/TestI.cpp
index addf3c3bdae..72a0547cf6d 100644
--- a/cppe/test/IceE/exceptions/TestI.cpp
+++ b/cppe/test/IceE/exceptions/TestI.cpp
@@ -52,15 +52,15 @@ ThrowerI::throwAorDasAorD(Ice::Int a, const Ice::Current&)
{
if(a > 0)
{
- A ex;
- ex.aMem = a;
- throw ex;
+ A ex;
+ ex.aMem = a;
+ throw ex;
}
else
{
- D ex;
- ex.dMem = a;
- throw ex;
+ D ex;
+ ex.dMem = a;
+ throw ex;
}
}
diff --git a/cppe/test/IceE/facets/AllTests.cpp b/cppe/test/IceE/facets/AllTests.cpp
index 1618d592b48..4c33df3c372 100644
--- a/cppe/test/IceE/facets/AllTests.cpp
+++ b/cppe/test/IceE/facets/AllTests.cpp
@@ -28,8 +28,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD");
try
{
- adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD");
- test(false);
+ adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD");
+ test(false);
}
catch(Ice::AlreadyRegisteredException&)
{
@@ -37,8 +37,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD");
try
{
- adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD");
- test(false);
+ adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD");
+ test(false);
}
catch(Ice::NotRegisteredException&)
{
@@ -60,8 +60,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
test(fm["f2"] == obj2);
try
{
- adapter->removeAllFacets(communicator->stringToIdentity("id1"));
- test(false);
+ adapter->removeAllFacets(communicator->stringToIdentity("id1"));
+ test(false);
}
catch(Ice::NotRegisteredException&)
{
diff --git a/cppe/test/IceE/facets/Client.cpp b/cppe/test/IceE/facets/Client.cpp
index 648bb51f897..759ff89500d 100644
--- a/cppe/test/IceE/facets/Client.cpp
+++ b/cppe/test/IceE/facets/Client.cpp
@@ -29,7 +29,7 @@ public:
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
GPrx allTests(const Ice::CommunicatorPtr&);
diff --git a/cppe/test/IceE/facets/Collocated.cpp b/cppe/test/IceE/facets/Collocated.cpp
index 5dd2b53ba2b..6783c38ef8c 100644
--- a/cppe/test/IceE/facets/Collocated.cpp
+++ b/cppe/test/IceE/facets/Collocated.cpp
@@ -27,11 +27,11 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ initData.properties = Ice::createProperties();
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
diff --git a/cppe/test/IceE/facets/Server.cpp b/cppe/test/IceE/facets/Server.cpp
index 56761890a34..d19453c2418 100644
--- a/cppe/test/IceE/facets/Server.cpp
+++ b/cppe/test/IceE/facets/Server.cpp
@@ -26,11 +26,11 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ initData.properties = Ice::createProperties();
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
@@ -45,7 +45,7 @@ public:
adapter->activate();
#ifndef _WIN32_WCE
- communicator()->waitForShutdown();
+ communicator()->waitForShutdown();
#endif
return EXIT_SUCCESS;
diff --git a/cppe/test/IceE/faultTolerance/AllTests.cpp b/cppe/test/IceE/faultTolerance/AllTests.cpp
index 6419c459288..00ae6a200d9 100644
--- a/cppe/test/IceE/faultTolerance/AllTests.cpp
+++ b/cppe/test/IceE/faultTolerance/AllTests.cpp
@@ -20,7 +20,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex>
public:
CallbackBase() :
- _called(false)
+ _called(false)
{
}
@@ -30,26 +30,26 @@ public:
bool check()
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- while(!_called)
- {
- if(!timedWait(IceUtil::Time::seconds(30)))
- {
- return false;
- }
- }
- _called = false;
- return true;
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ while(!_called)
+ {
+ if(!timedWait(IceUtil::Time::seconds(30)))
+ {
+ return false;
+ }
+ }
+ _called = false;
+ return true;
}
protected:
void called()
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- assert(!_called);
- _called = true;
- notify();
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ assert(!_called);
+ _called = true;
+ notify();
}
private:
@@ -67,7 +67,7 @@ allTests(const Ice::CommunicatorPtr& communicator, const vector<int>& ports)
for(vector<int>::const_iterator p = ports.begin(); p != ports.end(); ++p)
{
sprintf(buf, ":default -t 60000 -p %d", *p);
- ref += buf;
+ ref += buf;
}
Ice::ObjectPrx base = communicator->stringToProxy(ref);
test(base);
@@ -82,73 +82,73 @@ allTests(const Ice::CommunicatorPtr& communicator, const vector<int>& ports)
int oldPid = 0;
for(unsigned int i = 1, j = 0; i <= ports.size(); ++i, ++j)
{
- if(j > 3)
- {
- j = 0;
- }
-
- tprintf("testing server #%d...", i);
- int pid = obj->pid();
- test(pid != oldPid);
- tprintf("ok\n");
- oldPid = pid;
-
- if(j == 0)
- {
- tprintf("shutting down server #%d...", i);
- obj->shutdown();
- tprintf("ok\n");
- }
- else if(j == 1 || i + 1 > ports.size())
- {
- tprintf("aborting server #%d...", i);
- try
- {
- obj->abort();
- test(false);
- }
- catch(const Ice::ConnectionLostException&)
- {
- tprintf("ok\n");
- }
- catch(const Ice::ConnectFailedException&)
- {
- tprintf("ok\n");
- }
- }
- else if(j == 2 || j == 3)
- {
- tprintf("aborting server #%d and #%d with idempotent call...", i, i + 1);
- try
- {
- obj->idempotentAbort();
- test(false);
- }
- catch(const Ice::ConnectionLostException&)
- {
- tprintf("ok\n");
- }
- catch(const Ice::ConnectFailedException&)
- {
- tprintf("ok\n");
- }
-
- ++i;
- }
- else
- {
- assert(false);
- }
+ if(j > 3)
+ {
+ j = 0;
+ }
+
+ tprintf("testing server #%d...", i);
+ int pid = obj->pid();
+ test(pid != oldPid);
+ tprintf("ok\n");
+ oldPid = pid;
+
+ if(j == 0)
+ {
+ tprintf("shutting down server #%d...", i);
+ obj->shutdown();
+ tprintf("ok\n");
+ }
+ else if(j == 1 || i + 1 > ports.size())
+ {
+ tprintf("aborting server #%d...", i);
+ try
+ {
+ obj->abort();
+ test(false);
+ }
+ catch(const Ice::ConnectionLostException&)
+ {
+ tprintf("ok\n");
+ }
+ catch(const Ice::ConnectFailedException&)
+ {
+ tprintf("ok\n");
+ }
+ }
+ else if(j == 2 || j == 3)
+ {
+ tprintf("aborting server #%d and #%d with idempotent call...", i, i + 1);
+ try
+ {
+ obj->idempotentAbort();
+ test(false);
+ }
+ catch(const Ice::ConnectionLostException&)
+ {
+ tprintf("ok\n");
+ }
+ catch(const Ice::ConnectFailedException&)
+ {
+ tprintf("ok\n");
+ }
+
+ ++i;
+ }
+ else
+ {
+ assert(false);
+ }
}
tprintf("testing whether all servers are gone...");
try
{
- obj->ice_ping();
- test(false);
+ obj->ice_ping();
+ test(false);
}
catch(const Ice::LocalException&)
{
- tprintf("ok\n");
+ tprintf("ok\n");
}
}
diff --git a/cppe/test/IceE/faultTolerance/Client.cpp b/cppe/test/IceE/faultTolerance/Client.cpp
index 0ec60e1dc98..2b02da88245 100644
--- a/cppe/test/IceE/faultTolerance/Client.cpp
+++ b/cppe/test/IceE/faultTolerance/Client.cpp
@@ -31,45 +31,45 @@ public:
virtual int
run(int argc, char* argv[])
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties();
loadConfig(initData.properties);
- //
- // This test aborts servers, so we don't want warnings.
- //
- setCommunicator(Ice::initialize(argc, argv, initData));
- communicator()->getProperties()->setProperty("Ice.Warn.Connections", "0");
+ //
+ // This test aborts servers, so we don't want warnings.
+ //
+ setCommunicator(Ice::initialize(argc, argv, initData));
+ communicator()->getProperties()->setProperty("Ice.Warn.Connections", "0");
vector<int> ports;
for(int i = 1; i < argc; ++i)
{
- if(argv[i][0] == '-')
- {
- tprintf("%s: unknown option `%s'\n", argv[0], argv[i]);
- usage(argv[0]);
- return EXIT_FAILURE;
- }
+ if(argv[i][0] == '-')
+ {
+ tprintf("%s: unknown option `%s'\n", argv[0], argv[i]);
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
- ports.push_back(atoi(argv[i]));
+ ports.push_back(atoi(argv[i]));
}
if(ports.empty())
{
- tprintf("%s: no ports specified\n", argv[0]);
- usage(argv[0]);
- return EXIT_FAILURE;
+ tprintf("%s: no ports specified\n", argv[0]);
+ usage(argv[0]);
+ return EXIT_FAILURE;
}
try
{
- void allTests(const Ice::CommunicatorPtr&, const vector<int>&);
- allTests(communicator(), ports);
+ void allTests(const Ice::CommunicatorPtr&, const vector<int>&);
+ allTests(communicator(), ports);
}
catch(const Ice::Exception& ex)
{
- tprintf("%s\n", ex.toString().c_str());
- test(false);
+ tprintf("%s\n", ex.toString().c_str());
+ test(false);
}
return EXIT_SUCCESS;
diff --git a/cppe/test/IceE/faultTolerance/Server.cpp b/cppe/test/IceE/faultTolerance/Server.cpp
index dd40afbf034..b5aa9db8cc1 100644
--- a/cppe/test/IceE/faultTolerance/Server.cpp
+++ b/cppe/test/IceE/faultTolerance/Server.cpp
@@ -35,34 +35,34 @@ public:
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
int port = 0;
for(int i = 1; i < argc; ++i)
{
- if(argv[i][0] == '-')
- {
- tprintf("%s: unknown option `%s'\n", argv[0], argv[i]);
- usage(argv[0]);
- return EXIT_FAILURE;
- }
+ if(argv[i][0] == '-')
+ {
+ tprintf("%s: unknown option `%s'\n", argv[0], argv[i]);
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
- if(port > 0)
- {
- tprintf("%s: only one port can be specified\n", argv[0]);
- usage(argv[0]);
- return EXIT_FAILURE;
- }
+ if(port > 0)
+ {
+ tprintf("%s: only one port can be specified\n", argv[0]);
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
- port = atoi(argv[i]);
+ port = atoi(argv[i]);
}
if(port <= 0)
{
- tprintf("%s: no port specified\n", argv[0]);
- usage(argv[0]);
- return EXIT_FAILURE;
+ tprintf("%s: no port specified\n", argv[0]);
+ usage(argv[0]);
+ return EXIT_FAILURE;
}
char buf[32];
diff --git a/cppe/test/IceE/inheritance/AllTests.cpp b/cppe/test/IceE/inheritance/AllTests.cpp
index 2717bd60594..3b5c26becf4 100644
--- a/cppe/test/IceE/inheritance/AllTests.cpp
+++ b/cppe/test/IceE/inheritance/AllTests.cpp
@@ -19,7 +19,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
{
tprintf("testing stringToProxy...");
string ref = communicator->getProperties()->getPropertyWithDefault(
- "Inheritance.Proxy", "initial:default -p 12010 -t 10000");
+ "Inheritance.Proxy", "initial:default -p 12010 -t 10000");
Ice::ObjectPrx base = communicator->stringToProxy(ref);
test(base);
tprintf("ok\n");
diff --git a/cppe/test/IceE/inheritance/Client.cpp b/cppe/test/IceE/inheritance/Client.cpp
index a070bb15aef..252454ded15 100644
--- a/cppe/test/IceE/inheritance/Client.cpp
+++ b/cppe/test/IceE/inheritance/Client.cpp
@@ -29,7 +29,7 @@ public:
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
InitialPrx allTests(const Ice::CommunicatorPtr&);
diff --git a/cppe/test/IceE/inheritance/Collocated.cpp b/cppe/test/IceE/inheritance/Collocated.cpp
index 279f6e6334d..009cf007a60 100644
--- a/cppe/test/IceE/inheritance/Collocated.cpp
+++ b/cppe/test/IceE/inheritance/Collocated.cpp
@@ -27,11 +27,11 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ initData.properties = Ice::createProperties();
initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
diff --git a/cppe/test/IceE/inheritance/Server.cpp b/cppe/test/IceE/inheritance/Server.cpp
index 819a636903c..1ef7faa4849 100644
--- a/cppe/test/IceE/inheritance/Server.cpp
+++ b/cppe/test/IceE/inheritance/Server.cpp
@@ -25,12 +25,12 @@ public:
virtual int
run(int argc, char* argv[])
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties();
initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
@@ -39,7 +39,7 @@ public:
adapter->activate();
#ifndef _WIN32_WCE
- communicator()->waitForShutdown();
+ communicator()->waitForShutdown();
#endif
return EXIT_SUCCESS;
diff --git a/cppe/test/IceE/inheritance/TestI.h b/cppe/test/IceE/inheritance/TestI.h
index c6142467982..44d23af9e69 100644
--- a/cppe/test/IceE/inheritance/TestI.h
+++ b/cppe/test/IceE/inheritance/TestI.h
@@ -74,7 +74,7 @@ class IB1I : virtual public Test::MB::IB1, virtual public IAI
{
public:
- virtual Test::MB::IB1Prx ib1op(const Test::MB::IB1Prx&, const Ice::Current&);
+ virtual Test::MB::IB1Prx ib1op(const Test::MB::IB1Prx&, const Ice::Current&);
};
class IB2I : virtual public Test::MB::IB2, virtual public IAI
diff --git a/cppe/test/IceE/location/AllTests.cpp b/cppe/test/IceE/location/AllTests.cpp
index 4d751fd8c57..7d423792675 100644
--- a/cppe/test/IceE/location/AllTests.cpp
+++ b/cppe/test/IceE/location/AllTests.cpp
@@ -27,9 +27,9 @@ void
allTests(const Ice::CommunicatorPtr& communicator)
{
ServerManagerPrx manager = ServerManagerPrx::checkedCast(
- communicator->stringToProxy(
- communicator->getProperties()->getPropertyWithDefault(
- "Location.Proxy", "ServerManager:default -p 12010 -t 10000")));
+ communicator->stringToProxy(
+ communicator->getProperties()->getPropertyWithDefault(
+ "Location.Proxy", "ServerManager:default -p 12010 -t 10000")));
Ice::LocatorPrx locator = Ice::LocatorPrx::uncheckedCast(communicator->getDefaultLocator());
test(manager);
@@ -102,12 +102,12 @@ allTests(const Ice::CommunicatorPtr& communicator)
manager->startServer();
try
{
- obj2 = TestIntfPrx::checkedCast(base2);
- obj2->ice_ping();
+ obj2 = TestIntfPrx::checkedCast(base2);
+ obj2->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
tprintf("ok\n");
@@ -116,12 +116,12 @@ allTests(const Ice::CommunicatorPtr& communicator)
manager->startServer();
try
{
- obj6 = TestIntfPrx::checkedCast(base6);
- obj6->ice_ping();
+ obj6 = TestIntfPrx::checkedCast(base6);
+ obj6->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
tprintf("ok\n");
@@ -130,115 +130,115 @@ allTests(const Ice::CommunicatorPtr& communicator)
manager->startServer();
try
{
- obj3 = TestIntfPrx::checkedCast(base3);
- obj3->ice_ping();
+ obj3 = TestIntfPrx::checkedCast(base3);
+ obj3->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
try
{
- obj2 = TestIntfPrx::checkedCast(base2);
- obj2->ice_ping();
+ obj2 = TestIntfPrx::checkedCast(base2);
+ obj2->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
obj->shutdown();
manager->startServer();
try
{
- obj2 = TestIntfPrx::checkedCast(base2);
- obj2->ice_ping();
+ obj2 = TestIntfPrx::checkedCast(base2);
+ obj2->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
try
{
- obj3 = TestIntfPrx::checkedCast(base3);
- obj3->ice_ping();
+ obj3 = TestIntfPrx::checkedCast(base3);
+ obj3->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
obj->shutdown();
manager->startServer();
try
{
- obj2 = TestIntfPrx::checkedCast(base2);
- obj2->ice_ping();
+ obj2 = TestIntfPrx::checkedCast(base2);
+ obj2->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
obj->shutdown();
manager->startServer();
try
{
- obj3 = TestIntfPrx::checkedCast(base3);
- obj3->ice_ping();
+ obj3 = TestIntfPrx::checkedCast(base3);
+ obj3->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
obj->shutdown();
manager->startServer();
try
{
- obj2 = TestIntfPrx::checkedCast(base2);
- obj2->ice_ping();
+ obj2 = TestIntfPrx::checkedCast(base2);
+ obj2->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
obj->shutdown();
manager->startServer();
try
{
- obj5 = TestIntfPrx::checkedCast(base5);
- obj5->ice_ping();
+ obj5 = TestIntfPrx::checkedCast(base5);
+ obj5->ice_ping();
}
catch(const Ice::LocalException&)
{
- test(false);
+ test(false);
}
tprintf("ok\n");
tprintf("testing reference with unknown identity...");
try
{
- base = communicator->stringToProxy("unknown/unknown");
- base->ice_ping();
- test(false);
+ base = communicator->stringToProxy("unknown/unknown");
+ base->ice_ping();
+ test(false);
}
catch (const Ice::NotRegisteredException& ex)
{
- test(ex.kindOfObject == "object");
- test(ex.id == "unknown/unknown");
+ test(ex.kindOfObject == "object");
+ test(ex.id == "unknown/unknown");
}
tprintf("ok\n");
tprintf("testing reference with unknown adapter...");
try
{
- base = communicator->stringToProxy("test @ TestAdapterUnknown");
- base->ice_ping();
- test(false);
+ base = communicator->stringToProxy("test @ TestAdapterUnknown");
+ base->ice_ping();
+ test(false);
}
catch (const Ice::NotRegisteredException& ex)
{
- test(ex.kindOfObject == "object adapter");
- test(ex.id == "TestAdapterUnknown");
+ test(ex.kindOfObject == "object adapter");
+ test(ex.id == "TestAdapterUnknown");
}
tprintf("ok\n");
@@ -274,24 +274,24 @@ allTests(const Ice::CommunicatorPtr& communicator)
tprintf("testing whether server is gone...");
try
{
- obj2->ice_ping();
- test(false);
+ obj2->ice_ping();
+ test(false);
}
catch(const Ice::LocalException&)
{
}
try
{
- obj3->ice_ping();
- test(false);
+ obj3->ice_ping();
+ test(false);
}
catch(const Ice::LocalException&)
{
}
try
{
- obj5->ice_ping();
- test(false);
+ obj5->ice_ping();
+ test(false);
}
catch(const Ice::LocalException&)
{
diff --git a/cppe/test/IceE/location/Client.cpp b/cppe/test/IceE/location/Client.cpp
index 9e4b52d9410..e0c06ab82d8 100644
--- a/cppe/test/IceE/location/Client.cpp
+++ b/cppe/test/IceE/location/Client.cpp
@@ -29,25 +29,25 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ initData.properties = Ice::createProperties(argc, argv);
loadConfig(initData.properties);
- //
- // For blocking client change retry interval from default.
- //
- if(initData.properties->getPropertyAsInt("Ice.Blocking") > 0)
- {
- initData.properties->setProperty("Ice.RetryIntervals", "0 0");
- initData.properties->setProperty("Ice.Warn.Connections", "0");
- }
-
- initData.properties->setProperty("Ice.Default.Locator",
- initData.properties->getPropertyWithDefault("Location.Locator", "locator:default -p 12010"));
- initData.logger = getLogger();
+ //
+ // For blocking client change retry interval from default.
+ //
+ if(initData.properties->getPropertyAsInt("Ice.Blocking") > 0)
+ {
+ initData.properties->setProperty("Ice.RetryIntervals", "0 0");
+ initData.properties->setProperty("Ice.Warn.Connections", "0");
+ }
+
+ initData.properties->setProperty("Ice.Default.Locator",
+ initData.properties->getPropertyWithDefault("Location.Locator", "locator:default -p 12010"));
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
void allTests(const Ice::CommunicatorPtr&);
- allTests(communicator());
+ allTests(communicator());
return EXIT_SUCCESS;
}
diff --git a/cppe/test/IceE/location/Server.cpp b/cppe/test/IceE/location/Server.cpp
index d600275c265..21d6d1c23eb 100644
--- a/cppe/test/IceE/location/Server.cpp
+++ b/cppe/test/IceE/location/Server.cpp
@@ -29,34 +29,34 @@ public:
virtual int
run(int argc, char* argv[])
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties(argc, argv);
initData.properties->setProperty("ServerManager.Endpoints", "default -p 12010");
loadConfig(initData.properties);
- //
- // For blocking client test, set timeout so CloseConnection send will
- // return quickly. Otherwise server will hang since client is not
- // listening for these messages.
- //
- if(initData.properties->getPropertyAsInt("Ice.Blocking") > 0)
- {
- initData.properties->setProperty("Ice.Override.Timeout", "100");
- initData.properties->setProperty("Ice.Warn.Connections", "0");
- }
-
- //
- // These properties cannot be overridden. The OAs started by
- // the ServerManager must be local.
- //
- initData.properties->setProperty("TestAdapter.Endpoints", "default");
- initData.properties->setProperty("TestAdapter.AdapterId", "TestAdapter");
- initData.properties->setProperty("TestAdapter.ReplicaGroupId", "ReplicatedAdapter");
- initData.properties->setProperty("TestAdapter2.Endpoints", "default");
- initData.properties->setProperty("TestAdapter2.AdapterId", "TestAdapter2");
-
- initData.logger = getLogger();
+ //
+ // For blocking client test, set timeout so CloseConnection send will
+ // return quickly. Otherwise server will hang since client is not
+ // listening for these messages.
+ //
+ if(initData.properties->getPropertyAsInt("Ice.Blocking") > 0)
+ {
+ initData.properties->setProperty("Ice.Override.Timeout", "100");
+ initData.properties->setProperty("Ice.Warn.Connections", "0");
+ }
+
+ //
+ // These properties cannot be overridden. The OAs started by
+ // the ServerManager must be local.
+ //
+ initData.properties->setProperty("TestAdapter.Endpoints", "default");
+ initData.properties->setProperty("TestAdapter.AdapterId", "TestAdapter");
+ initData.properties->setProperty("TestAdapter.ReplicaGroupId", "ReplicatedAdapter");
+ initData.properties->setProperty("TestAdapter2.Endpoints", "default");
+ initData.properties->setProperty("TestAdapter2.AdapterId", "TestAdapter2");
+
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
//
@@ -78,7 +78,7 @@ public:
adapter->add(object, communicator()->stringToIdentity("ServerManager"));
Ice::LocatorRegistryPrx registryPrx =
- Ice::LocatorRegistryPrx::uncheckedCast(adapter->add(registry, communicator()->stringToIdentity("registry")));
+ Ice::LocatorRegistryPrx::uncheckedCast(adapter->add(registry, communicator()->stringToIdentity("registry")));
Ice::LocatorPtr locator = new ServerLocator(registry, registryPrx);
adapter->add(locator, communicator()->stringToIdentity("locator"));
@@ -86,7 +86,7 @@ public:
adapter->activate();
#ifndef _WIN32_WCE
- communicator()->waitForShutdown();
+ communicator()->waitForShutdown();
#endif
return EXIT_SUCCESS;
diff --git a/cppe/test/IceE/location/ServerLocator.cpp b/cppe/test/IceE/location/ServerLocator.cpp
index 03b5aec3986..32ca76d6925 100644
--- a/cppe/test/IceE/location/ServerLocator.cpp
+++ b/cppe/test/IceE/location/ServerLocator.cpp
@@ -23,14 +23,14 @@ ServerLocatorRegistry::ServerLocatorRegistry()
void
ServerLocatorRegistry::setAdapterDirectProxy(const ::std::string& adapter, const ::Ice::ObjectPrx& object,
- const ::Ice::Current&)
+ const ::Ice::Current&)
{
_adapters[adapter] = object;
}
void
ServerLocatorRegistry::setReplicatedAdapterDirectProxy(const std::string& adapter, const std::string& replicaId,
- const ::Ice::ObjectPrx& object, const ::Ice::Current&)
+ const ::Ice::ObjectPrx& object, const ::Ice::Current&)
{
_adapters[adapter] = object;
_adapters[replicaId] = object;
@@ -42,7 +42,7 @@ ServerLocatorRegistry::getAdapter(const ::std::string& adapter) const
::std::map< string, ::Ice::ObjectPrx>::const_iterator p = _adapters.find(adapter);
if(_adapters.find(adapter) == _adapters.end())
{
- throw Ice::AdapterNotFoundException();
+ throw Ice::AdapterNotFoundException();
}
return p->second;
}
@@ -53,7 +53,7 @@ ServerLocatorRegistry::getObject(const ::Ice::Identity& id) const
::std::map< ::Ice::Identity, ::Ice::ObjectPrx>::const_iterator p = _objects.find(id);
if(p == _objects.end())
{
- throw Ice::ObjectNotFoundException();
+ throw Ice::ObjectNotFoundException();
}
return p->second;
diff --git a/cppe/test/IceE/location/ServerLocator.h b/cppe/test/IceE/location/ServerLocator.h
index de2aa01ed89..f9282b9b6d0 100644
--- a/cppe/test/IceE/location/ServerLocator.h
+++ b/cppe/test/IceE/location/ServerLocator.h
@@ -25,7 +25,7 @@ public:
virtual void setAdapterDirectProxy(const ::std::string&, const ::Ice::ObjectPrx&, const ::Ice::Current&);
virtual void setReplicatedAdapterDirectProxy(const std::string&, const ::std::string&, const ::Ice::ObjectPrx&,
- const ::Ice::Current&);
+ const ::Ice::Current&);
//
// Internal method
diff --git a/cppe/test/IceE/location/TestI.cpp b/cppe/test/IceE/location/TestI.cpp
index 98e03f4cd53..7ad7e25aec6 100644
--- a/cppe/test/IceE/location/TestI.cpp
+++ b/cppe/test/IceE/location/TestI.cpp
@@ -19,7 +19,7 @@
using namespace Test;
ServerManagerI::ServerManagerI(const Ice::ObjectAdapterPtr& adapter, const ServerLocatorRegistryPtr& registry,
- const Ice::InitializationData& initData) :
+ const Ice::InitializationData& initData) :
_adapter(adapter), _registry(registry), _initData(initData)
{
@@ -32,8 +32,8 @@ ServerManagerI::startServer(const Ice::Current&)
{
for(::std::vector<Ice::CommunicatorPtr>::const_iterator i = _communicators.begin(); i != _communicators.end(); ++i)
{
- (*i)->waitForShutdown();
- (*i)->destroy();
+ (*i)->waitForShutdown();
+ (*i)->destroy();
}
_communicators.clear();
@@ -78,7 +78,7 @@ ServerManagerI::shutdown(const Ice::Current&)
//
for(::std::vector<Ice::CommunicatorPtr>::const_iterator i = _communicators.begin(); i != _communicators.end(); ++i)
{
- (*i)->destroy();
+ (*i)->destroy();
}
_adapter->getCommunicator()->shutdown();
#ifdef _WIN32_WCE
@@ -87,8 +87,8 @@ ServerManagerI::shutdown(const Ice::Current&)
}
TestI::TestI(const Ice::ObjectAdapterPtr& adapter,
- const Ice::ObjectAdapterPtr& adapter2,
- const ServerLocatorRegistryPtr& registry) :
+ const Ice::ObjectAdapterPtr& adapter2,
+ const ServerLocatorRegistryPtr& registry) :
_adapter1(adapter), _adapter2(adapter2), _registry(registry)
{
_registry->addObject(_adapter1->add(new HelloI(), _adapter1->getCommunicator()->stringToIdentity("hello")));
@@ -104,7 +104,7 @@ HelloPrx
TestI::getHello(const Ice::Current&)
{
return HelloPrx::uncheckedCast(_adapter1->createIndirectProxy(
- _adapter1->getCommunicator()->stringToIdentity("hello")));
+ _adapter1->getCommunicator()->stringToIdentity("hello")));
}
HelloPrx
@@ -119,11 +119,11 @@ TestI::migrateHello(const Ice::Current&)
const Ice::Identity id = _adapter1->getCommunicator()->stringToIdentity("hello");
try
{
- _registry->addObject(_adapter2->add(_adapter1->remove(id), id));
+ _registry->addObject(_adapter2->add(_adapter1->remove(id), id));
}
catch(Ice::NotRegisteredException&)
{
- _registry->addObject(_adapter1->add(_adapter2->remove(id), id));
+ _registry->addObject(_adapter1->add(_adapter2->remove(id), id));
}
}
diff --git a/cppe/test/IceE/location/TestI.h b/cppe/test/IceE/location/TestI.h
index 1cd4f1264b0..2b0286faa9b 100644
--- a/cppe/test/IceE/location/TestI.h
+++ b/cppe/test/IceE/location/TestI.h
@@ -23,7 +23,7 @@ class ServerManagerI : public Test::ServerManager
public:
ServerManagerI(const Ice::ObjectAdapterPtr&, const ServerLocatorRegistryPtr&,
- const Ice::InitializationData&);
+ const Ice::InitializationData&);
virtual void startServer(const Ice::Current&);
virtual void shutdown(const Ice::Current&);
diff --git a/cppe/test/IceE/operations/AllTests.cpp b/cppe/test/IceE/operations/AllTests.cpp
index 81533420a85..668658ddbc7 100644
--- a/cppe/test/IceE/operations/AllTests.cpp
+++ b/cppe/test/IceE/operations/AllTests.cpp
@@ -18,7 +18,7 @@ Test::MyClassPrx
allTests(const Ice::CommunicatorPtr& communicator, const Ice::InitializationData& initData)
{
string ref = communicator->getProperties()->getPropertyWithDefault(
- "Operations.Proxy", "test:default -p 12010 -t 10000");
+ "Operations.Proxy", "test:default -p 12010 -t 10000");
Ice::ObjectPrx base = communicator->stringToProxy(ref);
Test::MyClassPrx cl = Test::MyClassPrx::checkedCast(base);
Test::MyDerivedClassPrx derived = Test::MyDerivedClassPrx::checkedCast(cl);
@@ -27,8 +27,8 @@ allTests(const Ice::CommunicatorPtr& communicator, const Ice::InitializationData
Test::MyClassPrx clTimeout = Test::MyClassPrx::uncheckedCast(cl->ice_timeout(500));
try
{
- clTimeout->opSleep(2000);
- test(false);
+ clTimeout->opSleep(2000);
+ test(false);
}
catch(const Ice::TimeoutException&)
{
diff --git a/cppe/test/IceE/operations/BatchOneways.cpp b/cppe/test/IceE/operations/BatchOneways.cpp
index 289ac8b10a1..e06f351826e 100644
--- a/cppe/test/IceE/operations/BatchOneways.cpp
+++ b/cppe/test/IceE/operations/BatchOneways.cpp
@@ -22,32 +22,32 @@ batchOneways(const Test::MyClassPrx& p)
try
{
- p->opByteSOneway(bs1);
- test(true);
+ p->opByteSOneway(bs1);
+ test(true);
}
catch(const Ice::MemoryLimitException&)
{
- test(false);
+ test(false);
}
try
{
- p->opByteSOneway(bs2);
- test(true);
+ p->opByteSOneway(bs2);
+ test(true);
}
catch(const Ice::MemoryLimitException&)
{
- test(false);
+ test(false);
}
try
{
- p->opByteSOneway(bs3);
- test(false);
+ p->opByteSOneway(bs3);
+ test(false);
}
catch(const Ice::MemoryLimitException&)
{
- test(true);
+ test(true);
}
Test::MyClassPrx batch = Test::MyClassPrx::uncheckedCast(p->ice_batchOneway());
@@ -56,15 +56,15 @@ batchOneways(const Test::MyClassPrx& p)
for(i = 0 ; i < 30 ; ++i)
{
- try
- {
- batch->opByteSOneway(bs1);
- test(true);
- }
- catch(const Ice::MemoryLimitException&)
- {
- test(false);
- }
+ try
+ {
+ batch->opByteSOneway(bs1);
+ test(true);
+ }
+ catch(const Ice::MemoryLimitException&)
+ {
+ test(false);
+ }
}
batch->ice_getConnection()->flushBatchRequests();
diff --git a/cppe/test/IceE/operations/Client.cpp b/cppe/test/IceE/operations/Client.cpp
index f20f755f089..9f5b7d23266 100644
--- a/cppe/test/IceE/operations/Client.cpp
+++ b/cppe/test/IceE/operations/Client.cpp
@@ -26,29 +26,29 @@ public:
virtual int
run(int argc, char* argv[])
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
- //
- // We must set MessageSizeMax to an explicit values, because
- // we run tests to check whether Ice.MemoryLimitException is
- // raised as expected.
- //
- initData.properties->setProperty("Ice.MessageSizeMax", "100");
-
- loadConfig(initData.properties);
-
- //
- // Now parse argc/argv into initData
- //
- initData.properties = Ice::createProperties(argc, argv, initData.properties);
-
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
-
- //
- // We don't want connection warnings because of the timeout test.
- //
- communicator()->getProperties()->setProperty("Ice.Warn.Connections", "0");
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties();
+ //
+ // We must set MessageSizeMax to an explicit values, because
+ // we run tests to check whether Ice.MemoryLimitException is
+ // raised as expected.
+ //
+ initData.properties->setProperty("Ice.MessageSizeMax", "100");
+
+ loadConfig(initData.properties);
+
+ //
+ // Now parse argc/argv into initData
+ //
+ initData.properties = Ice::createProperties(argc, argv, initData.properties);
+
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
+
+ //
+ // We don't want connection warnings because of the timeout test.
+ //
+ communicator()->getProperties()->setProperty("Ice.Warn.Connections", "0");
Test::MyClassPrx allTests(const Ice::CommunicatorPtr&, const Ice::InitializationData&);
Test::MyClassPrx myClass = allTests(communicator(), initData);
@@ -57,8 +57,8 @@ public:
myClass->shutdown();
try
{
- myClass->opVoid();
- test(false);
+ myClass->opVoid();
+ test(false);
}
catch(const Ice::LocalException&)
{
diff --git a/cppe/test/IceE/operations/Collocated.cpp b/cppe/test/IceE/operations/Collocated.cpp
index 467ce78063f..4285fbac0d2 100644
--- a/cppe/test/IceE/operations/Collocated.cpp
+++ b/cppe/test/IceE/operations/Collocated.cpp
@@ -26,26 +26,26 @@ public:
virtual int
run(int argc, char* argv[])
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
-
- //
- // We must set MessageSizeMax to an explicit values, because
- // we run tests to check whether Ice.MemoryLimitException is
- // raised as expected.
- //
- initData.properties->setProperty("Ice.MessageSizeMax", "100");
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
-
- loadConfig(initData.properties);
-
- //
- // Now parse argc/argv into initData.properties
- //
- initData.properties = Ice::createProperties(argc, argv, initData.properties);
-
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties();
+
+ //
+ // We must set MessageSizeMax to an explicit values, because
+ // we run tests to check whether Ice.MemoryLimitException is
+ // raised as expected.
+ //
+ initData.properties->setProperty("Ice.MessageSizeMax", "100");
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+
+ loadConfig(initData.properties);
+
+ //
+ // Now parse argc/argv into initData.properties
+ //
+ initData.properties = Ice::createProperties(argc, argv, initData.properties);
+
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
adapter->add(new MyDerivedClassI, communicator()->stringToIdentity("test"));
diff --git a/cppe/test/IceE/operations/Server.cpp b/cppe/test/IceE/operations/Server.cpp
index 3230ea5f079..8f52f004698 100644
--- a/cppe/test/IceE/operations/Server.cpp
+++ b/cppe/test/IceE/operations/Server.cpp
@@ -27,16 +27,16 @@ public:
run(int argc, char* argv[])
{
Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ initData.properties = Ice::createProperties();
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
- //initData.properties->setProperty("Ice.Trace.Network", "5");
- //initData.properties->setProperty("Ice.Trace.Protocol", "5");
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ //initData.properties->setProperty("Ice.Trace.Network", "5");
+ //initData.properties->setProperty("Ice.Trace.Protocol", "5");
- loadConfig(initData.properties);
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
-
+ loadConfig(initData.properties);
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
+
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
adapter->add(new MyDerivedClassI, communicator()->stringToIdentity("test"));
adapter->activate();
diff --git a/cppe/test/IceE/operations/Test.ice b/cppe/test/IceE/operations/Test.ice
index 16769c4f97b..8363b373ac1 100644
--- a/cppe/test/IceE/operations/Test.ice
+++ b/cppe/test/IceE/operations/Test.ice
@@ -73,75 +73,75 @@ class MyClass
void opSleep(int duration);
byte opByte(byte p1, byte p2,
- out byte p3);
+ out byte p3);
bool opBool(bool p1, bool p2,
- out bool p3);
+ out bool p3);
long opShortIntLong(short p1, int p2, long p3,
- out short p4, out int p5, out long p6);
+ out short p4, out int p5, out long p6);
double opFloatDouble(float p1, double p2,
- out float p3, out double p4);
+ out float p3, out double p4);
string opString(string p1, string p2,
- out string p3);
+ out string p3);
MyEnum opMyEnum(MyEnum p1, out MyEnum p2);
MyClass* opMyClass(MyClass* p1, out MyClass* p2, out MyClass* p3);
Structure opStruct(Structure p1, Structure p2,
- out Structure p3);
+ out Structure p3);
ByteS opByteS(ByteS p1, ByteS p2,
- out ByteS p3);
+ out ByteS p3);
BoolS opBoolS(BoolS p1, BoolS p2,
- out BoolS p3);
+ out BoolS p3);
LongS opShortIntLongS(Test::ShortS p1, IntS p2, LongS p3,
- out ::Test::ShortS p4, out IntS p5, out LongS p6);
+ out ::Test::ShortS p4, out IntS p5, out LongS p6);
DoubleS opFloatDoubleS(FloatS p1, DoubleS p2,
- out FloatS p3, out DoubleS p4);
+ out FloatS p3, out DoubleS p4);
StringS opStringS(StringS p1, StringS p2,
- out StringS p3);
+ out StringS p3);
ByteSS opByteSS(ByteSS p1, ByteSS p2,
- out ByteSS p3);
+ out ByteSS p3);
BoolSS opBoolSS(BoolSS p1, BoolSS p2,
- out BoolSS p3);
+ out BoolSS p3);
LongSS opShortIntLongSS(ShortSS p1, IntSS p2, LongSS p3,
- out ShortSS p4, out IntSS p5, out LongSS p6);
+ out ShortSS p4, out IntSS p5, out LongSS p6);
DoubleSS opFloatDoubleSS(FloatSS p1, DoubleSS p2,
- out FloatSS p3, out DoubleSS p4);
+ out FloatSS p3, out DoubleSS p4);
StringSS opStringSS(StringSS p1, StringSS p2,
- out StringSS p3);
+ out StringSS p3);
StringSSS opStringSSS(StringSSS p1, StringSSS p2,
- out StringSSS p3);
+ out StringSSS p3);
ByteBoolD opByteBoolD(ByteBoolD p1, ByteBoolD p2,
- out ByteBoolD p3);
+ out ByteBoolD p3);
ShortIntD opShortIntD(ShortIntD p1, ShortIntD p2,
- out ShortIntD p3);
+ out ShortIntD p3);
LongFloatD opLongFloatD(LongFloatD p1, LongFloatD p2,
- out LongFloatD p3);
+ out LongFloatD p3);
StringStringD opStringStringD(StringStringD p1, StringStringD p2,
- out StringStringD p3);
+ out StringStringD p3);
StringMyEnumD opStringMyEnumD(StringMyEnumD p1, StringMyEnumD p2,
- out StringMyEnumD p3);
+ out StringMyEnumD p3);
IntS opIntS(IntS s);
diff --git a/cppe/test/IceE/operations/TestI.cpp b/cppe/test/IceE/operations/TestI.cpp
index 014b607afd1..d52d31051a1 100644
--- a/cppe/test/IceE/operations/TestI.cpp
+++ b/cppe/test/IceE/operations/TestI.cpp
@@ -38,9 +38,9 @@ MyDerivedClassI::opSleep(int duration, const Ice::Current&)
Ice::Byte
MyDerivedClassI::opByte(Ice::Byte p1,
- Ice::Byte p2,
- Ice::Byte& p3,
- const Ice::Current&)
+ Ice::Byte p2,
+ Ice::Byte& p3,
+ const Ice::Current&)
{
p3 = p1 ^ p2;
return p1;
@@ -48,9 +48,9 @@ MyDerivedClassI::opByte(Ice::Byte p1,
bool
MyDerivedClassI::opBool(bool p1,
- bool p2,
- bool& p3,
- const Ice::Current&)
+ bool p2,
+ bool& p3,
+ const Ice::Current&)
{
p3 = p1;
return p2;
@@ -58,12 +58,12 @@ MyDerivedClassI::opBool(bool p1,
Ice::Long
MyDerivedClassI::opShortIntLong(Ice::Short p1,
- Ice::Int p2,
- Ice::Long p3,
- Ice::Short& p4,
- Ice::Int& p5,
- Ice::Long& p6,
- const Ice::Current&)
+ Ice::Int p2,
+ Ice::Long p3,
+ Ice::Short& p4,
+ Ice::Int& p5,
+ Ice::Long& p6,
+ const Ice::Current&)
{
p4 = p1;
p5 = p2;
@@ -73,10 +73,10 @@ MyDerivedClassI::opShortIntLong(Ice::Short p1,
Ice::Double
MyDerivedClassI::opFloatDouble(Ice::Float p1,
- Ice::Double p2,
- Ice::Float& p3,
- Ice::Double& p4,
- const Ice::Current&)
+ Ice::Double p2,
+ Ice::Float& p3,
+ Ice::Double& p4,
+ const Ice::Current&)
{
p3 = p1;
p4 = p2;
@@ -85,9 +85,9 @@ MyDerivedClassI::opFloatDouble(Ice::Float p1,
std::string
MyDerivedClassI::opString(const std::string& p1,
- const std::string& p2,
- std::string& p3,
- const Ice::Current&)
+ const std::string& p2,
+ std::string& p3,
+ const Ice::Current&)
{
p3 = p2 + " " + p1;
return p1 + " " + p2;
@@ -95,8 +95,8 @@ MyDerivedClassI::opString(const std::string& p1,
Test::MyEnum
MyDerivedClassI::opMyEnum(Test::MyEnum p1,
- Test::MyEnum& p2,
- const Ice::Current&)
+ Test::MyEnum& p2,
+ const Ice::Current&)
{
p2 = p1;
return Test::enum3;
@@ -104,21 +104,21 @@ MyDerivedClassI::opMyEnum(Test::MyEnum p1,
Test::MyClassPrx
MyDerivedClassI::opMyClass(const Test::MyClassPrx& p1,
- Test::MyClassPrx& p2,
- Test::MyClassPrx& p3,
- const Ice::Current& current)
+ Test::MyClassPrx& p2,
+ Test::MyClassPrx& p3,
+ const Ice::Current& current)
{
p2 = p1;
p3 = Test::MyClassPrx::uncheckedCast(current.adapter->createProxy(
- current.adapter->getCommunicator()->stringToIdentity("noSuchIdentity")));
+ current.adapter->getCommunicator()->stringToIdentity("noSuchIdentity")));
return Test::MyClassPrx::uncheckedCast(current.adapter->createProxy(current.id));
}
Test::Structure
MyDerivedClassI::opStruct(const Test::Structure& p1,
- const ::Test::Structure& p2,
- ::Test::Structure& p3,
- const Ice::Current&)
+ const ::Test::Structure& p2,
+ ::Test::Structure& p3,
+ const Ice::Current&)
{
p3 = p1;
p3.s.s = "a new string";
@@ -127,9 +127,9 @@ MyDerivedClassI::opStruct(const Test::Structure& p1,
Test::ByteS
MyDerivedClassI::opByteS(const Test::ByteS& p1,
- const Test::ByteS& p2,
- Test::ByteS& p3,
- const Ice::Current&)
+ const Test::ByteS& p2,
+ Test::ByteS& p3,
+ const Ice::Current&)
{
p3.resize(p1.size());
std::reverse_copy(p1.begin(), p1.end(), p3.begin());
@@ -140,9 +140,9 @@ MyDerivedClassI::opByteS(const Test::ByteS& p1,
Test::BoolS
MyDerivedClassI::opBoolS(const Test::BoolS& p1,
- const Test::BoolS& p2,
- Test::BoolS& p3,
- const Ice::Current&)
+ const Test::BoolS& p2,
+ Test::BoolS& p3,
+ const Ice::Current&)
{
p3 = p1;
std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
@@ -154,12 +154,12 @@ MyDerivedClassI::opBoolS(const Test::BoolS& p1,
Test::LongS
MyDerivedClassI::opShortIntLongS(const Test::ShortS& p1,
- const Test::IntS& p2,
- const Test::LongS& p3,
- Test::ShortS& p4,
- Test::IntS& p5,
- Test::LongS& p6,
- const Ice::Current&)
+ const Test::IntS& p2,
+ const Test::LongS& p3,
+ Test::ShortS& p4,
+ Test::IntS& p5,
+ Test::LongS& p6,
+ const Ice::Current&)
{
p4 = p1;
p5.resize(p2.size());
@@ -171,10 +171,10 @@ MyDerivedClassI::opShortIntLongS(const Test::ShortS& p1,
Test::DoubleS
MyDerivedClassI::opFloatDoubleS(const Test::FloatS& p1,
- const Test::DoubleS& p2,
- Test::FloatS& p3,
- Test::DoubleS& p4,
- const Ice::Current&)
+ const Test::DoubleS& p2,
+ Test::FloatS& p3,
+ Test::DoubleS& p4,
+ const Ice::Current&)
{
p3 = p1;
p4.resize(p2.size());
@@ -186,9 +186,9 @@ MyDerivedClassI::opFloatDoubleS(const Test::FloatS& p1,
Test::StringS
MyDerivedClassI::opStringS(const Test::StringS& p1,
- const Test::StringS& p2,
- Test::StringS& p3,
- const Ice::Current&)
+ const Test::StringS& p2,
+ Test::StringS& p3,
+ const Ice::Current&)
{
p3 = p1;
std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
@@ -200,9 +200,9 @@ MyDerivedClassI::opStringS(const Test::StringS& p1,
Test::ByteSS
MyDerivedClassI::opByteSS(const Test::ByteSS& p1,
- const Test::ByteSS& p2,
- Test::ByteSS& p3,
- const Ice::Current&)
+ const Test::ByteSS& p2,
+ Test::ByteSS& p3,
+ const Ice::Current&)
{
p3.resize(p1.size());
std::reverse_copy(p1.begin(), p1.end(), p3.begin());
@@ -213,9 +213,9 @@ MyDerivedClassI::opByteSS(const Test::ByteSS& p1,
Test::BoolSS
MyDerivedClassI::opBoolSS(const Test::BoolSS& p1,
- const Test::BoolSS& p2,
- Test::BoolSS& p3,
- const Ice::Current&)
+ const Test::BoolSS& p2,
+ Test::BoolSS& p3,
+ const Ice::Current&)
{
p3 = p1;
std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
@@ -227,12 +227,12 @@ MyDerivedClassI::opBoolSS(const Test::BoolSS& p1,
Test::LongSS
MyDerivedClassI::opShortIntLongSS(const Test::ShortSS& p1,
- const Test::IntSS& p2,
- const Test::LongSS& p3,
- Test::ShortSS& p4,
- Test::IntSS& p5,
- Test::LongSS& p6,
- const Ice::Current&)
+ const Test::IntSS& p2,
+ const Test::LongSS& p3,
+ Test::ShortSS& p4,
+ Test::IntSS& p5,
+ Test::LongSS& p6,
+ const Ice::Current&)
{
p4 = p1;
p5.resize(p2.size());
@@ -244,10 +244,10 @@ MyDerivedClassI::opShortIntLongSS(const Test::ShortSS& p1,
Test::DoubleSS
MyDerivedClassI::opFloatDoubleSS(const Test::FloatSS& p1,
- const Test::DoubleSS& p2,
- Test::FloatSS& p3,
- Test::DoubleSS& p4,
- const Ice::Current&)
+ const Test::DoubleSS& p2,
+ Test::FloatSS& p3,
+ Test::DoubleSS& p4,
+ const Ice::Current&)
{
p3 = p1;
p4.resize(p2.size());
@@ -259,9 +259,9 @@ MyDerivedClassI::opFloatDoubleSS(const Test::FloatSS& p1,
Test::StringSS
MyDerivedClassI::opStringSS(const Test::StringSS& p1,
- const Test::StringSS& p2,
- Test::StringSS& p3,
- const Ice::Current&)
+ const Test::StringSS& p2,
+ Test::StringSS& p3,
+ const Ice::Current&)
{
p3 = p1;
std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
@@ -273,9 +273,9 @@ MyDerivedClassI::opStringSS(const Test::StringSS& p1,
Test::StringSSS
MyDerivedClassI::opStringSSS(const Test::StringSSS& p1,
- const Test::StringSSS& p2,
- Test::StringSSS& p3,
- const ::Ice::Current&)
+ const Test::StringSSS& p2,
+ Test::StringSSS& p3,
+ const ::Ice::Current&)
{
p3 = p1;
std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
@@ -287,9 +287,9 @@ MyDerivedClassI::opStringSSS(const Test::StringSSS& p1,
Test::ByteBoolD
MyDerivedClassI::opByteBoolD(const Test::ByteBoolD& p1,
- const Test::ByteBoolD& p2,
- Test::ByteBoolD& p3,
- const Ice::Current&)
+ const Test::ByteBoolD& p2,
+ Test::ByteBoolD& p3,
+ const Ice::Current&)
{
p3 = p1;
Test::ByteBoolD r = p1;
@@ -299,9 +299,9 @@ MyDerivedClassI::opByteBoolD(const Test::ByteBoolD& p1,
Test::ShortIntD
MyDerivedClassI::opShortIntD(const Test::ShortIntD& p1,
- const Test::ShortIntD& p2,
- Test::ShortIntD& p3,
- const Ice::Current&)
+ const Test::ShortIntD& p2,
+ Test::ShortIntD& p3,
+ const Ice::Current&)
{
p3 = p1;
Test::ShortIntD r = p1;
@@ -311,9 +311,9 @@ MyDerivedClassI::opShortIntD(const Test::ShortIntD& p1,
Test::LongFloatD
MyDerivedClassI::opLongFloatD(const Test::LongFloatD& p1,
- const Test::LongFloatD& p2,
- Test::LongFloatD& p3,
- const Ice::Current&)
+ const Test::LongFloatD& p2,
+ Test::LongFloatD& p3,
+ const Ice::Current&)
{
p3 = p1;
Test::LongFloatD r = p1;
@@ -323,9 +323,9 @@ MyDerivedClassI::opLongFloatD(const Test::LongFloatD& p1,
Test::StringStringD
MyDerivedClassI::opStringStringD(const Test::StringStringD& p1,
- const Test::StringStringD& p2,
- Test::StringStringD& p3,
- const Ice::Current&)
+ const Test::StringStringD& p2,
+ Test::StringStringD& p3,
+ const Ice::Current&)
{
p3 = p1;
Test::StringStringD r = p1;
@@ -335,9 +335,9 @@ MyDerivedClassI::opStringStringD(const Test::StringStringD& p1,
Test::StringMyEnumD
MyDerivedClassI::opStringMyEnumD(const Test::StringMyEnumD& p1,
- const Test::StringMyEnumD& p2,
- Test::StringMyEnumD& p3,
- const Ice::Current&)
+ const Test::StringMyEnumD& p2,
+ Test::StringMyEnumD& p3,
+ const Ice::Current&)
{
p3 = p1;
Test::StringMyEnumD r = p1;
diff --git a/cppe/test/IceE/operations/TestI.h b/cppe/test/IceE/operations/TestI.h
index 7cb8b910adf..a8b92b30549 100644
--- a/cppe/test/IceE/operations/TestI.h
+++ b/cppe/test/IceE/operations/TestI.h
@@ -25,128 +25,128 @@ public:
virtual void opSleep(int, const Ice::Current&);
virtual Ice::Byte opByte(Ice::Byte,
- Ice::Byte,
- Ice::Byte&,
- const Ice::Current&);
+ Ice::Byte,
+ Ice::Byte&,
+ const Ice::Current&);
virtual bool opBool(bool,
- bool,
- bool&,
- const Ice::Current&);
+ bool,
+ bool&,
+ const Ice::Current&);
virtual Ice::Long opShortIntLong(Ice::Short,
- Ice::Int,
- Ice::Long,
- Ice::Short&,
- Ice::Int&,
- Ice::Long&,
- const Ice::Current&);
+ Ice::Int,
+ Ice::Long,
+ Ice::Short&,
+ Ice::Int&,
+ Ice::Long&,
+ const Ice::Current&);
virtual Ice::Double opFloatDouble(Ice::Float,
- Ice::Double,
- Ice::Float&,
- Ice::Double&,
- const Ice::Current&);
+ Ice::Double,
+ Ice::Float&,
+ Ice::Double&,
+ const Ice::Current&);
virtual std::string opString(const std::string&,
- const std::string&,
- std::string&,
- const Ice::Current&);
+ const std::string&,
+ std::string&,
+ const Ice::Current&);
virtual Test::MyEnum opMyEnum(Test::MyEnum,
- Test::MyEnum&,
- const Ice::Current&);
+ Test::MyEnum&,
+ const Ice::Current&);
virtual Test::MyClassPrx opMyClass(const Test::MyClassPrx&,
- Test::MyClassPrx&, Test::MyClassPrx&,
- const Ice::Current&);
+ Test::MyClassPrx&, Test::MyClassPrx&,
+ const Ice::Current&);
virtual Test::Structure opStruct(const Test::Structure&, const Test::Structure&,
- Test::Structure&,
- const Ice::Current&);
+ Test::Structure&,
+ const Ice::Current&);
virtual Test::ByteS opByteS(const Test::ByteS&,
- const Test::ByteS&,
- Test::ByteS&,
- const Ice::Current&);
+ const Test::ByteS&,
+ Test::ByteS&,
+ const Ice::Current&);
virtual Test::BoolS opBoolS(const Test::BoolS&,
- const Test::BoolS&,
- Test::BoolS&,
- const Ice::Current&);
+ const Test::BoolS&,
+ Test::BoolS&,
+ const Ice::Current&);
virtual Test::LongS opShortIntLongS(const Test::ShortS&,
- const Test::IntS&,
- const Test::LongS&,
- Test::ShortS&,
- Test::IntS&,
- Test::LongS&,
- const Ice::Current&);
+ const Test::IntS&,
+ const Test::LongS&,
+ Test::ShortS&,
+ Test::IntS&,
+ Test::LongS&,
+ const Ice::Current&);
virtual Test::DoubleS opFloatDoubleS(const Test::FloatS&,
- const Test::DoubleS&,
- Test::FloatS&,
- Test::DoubleS&,
- const Ice::Current&);
+ const Test::DoubleS&,
+ Test::FloatS&,
+ Test::DoubleS&,
+ const Ice::Current&);
virtual Test::StringS opStringS(const Test::StringS&,
- const Test::StringS&,
- Test::StringS&,
- const Ice::Current&);
+ const Test::StringS&,
+ Test::StringS&,
+ const Ice::Current&);
virtual Test::ByteSS opByteSS(const Test::ByteSS&,
- const Test::ByteSS&,
- Test::ByteSS&,
- const Ice::Current&);
+ const Test::ByteSS&,
+ Test::ByteSS&,
+ const Ice::Current&);
virtual Test::BoolSS opBoolSS(const Test::BoolSS&,
- const Test::BoolSS&,
- Test::BoolSS&,
- const Ice::Current&);
+ const Test::BoolSS&,
+ Test::BoolSS&,
+ const Ice::Current&);
virtual Test::LongSS opShortIntLongSS(const Test::ShortSS&,
- const Test::IntSS&,
- const Test::LongSS&,
- Test::ShortSS&,
- Test::IntSS&,
- Test::LongSS&,
- const Ice::Current&);
+ const Test::IntSS&,
+ const Test::LongSS&,
+ Test::ShortSS&,
+ Test::IntSS&,
+ Test::LongSS&,
+ const Ice::Current&);
virtual Test::DoubleSS opFloatDoubleSS(const Test::FloatSS&,
- const Test::DoubleSS&,
- Test::FloatSS&,
- Test::DoubleSS&,
- const Ice::Current&);
+ const Test::DoubleSS&,
+ Test::FloatSS&,
+ Test::DoubleSS&,
+ const Ice::Current&);
virtual Test::StringSS opStringSS(const Test::StringSS&,
- const Test::StringSS&,
- Test::StringSS&,
- const Ice::Current&);
+ const Test::StringSS&,
+ Test::StringSS&,
+ const Ice::Current&);
virtual Test::StringSSS opStringSSS(const Test::StringSSS&,
- const Test::StringSSS&,
- Test::StringSSS&,
- const ::Ice::Current&);
+ const Test::StringSSS&,
+ Test::StringSSS&,
+ const ::Ice::Current&);
virtual Test::ByteBoolD opByteBoolD(const Test::ByteBoolD&, const Test::ByteBoolD&,
- Test::ByteBoolD&,
- const Ice::Current&);
+ Test::ByteBoolD&,
+ const Ice::Current&);
virtual Test::ShortIntD opShortIntD(const Test::ShortIntD&, const Test::ShortIntD&,
- Test::ShortIntD&,
- const Ice::Current&);
+ Test::ShortIntD&,
+ const Ice::Current&);
virtual Test::LongFloatD opLongFloatD(const Test::LongFloatD&, const Test::LongFloatD&,
- Test::LongFloatD&,
- const Ice::Current&);
+ Test::LongFloatD&,
+ const Ice::Current&);
virtual Test::StringStringD opStringStringD(const Test::StringStringD&, const Test::StringStringD&,
- Test::StringStringD&,
- const Ice::Current&);
+ Test::StringStringD&,
+ const Ice::Current&);
virtual Test::StringMyEnumD opStringMyEnumD(const Test::StringMyEnumD&, const Test::StringMyEnumD&,
- Test::StringMyEnumD&,
- const Ice::Current&);
+ Test::StringMyEnumD&,
+ const Ice::Current&);
virtual Test::IntS opIntS(const Test::IntS&, const Ice::Current&);
diff --git a/cppe/test/IceE/operations/Twoways.cpp b/cppe/test/IceE/operations/Twoways.cpp
index e3717c7877c..c1e14970c18 100644
--- a/cppe/test/IceE/operations/Twoways.cpp
+++ b/cppe/test/IceE/operations/Twoways.cpp
@@ -26,645 +26,645 @@ using namespace std;
void
twoways(const Ice::CommunicatorPtr& communicator,
- const Ice::InitializationData& initializationData, const Test::MyClassPrx& p)
+ const Ice::InitializationData& initializationData, const Test::MyClassPrx& p)
{
{
- p->opVoid();
+ p->opVoid();
}
{
- Ice::Byte b;
- Ice::Byte r;
+ Ice::Byte b;
+ Ice::Byte r;
- r = p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b);
- test(b == Ice::Byte(0xf0));
- test(r == Ice::Byte(0xff));
+ r = p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b);
+ test(b == Ice::Byte(0xf0));
+ test(r == Ice::Byte(0xff));
}
{
- bool b;
- bool r;
+ bool b;
+ bool r;
- r = p->opBool(true, false, b);
- test(b);
- test(!r);
+ r = p->opBool(true, false, b);
+ test(b);
+ test(!r);
}
{
- Ice::Short s;
- Ice::Int i;
- Ice::Long l;
- Ice::Long r;
-
- r = p->opShortIntLong(10, 11, 12, s, i, l);
- test(s == 10);
- test(i == 11);
- test(l == 12);
- test(r == 12);
-
- r = p->opShortIntLong(numeric_limits<Ice::Short>::min(), numeric_limits<Ice::Int>::min(),
- numeric_limits<Ice::Long>::min(), s, i, l);
- test(s == numeric_limits<Ice::Short>::min());
- test(i == numeric_limits<Ice::Int>::min());
- test(l == numeric_limits<Ice::Long>::min());
- test(r == numeric_limits<Ice::Long>::min());
-
- r = p->opShortIntLong(numeric_limits<Ice::Short>::max(), numeric_limits<Ice::Int>::max(),
- numeric_limits<Ice::Long>::max(), s, i, l);
- test(s == numeric_limits<Ice::Short>::max());
- test(i == numeric_limits<Ice::Int>::max());
- test(l == numeric_limits<Ice::Long>::max());
- test(r == numeric_limits<Ice::Long>::max());
+ Ice::Short s;
+ Ice::Int i;
+ Ice::Long l;
+ Ice::Long r;
+
+ r = p->opShortIntLong(10, 11, 12, s, i, l);
+ test(s == 10);
+ test(i == 11);
+ test(l == 12);
+ test(r == 12);
+
+ r = p->opShortIntLong(numeric_limits<Ice::Short>::min(), numeric_limits<Ice::Int>::min(),
+ numeric_limits<Ice::Long>::min(), s, i, l);
+ test(s == numeric_limits<Ice::Short>::min());
+ test(i == numeric_limits<Ice::Int>::min());
+ test(l == numeric_limits<Ice::Long>::min());
+ test(r == numeric_limits<Ice::Long>::min());
+
+ r = p->opShortIntLong(numeric_limits<Ice::Short>::max(), numeric_limits<Ice::Int>::max(),
+ numeric_limits<Ice::Long>::max(), s, i, l);
+ test(s == numeric_limits<Ice::Short>::max());
+ test(i == numeric_limits<Ice::Int>::max());
+ test(l == numeric_limits<Ice::Long>::max());
+ test(r == numeric_limits<Ice::Long>::max());
}
{
- Ice::Float f;
- Ice::Double d;
- Ice::Double r;
-
- r = p->opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), f, d);
- test(f == Ice::Float(3.14));
- test(d == Ice::Double(1.1E10));
- test(r == Ice::Double(1.1E10));
-
- r = p->opFloatDouble(numeric_limits<Ice::Float>::min(), numeric_limits<Ice::Double>::min(), f, d);
- test(f == numeric_limits<Ice::Float>::min());
- test(d == numeric_limits<Ice::Double>::min());
- test(r == numeric_limits<Ice::Double>::min());
-
- r = p->opFloatDouble(numeric_limits<Ice::Float>::max(), numeric_limits<Ice::Double>::max(), f, d);
- test(f == numeric_limits<Ice::Float>::max());
- test(d == numeric_limits<Ice::Double>::max());
- test(r == numeric_limits<Ice::Double>::max());
+ Ice::Float f;
+ Ice::Double d;
+ Ice::Double r;
+
+ r = p->opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), f, d);
+ test(f == Ice::Float(3.14));
+ test(d == Ice::Double(1.1E10));
+ test(r == Ice::Double(1.1E10));
+
+ r = p->opFloatDouble(numeric_limits<Ice::Float>::min(), numeric_limits<Ice::Double>::min(), f, d);
+ test(f == numeric_limits<Ice::Float>::min());
+ test(d == numeric_limits<Ice::Double>::min());
+ test(r == numeric_limits<Ice::Double>::min());
+
+ r = p->opFloatDouble(numeric_limits<Ice::Float>::max(), numeric_limits<Ice::Double>::max(), f, d);
+ test(f == numeric_limits<Ice::Float>::max());
+ test(d == numeric_limits<Ice::Double>::max());
+ test(r == numeric_limits<Ice::Double>::max());
}
{
- string s;
- string r;
+ string s;
+ string r;
- r = p->opString("hello", "world", s);
- test(s == "world hello");
- test(r == "hello world");
+ r = p->opString("hello", "world", s);
+ test(s == "world hello");
+ test(r == "hello world");
}
{
- Test::MyEnum e;
- Test::MyEnum r;
-
- r = p->opMyEnum(Test::enum2, e);
- test(e == Test::enum2);
- test(r == Test::enum3);
+ Test::MyEnum e;
+ Test::MyEnum r;
+
+ r = p->opMyEnum(Test::enum2, e);
+ test(e == Test::enum2);
+ test(r == Test::enum3);
}
{
- Test::MyClassPrx c1;
- Test::MyClassPrx c2;
- Test::MyClassPrx r;
-
- r = p->opMyClass(p, c1, c2);
- test(Ice::proxyIdentityAndFacetEqual(c1, p));
- test(!Ice::proxyIdentityAndFacetEqual(c2, p));
- test(Ice::proxyIdentityAndFacetEqual(r, p));
- test(c1->ice_getIdentity() == communicator->stringToIdentity("test"));
- test(c2->ice_getIdentity() == communicator->stringToIdentity("noSuchIdentity"));
- test(r->ice_getIdentity() == communicator->stringToIdentity("test"));
- r->opVoid();
- c1->opVoid();
- try
- {
- c2->opVoid();
- test(false);
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
-
- r = p->opMyClass(0, c1, c2);
- test(c1 == 0);
- test(c2 != 0);
- test(Ice::proxyIdentityAndFacetEqual(r, p));
- r->opVoid();
+ Test::MyClassPrx c1;
+ Test::MyClassPrx c2;
+ Test::MyClassPrx r;
+
+ r = p->opMyClass(p, c1, c2);
+ test(Ice::proxyIdentityAndFacetEqual(c1, p));
+ test(!Ice::proxyIdentityAndFacetEqual(c2, p));
+ test(Ice::proxyIdentityAndFacetEqual(r, p));
+ test(c1->ice_getIdentity() == communicator->stringToIdentity("test"));
+ test(c2->ice_getIdentity() == communicator->stringToIdentity("noSuchIdentity"));
+ test(r->ice_getIdentity() == communicator->stringToIdentity("test"));
+ r->opVoid();
+ c1->opVoid();
+ try
+ {
+ c2->opVoid();
+ test(false);
+ }
+ catch(const Ice::ObjectNotExistException&)
+ {
+ }
+
+ r = p->opMyClass(0, c1, c2);
+ test(c1 == 0);
+ test(c2 != 0);
+ test(Ice::proxyIdentityAndFacetEqual(r, p));
+ r->opVoid();
}
{
- Test::Structure si1;
- si1.p = p;
- si1.e = Test::enum3;
- si1.s.s = "abc";
- Test::Structure si2;
- si2.p = 0;
- si2.e = Test::enum2;
- si2.s.s = "def";
-
- Test::Structure so;
- Test::Structure rso = p->opStruct(si1, si2, so);
- test(rso.p == 0);
- test(rso.e == Test::enum2);
- test(rso.s.s == "def");
- test(so.p == p);
- test(so.e == Test::enum3);
- test(so.s.s == "a new string");
- so.p->opVoid();
+ Test::Structure si1;
+ si1.p = p;
+ si1.e = Test::enum3;
+ si1.s.s = "abc";
+ Test::Structure si2;
+ si2.p = 0;
+ si2.e = Test::enum2;
+ si2.s.s = "def";
+
+ Test::Structure so;
+ Test::Structure rso = p->opStruct(si1, si2, so);
+ test(rso.p == 0);
+ test(rso.e == Test::enum2);
+ test(rso.s.s == "def");
+ test(so.p == p);
+ test(so.e == Test::enum3);
+ test(so.s.s == "a new string");
+ so.p->opVoid();
}
{
- Test::ByteS bsi1;
- Test::ByteS bsi2;
-
- bsi1.push_back(Ice::Byte(0x01));
- bsi1.push_back(Ice::Byte(0x11));
- bsi1.push_back(Ice::Byte(0x12));
- bsi1.push_back(Ice::Byte(0x22));
-
- bsi2.push_back(Ice::Byte(0xf1));
- bsi2.push_back(Ice::Byte(0xf2));
- bsi2.push_back(Ice::Byte(0xf3));
- bsi2.push_back(Ice::Byte(0xf4));
-
- Test::ByteS bso;
- Test::ByteS rso;
-
- rso = p->opByteS(bsi1, bsi2, bso);
- test(bso.size() == 4);
- test(bso[0] == Ice::Byte(0x22));
- test(bso[1] == Ice::Byte(0x12));
- test(bso[2] == Ice::Byte(0x11));
- test(bso[3] == Ice::Byte(0x01));
- test(rso.size() == 8);
- test(rso[0] == Ice::Byte(0x01));
- test(rso[1] == Ice::Byte(0x11));
- test(rso[2] == Ice::Byte(0x12));
- test(rso[3] == Ice::Byte(0x22));
- test(rso[4] == Ice::Byte(0xf1));
- test(rso[5] == Ice::Byte(0xf2));
- test(rso[6] == Ice::Byte(0xf3));
- test(rso[7] == Ice::Byte(0xf4));
+ Test::ByteS bsi1;
+ Test::ByteS bsi2;
+
+ bsi1.push_back(Ice::Byte(0x01));
+ bsi1.push_back(Ice::Byte(0x11));
+ bsi1.push_back(Ice::Byte(0x12));
+ bsi1.push_back(Ice::Byte(0x22));
+
+ bsi2.push_back(Ice::Byte(0xf1));
+ bsi2.push_back(Ice::Byte(0xf2));
+ bsi2.push_back(Ice::Byte(0xf3));
+ bsi2.push_back(Ice::Byte(0xf4));
+
+ Test::ByteS bso;
+ Test::ByteS rso;
+
+ rso = p->opByteS(bsi1, bsi2, bso);
+ test(bso.size() == 4);
+ test(bso[0] == Ice::Byte(0x22));
+ test(bso[1] == Ice::Byte(0x12));
+ test(bso[2] == Ice::Byte(0x11));
+ test(bso[3] == Ice::Byte(0x01));
+ test(rso.size() == 8);
+ test(rso[0] == Ice::Byte(0x01));
+ test(rso[1] == Ice::Byte(0x11));
+ test(rso[2] == Ice::Byte(0x12));
+ test(rso[3] == Ice::Byte(0x22));
+ test(rso[4] == Ice::Byte(0xf1));
+ test(rso[5] == Ice::Byte(0xf2));
+ test(rso[6] == Ice::Byte(0xf3));
+ test(rso[7] == Ice::Byte(0xf4));
}
{
- Test::BoolS bsi1;
- Test::BoolS bsi2;
-
- bsi1.push_back(true);
- bsi1.push_back(true);
- bsi1.push_back(false);
-
- bsi2.push_back(false);
-
- Test::BoolS bso;
- Test::BoolS rso;
-
- rso = p->opBoolS(bsi1, bsi2, bso);
- test(bso.size() == 4);
- test(bso[0]);
- test(bso[1]);
- test(!bso[2]);
- test(!bso[3]);
- test(rso.size() == 3);
- test(!rso[0]);
- test(rso[1]);
- test(rso[2]);
+ Test::BoolS bsi1;
+ Test::BoolS bsi2;
+
+ bsi1.push_back(true);
+ bsi1.push_back(true);
+ bsi1.push_back(false);
+
+ bsi2.push_back(false);
+
+ Test::BoolS bso;
+ Test::BoolS rso;
+
+ rso = p->opBoolS(bsi1, bsi2, bso);
+ test(bso.size() == 4);
+ test(bso[0]);
+ test(bso[1]);
+ test(!bso[2]);
+ test(!bso[3]);
+ test(rso.size() == 3);
+ test(!rso[0]);
+ test(rso[1]);
+ test(rso[2]);
}
{
- Test::ShortS ssi;
- Test::IntS isi;
- Test::LongS lsi;
-
- ssi.push_back(1);
- ssi.push_back(2);
- ssi.push_back(3);
-
- isi.push_back(5);
- isi.push_back(6);
- isi.push_back(7);
- isi.push_back(8);
-
- lsi.push_back(10);
- lsi.push_back(30);
- lsi.push_back(20);
-
- Test::ShortS sso;
- Test::IntS iso;
- Test::LongS lso;
- Test::LongS rso;
-
- rso = p->opShortIntLongS(ssi, isi, lsi, sso, iso, lso);
- test(sso.size() == 3);
- test(sso[0] == 1);
- test(sso[1] == 2);
- test(sso[2] == 3);
- test(iso.size() == 4);
- test(iso[0] == 8);
- test(iso[1] == 7);
- test(iso[2] == 6);
- test(iso[3] == 5);
- test(lso.size() == 6);
- test(lso[0] == 10);
- test(lso[1] == 30);
- test(lso[2] == 20);
- test(lso[3] == 10);
- test(lso[4] == 30);
- test(lso[5] == 20);
- test(rso.size() == 3);
- test(rso[0] == 10);
- test(rso[1] == 30);
- test(rso[2] == 20);
+ Test::ShortS ssi;
+ Test::IntS isi;
+ Test::LongS lsi;
+
+ ssi.push_back(1);
+ ssi.push_back(2);
+ ssi.push_back(3);
+
+ isi.push_back(5);
+ isi.push_back(6);
+ isi.push_back(7);
+ isi.push_back(8);
+
+ lsi.push_back(10);
+ lsi.push_back(30);
+ lsi.push_back(20);
+
+ Test::ShortS sso;
+ Test::IntS iso;
+ Test::LongS lso;
+ Test::LongS rso;
+
+ rso = p->opShortIntLongS(ssi, isi, lsi, sso, iso, lso);
+ test(sso.size() == 3);
+ test(sso[0] == 1);
+ test(sso[1] == 2);
+ test(sso[2] == 3);
+ test(iso.size() == 4);
+ test(iso[0] == 8);
+ test(iso[1] == 7);
+ test(iso[2] == 6);
+ test(iso[3] == 5);
+ test(lso.size() == 6);
+ test(lso[0] == 10);
+ test(lso[1] == 30);
+ test(lso[2] == 20);
+ test(lso[3] == 10);
+ test(lso[4] == 30);
+ test(lso[5] == 20);
+ test(rso.size() == 3);
+ test(rso[0] == 10);
+ test(rso[1] == 30);
+ test(rso[2] == 20);
}
{
- Test::FloatS fsi;
- Test::DoubleS dsi;
-
- fsi.push_back(Ice::Float(3.14));
- fsi.push_back(Ice::Float(1.11));
-
- dsi.push_back(Ice::Double(1.1E10));
- dsi.push_back(Ice::Double(1.2E10));
- dsi.push_back(Ice::Double(1.3E10));
-
- Test::FloatS fso;
- Test::DoubleS dso;
- Test::DoubleS rso;
-
- rso = p->opFloatDoubleS(fsi, dsi, fso, dso);
- test(fso.size() == 2);
- test(fso[0] == ::Ice::Float(3.14));
- test(fso[1] == ::Ice::Float(1.11));
- test(dso.size() == 3);
- test(dso[0] == ::Ice::Double(1.3E10));
- test(dso[1] == ::Ice::Double(1.2E10));
- test(dso[2] == ::Ice::Double(1.1E10));
- test(rso.size() == 5);
- test(rso[0] == ::Ice::Double(1.1E10));
- test(rso[1] == ::Ice::Double(1.2E10));
- test(rso[2] == ::Ice::Double(1.3E10));
- test(::Ice::Float(rso[3]) == ::Ice::Float(3.14));
- test(::Ice::Float(rso[4]) == ::Ice::Float(1.11));
+ Test::FloatS fsi;
+ Test::DoubleS dsi;
+
+ fsi.push_back(Ice::Float(3.14));
+ fsi.push_back(Ice::Float(1.11));
+
+ dsi.push_back(Ice::Double(1.1E10));
+ dsi.push_back(Ice::Double(1.2E10));
+ dsi.push_back(Ice::Double(1.3E10));
+
+ Test::FloatS fso;
+ Test::DoubleS dso;
+ Test::DoubleS rso;
+
+ rso = p->opFloatDoubleS(fsi, dsi, fso, dso);
+ test(fso.size() == 2);
+ test(fso[0] == ::Ice::Float(3.14));
+ test(fso[1] == ::Ice::Float(1.11));
+ test(dso.size() == 3);
+ test(dso[0] == ::Ice::Double(1.3E10));
+ test(dso[1] == ::Ice::Double(1.2E10));
+ test(dso[2] == ::Ice::Double(1.1E10));
+ test(rso.size() == 5);
+ test(rso[0] == ::Ice::Double(1.1E10));
+ test(rso[1] == ::Ice::Double(1.2E10));
+ test(rso[2] == ::Ice::Double(1.3E10));
+ test(::Ice::Float(rso[3]) == ::Ice::Float(3.14));
+ test(::Ice::Float(rso[4]) == ::Ice::Float(1.11));
}
{
- Test::StringS ssi1;
- Test::StringS ssi2;
-
- ssi1.push_back("abc");
- ssi1.push_back("de");
- ssi1.push_back("fghi");
-
- ssi2.push_back("xyz");
-
- Test::StringS sso;
- Test::StringS rso;
-
- rso = p->opStringS(ssi1, ssi2, sso);
- test(sso.size() == 4);
- test(sso[0] == "abc");
- test(sso[1] == "de");
- test(sso[2] == "fghi");
- test(sso[3] == "xyz");
- test(rso.size() == 3);
- test(rso[0] == "fghi");
- test(rso[1] == "de");
- test(rso[2] == "abc");
+ Test::StringS ssi1;
+ Test::StringS ssi2;
+
+ ssi1.push_back("abc");
+ ssi1.push_back("de");
+ ssi1.push_back("fghi");
+
+ ssi2.push_back("xyz");
+
+ Test::StringS sso;
+ Test::StringS rso;
+
+ rso = p->opStringS(ssi1, ssi2, sso);
+ test(sso.size() == 4);
+ test(sso[0] == "abc");
+ test(sso[1] == "de");
+ test(sso[2] == "fghi");
+ test(sso[3] == "xyz");
+ test(rso.size() == 3);
+ test(rso[0] == "fghi");
+ test(rso[1] == "de");
+ test(rso[2] == "abc");
}
{
- Test::ByteSS bsi1;
- bsi1.resize(2);
- Test::ByteSS bsi2;
- bsi2.resize(2);
-
- bsi1[0].push_back(Ice::Byte(0x01));
- bsi1[0].push_back(Ice::Byte(0x11));
- bsi1[0].push_back(Ice::Byte(0x12));
- bsi1[1].push_back(Ice::Byte(0xff));
-
- bsi2[0].push_back(Ice::Byte(0x0e));
- bsi2[1].push_back(Ice::Byte(0xf2));
- bsi2[1].push_back(Ice::Byte(0xf1));
-
- Test::ByteSS bso;
- Test::ByteSS rso;
-
- rso = p->opByteSS(bsi1, bsi2, bso);
- test(bso.size() == 2);
- test(bso[0].size() == 1);
- test(bso[0][0] == Ice::Byte(0xff));
- test(bso[1].size() == 3);
- test(bso[1][0] == Ice::Byte(0x01));
- test(bso[1][1] == Ice::Byte(0x11));
- test(bso[1][2] == Ice::Byte(0x12));
- test(rso.size() == 4);
- test(rso[0].size() == 3);
- test(rso[0][0] == Ice::Byte(0x01));
- test(rso[0][1] == Ice::Byte(0x11));
- test(rso[0][2] == Ice::Byte(0x12));
- test(rso[1].size() == 1);
- test(rso[1][0] == Ice::Byte(0xff));
- test(rso[2].size() == 1);
- test(rso[2][0] == Ice::Byte(0x0e));
- test(rso[3].size() == 2);
- test(rso[3][0] == Ice::Byte(0xf2));
- test(rso[3][1] == Ice::Byte(0xf1));
+ Test::ByteSS bsi1;
+ bsi1.resize(2);
+ Test::ByteSS bsi2;
+ bsi2.resize(2);
+
+ bsi1[0].push_back(Ice::Byte(0x01));
+ bsi1[0].push_back(Ice::Byte(0x11));
+ bsi1[0].push_back(Ice::Byte(0x12));
+ bsi1[1].push_back(Ice::Byte(0xff));
+
+ bsi2[0].push_back(Ice::Byte(0x0e));
+ bsi2[1].push_back(Ice::Byte(0xf2));
+ bsi2[1].push_back(Ice::Byte(0xf1));
+
+ Test::ByteSS bso;
+ Test::ByteSS rso;
+
+ rso = p->opByteSS(bsi1, bsi2, bso);
+ test(bso.size() == 2);
+ test(bso[0].size() == 1);
+ test(bso[0][0] == Ice::Byte(0xff));
+ test(bso[1].size() == 3);
+ test(bso[1][0] == Ice::Byte(0x01));
+ test(bso[1][1] == Ice::Byte(0x11));
+ test(bso[1][2] == Ice::Byte(0x12));
+ test(rso.size() == 4);
+ test(rso[0].size() == 3);
+ test(rso[0][0] == Ice::Byte(0x01));
+ test(rso[0][1] == Ice::Byte(0x11));
+ test(rso[0][2] == Ice::Byte(0x12));
+ test(rso[1].size() == 1);
+ test(rso[1][0] == Ice::Byte(0xff));
+ test(rso[2].size() == 1);
+ test(rso[2][0] == Ice::Byte(0x0e));
+ test(rso[3].size() == 2);
+ test(rso[3][0] == Ice::Byte(0xf2));
+ test(rso[3][1] == Ice::Byte(0xf1));
}
{
- Test::FloatSS fsi;
- fsi.resize(3);
- Test::DoubleSS dsi;
- dsi.resize(1);
-
- fsi[0].push_back(Ice::Float(3.14));
- fsi[1].push_back(Ice::Float(1.11));
-
- dsi[0].push_back(Ice::Double(1.1E10));
- dsi[0].push_back(Ice::Double(1.2E10));
- dsi[0].push_back(Ice::Double(1.3E10));
-
- Test::FloatSS fso;
- Test::DoubleSS dso;
- Test::DoubleSS rso;
-
- rso = p->opFloatDoubleSS(fsi, dsi, fso, dso);
- test(fso.size() == 3);
- test(fso[0].size() == 1);
- test(fso[0][0] == ::Ice::Float(3.14));
- test(fso[1].size() == 1);
- test(fso[1][0] == ::Ice::Float(1.11));
- test(fso[2].size() == 0);
- test(dso.size() == 1);
- test(dso[0].size() == 3);
- test(dso[0][0] == ::Ice::Double(1.1E10));
- test(dso[0][1] == ::Ice::Double(1.2E10));
- test(dso[0][2] == ::Ice::Double(1.3E10));
- test(rso.size() == 2);
- test(rso[0].size() == 3);
- test(rso[0][0] == ::Ice::Double(1.1E10));
- test(rso[0][1] == ::Ice::Double(1.2E10));
- test(rso[0][2] == ::Ice::Double(1.3E10));
- test(rso[1].size() == 3);
- test(rso[1][0] == ::Ice::Double(1.1E10));
- test(rso[1][1] == ::Ice::Double(1.2E10));
- test(rso[1][2] == ::Ice::Double(1.3E10));
+ Test::FloatSS fsi;
+ fsi.resize(3);
+ Test::DoubleSS dsi;
+ dsi.resize(1);
+
+ fsi[0].push_back(Ice::Float(3.14));
+ fsi[1].push_back(Ice::Float(1.11));
+
+ dsi[0].push_back(Ice::Double(1.1E10));
+ dsi[0].push_back(Ice::Double(1.2E10));
+ dsi[0].push_back(Ice::Double(1.3E10));
+
+ Test::FloatSS fso;
+ Test::DoubleSS dso;
+ Test::DoubleSS rso;
+
+ rso = p->opFloatDoubleSS(fsi, dsi, fso, dso);
+ test(fso.size() == 3);
+ test(fso[0].size() == 1);
+ test(fso[0][0] == ::Ice::Float(3.14));
+ test(fso[1].size() == 1);
+ test(fso[1][0] == ::Ice::Float(1.11));
+ test(fso[2].size() == 0);
+ test(dso.size() == 1);
+ test(dso[0].size() == 3);
+ test(dso[0][0] == ::Ice::Double(1.1E10));
+ test(dso[0][1] == ::Ice::Double(1.2E10));
+ test(dso[0][2] == ::Ice::Double(1.3E10));
+ test(rso.size() == 2);
+ test(rso[0].size() == 3);
+ test(rso[0][0] == ::Ice::Double(1.1E10));
+ test(rso[0][1] == ::Ice::Double(1.2E10));
+ test(rso[0][2] == ::Ice::Double(1.3E10));
+ test(rso[1].size() == 3);
+ test(rso[1][0] == ::Ice::Double(1.1E10));
+ test(rso[1][1] == ::Ice::Double(1.2E10));
+ test(rso[1][2] == ::Ice::Double(1.3E10));
}
{
- Test::StringSS ssi1;
- ssi1.resize(2);
- Test::StringSS ssi2;
- ssi2.resize(3);
-
- ssi1[0].push_back("abc");
- ssi1[1].push_back("de");
- ssi1[1].push_back("fghi");
-
- ssi2[2].push_back("xyz");
-
- Test::StringSS sso;
- Test::StringSS rso;
-
- rso = p->opStringSS(ssi1, ssi2, sso);
- test(sso.size() == 5);
- test(sso[0].size() == 1);
- test(sso[0][0] == "abc");
- test(sso[1].size() == 2);
- test(sso[1][0] == "de");
- test(sso[1][1] == "fghi");
- test(sso[2].size() == 0);
- test(sso[3].size() == 0);
- test(sso[4].size() == 1);
- test(sso[4][0] == "xyz");
- test(rso.size() == 3);
- test(rso[0].size() == 1);
- test(rso[0][0] == "xyz");
- test(rso[1].size() == 0);
- test(rso[2].size() == 0);
+ Test::StringSS ssi1;
+ ssi1.resize(2);
+ Test::StringSS ssi2;
+ ssi2.resize(3);
+
+ ssi1[0].push_back("abc");
+ ssi1[1].push_back("de");
+ ssi1[1].push_back("fghi");
+
+ ssi2[2].push_back("xyz");
+
+ Test::StringSS sso;
+ Test::StringSS rso;
+
+ rso = p->opStringSS(ssi1, ssi2, sso);
+ test(sso.size() == 5);
+ test(sso[0].size() == 1);
+ test(sso[0][0] == "abc");
+ test(sso[1].size() == 2);
+ test(sso[1][0] == "de");
+ test(sso[1][1] == "fghi");
+ test(sso[2].size() == 0);
+ test(sso[3].size() == 0);
+ test(sso[4].size() == 1);
+ test(sso[4][0] == "xyz");
+ test(rso.size() == 3);
+ test(rso[0].size() == 1);
+ test(rso[0][0] == "xyz");
+ test(rso[1].size() == 0);
+ test(rso[2].size() == 0);
}
{
- Test::StringSSS sssi1;
- sssi1.resize(2);
- sssi1[0].resize(2);
- sssi1[0][0].push_back("abc");
- sssi1[0][0].push_back("de");
- sssi1[0][1].push_back("xyz");
- sssi1[1].resize(1);
- sssi1[1][0].push_back("hello");
-
- Test::StringSSS sssi2;
- sssi2.resize(3);
- sssi2[0].resize(2);
- sssi2[0][0].push_back("");
- sssi2[0][0].push_back("");
- sssi2[0][1].push_back("abcd");
- sssi2[1].resize(1);
- sssi2[1][0].push_back("");
-
- Test::StringSSS ssso;
- Test::StringSSS rsso;
-
- rsso = p->opStringSSS(sssi1, sssi2, ssso);
- test(ssso.size() == 5);
- test(ssso[0].size() == 2);
- test(ssso[0][0].size() == 2);
- test(ssso[0][1].size() == 1);
- test(ssso[1].size() == 1);
- test(ssso[1][0].size() == 1);
- test(ssso[2].size() == 2);
- test(ssso[2][0].size() == 2);
- test(ssso[2][1].size() == 1);
- test(ssso[3].size() == 1);
- test(ssso[3][0].size() == 1);
- test(ssso[4].size() == 0);
- test(ssso[0][0][0] == "abc");
- test(ssso[0][0][1] == "de");
- test(ssso[0][1][0] == "xyz");
- test(ssso[1][0][0] == "hello");
- test(ssso[2][0][0] == "");
- test(ssso[2][0][1] == "");
- test(ssso[2][1][0] == "abcd");
- test(ssso[3][0][0] == "");
-
- test(rsso.size() == 3);
- test(rsso[0].size() == 0);
- test(rsso[1].size() == 1);
- test(rsso[1][0].size() == 1);
- test(rsso[2].size() == 2);
- test(rsso[2][0].size() == 2);
- test(rsso[2][1].size() == 1);
- test(rsso[1][0][0] == "");
- test(rsso[2][0][0] == "");
- test(rsso[2][0][1] == "");
- test(rsso[2][1][0] == "abcd");
+ Test::StringSSS sssi1;
+ sssi1.resize(2);
+ sssi1[0].resize(2);
+ sssi1[0][0].push_back("abc");
+ sssi1[0][0].push_back("de");
+ sssi1[0][1].push_back("xyz");
+ sssi1[1].resize(1);
+ sssi1[1][0].push_back("hello");
+
+ Test::StringSSS sssi2;
+ sssi2.resize(3);
+ sssi2[0].resize(2);
+ sssi2[0][0].push_back("");
+ sssi2[0][0].push_back("");
+ sssi2[0][1].push_back("abcd");
+ sssi2[1].resize(1);
+ sssi2[1][0].push_back("");
+
+ Test::StringSSS ssso;
+ Test::StringSSS rsso;
+
+ rsso = p->opStringSSS(sssi1, sssi2, ssso);
+ test(ssso.size() == 5);
+ test(ssso[0].size() == 2);
+ test(ssso[0][0].size() == 2);
+ test(ssso[0][1].size() == 1);
+ test(ssso[1].size() == 1);
+ test(ssso[1][0].size() == 1);
+ test(ssso[2].size() == 2);
+ test(ssso[2][0].size() == 2);
+ test(ssso[2][1].size() == 1);
+ test(ssso[3].size() == 1);
+ test(ssso[3][0].size() == 1);
+ test(ssso[4].size() == 0);
+ test(ssso[0][0][0] == "abc");
+ test(ssso[0][0][1] == "de");
+ test(ssso[0][1][0] == "xyz");
+ test(ssso[1][0][0] == "hello");
+ test(ssso[2][0][0] == "");
+ test(ssso[2][0][1] == "");
+ test(ssso[2][1][0] == "abcd");
+ test(ssso[3][0][0] == "");
+
+ test(rsso.size() == 3);
+ test(rsso[0].size() == 0);
+ test(rsso[1].size() == 1);
+ test(rsso[1][0].size() == 1);
+ test(rsso[2].size() == 2);
+ test(rsso[2][0].size() == 2);
+ test(rsso[2][1].size() == 1);
+ test(rsso[1][0][0] == "");
+ test(rsso[2][0][0] == "");
+ test(rsso[2][0][1] == "");
+ test(rsso[2][1][0] == "abcd");
}
{
- Test::ByteBoolD di1;
- di1[10] = true;
- di1[100] = false;
- Test::ByteBoolD di2;
- di2[10] = true;
- di2[11] = false;
- di2[101] = true;
-
- Test::ByteBoolD _do;
- Test::ByteBoolD ro = p->opByteBoolD(di1, di2, _do);
-
- test(_do == di1);
- test(ro.size() == 4);
- test(ro[10] == true);
- test(ro[11] == false);
- test(ro[100] == false);
- test(ro[101] == true);
+ Test::ByteBoolD di1;
+ di1[10] = true;
+ di1[100] = false;
+ Test::ByteBoolD di2;
+ di2[10] = true;
+ di2[11] = false;
+ di2[101] = true;
+
+ Test::ByteBoolD _do;
+ Test::ByteBoolD ro = p->opByteBoolD(di1, di2, _do);
+
+ test(_do == di1);
+ test(ro.size() == 4);
+ test(ro[10] == true);
+ test(ro[11] == false);
+ test(ro[100] == false);
+ test(ro[101] == true);
}
{
- Test::ShortIntD di1;
- di1[110] = -1;
- di1[1100] = 123123;
- Test::ShortIntD di2;
- di2[110] = -1;
- di2[111] = -100;
- di2[1101] = 0;
-
- Test::ShortIntD _do;
- Test::ShortIntD ro = p->opShortIntD(di1, di2, _do);
-
- test(_do == di1);
- test(ro.size() == 4);
- test(ro[110] == -1);
- test(ro[111] == -100);
- test(ro[1100] == 123123);
- test(ro[1101] == 0);
+ Test::ShortIntD di1;
+ di1[110] = -1;
+ di1[1100] = 123123;
+ Test::ShortIntD di2;
+ di2[110] = -1;
+ di2[111] = -100;
+ di2[1101] = 0;
+
+ Test::ShortIntD _do;
+ Test::ShortIntD ro = p->opShortIntD(di1, di2, _do);
+
+ test(_do == di1);
+ test(ro.size() == 4);
+ test(ro[110] == -1);
+ test(ro[111] == -100);
+ test(ro[1100] == 123123);
+ test(ro[1101] == 0);
}
{
- Test::LongFloatD di1;
- di1[999999110] = Ice::Float(-1.1);
- di1[999999111] = Ice::Float(123123.2);
- Test::LongFloatD di2;
- di2[999999110] = Ice::Float(-1.1);
- di2[999999120] = Ice::Float(-100.4);
- di2[999999130] = Ice::Float(0.5);
-
- Test::LongFloatD _do;
- Test::LongFloatD ro = p->opLongFloatD(di1, di2, _do);
-
- test(_do == di1);
- test(ro.size() == 4);
- test(ro[999999110] == Ice::Float(-1.1));
- test(ro[999999120] == Ice::Float(-100.4));
- test(ro[999999111] == Ice::Float(123123.2));
- test(ro[999999130] == Ice::Float(0.5));
+ Test::LongFloatD di1;
+ di1[999999110] = Ice::Float(-1.1);
+ di1[999999111] = Ice::Float(123123.2);
+ Test::LongFloatD di2;
+ di2[999999110] = Ice::Float(-1.1);
+ di2[999999120] = Ice::Float(-100.4);
+ di2[999999130] = Ice::Float(0.5);
+
+ Test::LongFloatD _do;
+ Test::LongFloatD ro = p->opLongFloatD(di1, di2, _do);
+
+ test(_do == di1);
+ test(ro.size() == 4);
+ test(ro[999999110] == Ice::Float(-1.1));
+ test(ro[999999120] == Ice::Float(-100.4));
+ test(ro[999999111] == Ice::Float(123123.2));
+ test(ro[999999130] == Ice::Float(0.5));
}
{
- Test::StringStringD di1;
- di1["foo"] = "abc -1.1";
- di1["bar"] = "abc 123123.2";
- Test::StringStringD di2;
- di2["foo"] = "abc -1.1";
- di2["FOO"] = "abc -100.4";
- di2["BAR"] = "abc 0.5";
-
- Test::StringStringD _do;
- Test::StringStringD ro = p->opStringStringD(di1, di2, _do);
-
- test(_do == di1);
- test(ro.size() == 4);
- test(ro["foo"] == "abc -1.1");
- test(ro["FOO"] == "abc -100.4");
- test(ro["bar"] == "abc 123123.2");
- test(ro["BAR"] == "abc 0.5");
+ Test::StringStringD di1;
+ di1["foo"] = "abc -1.1";
+ di1["bar"] = "abc 123123.2";
+ Test::StringStringD di2;
+ di2["foo"] = "abc -1.1";
+ di2["FOO"] = "abc -100.4";
+ di2["BAR"] = "abc 0.5";
+
+ Test::StringStringD _do;
+ Test::StringStringD ro = p->opStringStringD(di1, di2, _do);
+
+ test(_do == di1);
+ test(ro.size() == 4);
+ test(ro["foo"] == "abc -1.1");
+ test(ro["FOO"] == "abc -100.4");
+ test(ro["bar"] == "abc 123123.2");
+ test(ro["BAR"] == "abc 0.5");
}
{
- Test::StringMyEnumD di1;
- di1["abc"] = Test::enum1;
- di1[""] = Test::enum2;
- Test::StringMyEnumD di2;
- di2["abc"] = Test::enum1;
- di2["qwerty"] = Test::enum3;
- di2["Hello!!"] = Test::enum2;
-
- Test::StringMyEnumD _do;
- Test::StringMyEnumD ro = p->opStringMyEnumD(di1, di2, _do);
-
- test(_do == di1);
- test(ro.size() == 4);
- test(ro["abc"] == Test::enum1);
- test(ro["qwerty"] == Test::enum3);
- test(ro[""] == Test::enum2);
- test(ro["Hello!!"] == Test::enum2);
+ Test::StringMyEnumD di1;
+ di1["abc"] = Test::enum1;
+ di1[""] = Test::enum2;
+ Test::StringMyEnumD di2;
+ di2["abc"] = Test::enum1;
+ di2["qwerty"] = Test::enum3;
+ di2["Hello!!"] = Test::enum2;
+
+ Test::StringMyEnumD _do;
+ Test::StringMyEnumD ro = p->opStringMyEnumD(di1, di2, _do);
+
+ test(_do == di1);
+ test(ro.size() == 4);
+ test(ro["abc"] == Test::enum1);
+ test(ro["qwerty"] == Test::enum3);
+ test(ro[""] == Test::enum2);
+ test(ro["Hello!!"] == Test::enum2);
}
{
- const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 };
-
- for(int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l)
- {
- Test::IntS s;
- for(int i = 0; i < lengths[l]; ++i)
- {
- s.push_back(i);
- }
- Test::IntS r = p->opIntS(s);
- test(r.size() == static_cast<size_t>(lengths[l]));
- for(int j = 0; j < static_cast<int>(r.size()); ++j)
- {
- test(r[j] == -j);
- }
- }
+ const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 };
+
+ for(int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l)
+ {
+ Test::IntS s;
+ for(int i = 0; i < lengths[l]; ++i)
+ {
+ s.push_back(i);
+ }
+ Test::IntS r = p->opIntS(s);
+ test(r.size() == static_cast<size_t>(lengths[l]));
+ for(int j = 0; j < static_cast<int>(r.size()); ++j)
+ {
+ test(r[j] == -j);
+ }
+ }
}
{
- Ice::Context ctx;
- ctx["one"] = "ONE";
- ctx["two"] = "TWO";
- ctx["three"] = "THREE";
- {
- Test::StringStringD r = p->opContext();
- test(p->ice_getContext().empty());
- test(r != ctx);
- }
- {
- Test::StringStringD r = p->opContext(ctx);
- test(p->ice_getContext().empty());
- test(r == ctx);
- }
- {
- Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx));
- test(p2->ice_getContext() == ctx);
- Test::StringStringD r = p2->opContext();
- test(r == ctx);
- r = p2->opContext(ctx);
- test(r == ctx);
- }
-
- {
- //
- // Test proxy context
- //
+ Ice::Context ctx;
+ ctx["one"] = "ONE";
+ ctx["two"] = "TWO";
+ ctx["three"] = "THREE";
+ {
+ Test::StringStringD r = p->opContext();
+ test(p->ice_getContext().empty());
+ test(r != ctx);
+ }
+ {
+ Test::StringStringD r = p->opContext(ctx);
+ test(p->ice_getContext().empty());
+ test(r == ctx);
+ }
+ {
+ Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx));
+ test(p2->ice_getContext() == ctx);
+ Test::StringStringD r = p2->opContext();
+ test(r == ctx);
+ r = p2->opContext(ctx);
+ test(r == ctx);
+ }
+
+ {
+ //
+ // Test proxy context
+ //
string ref = communicator->getProperties()->getPropertyWithDefault(
"Operations.Proxy", "test:default -p 12010 -t 10000");
Test::MyClassPrx c = Test::MyClassPrx::checkedCast(communicator->stringToProxy(ref));
- Ice::Context dflt;
- dflt["a"] = "b";
- Test::MyClassPrx c2 = Test::MyClassPrx::uncheckedCast(c->ice_context(dflt));
- test(c2->opContext()["a"] == "b");
+ Ice::Context dflt;
+ dflt["a"] = "b";
+ Test::MyClassPrx c2 = Test::MyClassPrx::uncheckedCast(c->ice_context(dflt));
+ test(c2->opContext()["a"] == "b");
- dflt.clear();
- Test::MyClassPrx c3 = Test::MyClassPrx::uncheckedCast(c2->ice_context(dflt));
- Ice::Context tmp = c3->opContext();
- test(tmp.find("a") == tmp.end());
- }
+ dflt.clear();
+ Test::MyClassPrx c3 = Test::MyClassPrx::uncheckedCast(c2->ice_context(dflt));
+ Ice::Context tmp = c3->opContext();
+ test(tmp.find("a") == tmp.end());
+ }
}
{
Ice::Double d = 1278312346.0 / 13.0;
- Test::DoubleS ds(5, d);
- p->opDoubleMarshaling(d, ds);
+ Test::DoubleS ds(5, d);
+ p->opDoubleMarshaling(d, ds);
}
}
diff --git a/cppe/test/IceE/proxy/Client.cpp b/cppe/test/IceE/proxy/Client.cpp
index f784087c6c1..409c225fc7b 100644
--- a/cppe/test/IceE/proxy/Client.cpp
+++ b/cppe/test/IceE/proxy/Client.cpp
@@ -36,16 +36,16 @@ public:
initData.properties->setProperty("Ice.ThreadPool.Client.Size", "2");
initData.properties->setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
- loadConfig(initData.properties);
+ loadConfig(initData.properties);
- //
- // Now parse argc/argv into initData
- //
- initData.properties = Ice::createProperties(argc, argv, initData.properties);
+ //
+ // Now parse argc/argv into initData
+ //
+ initData.properties = Ice::createProperties(argc, argv, initData.properties);
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
-
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
+
//
// We don't want connection warnings because of the timeout test.
//
diff --git a/cppe/test/IceE/proxy/Collocated.cpp b/cppe/test/IceE/proxy/Collocated.cpp
index fca190babce..48680607cd2 100644
--- a/cppe/test/IceE/proxy/Collocated.cpp
+++ b/cppe/test/IceE/proxy/Collocated.cpp
@@ -26,17 +26,17 @@ public:
virtual int
run(int argc, char* argv[])
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties();
initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
- loadConfig(initData.properties);
- //
- // Now parse argc/argv into initData.properties
- //
- initData.properties = Ice::createProperties(argc, argv, initData.properties);
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
+ loadConfig(initData.properties);
+ //
+ // Now parse argc/argv into initData.properties
+ //
+ initData.properties = Ice::createProperties(argc, argv, initData.properties);
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
adapter->add(new MyDerivedClassI, communicator()->stringToIdentity("test"));
diff --git a/cppe/test/IceE/proxy/Server.cpp b/cppe/test/IceE/proxy/Server.cpp
index c928a86ae17..d2a7a73614c 100644
--- a/cppe/test/IceE/proxy/Server.cpp
+++ b/cppe/test/IceE/proxy/Server.cpp
@@ -31,9 +31,9 @@ public:
initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
initData.properties->setProperty("Ice.Warn.Connections", "0");
- loadConfig(initData.properties);
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
+ loadConfig(initData.properties);
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
adapter->add(new MyDerivedClassI, communicator()->stringToIdentity("test"));
diff --git a/cppe/test/IceE/retry/AllTests.cpp b/cppe/test/IceE/retry/AllTests.cpp
index f2227de7c3c..557a27b773e 100644
--- a/cppe/test/IceE/retry/AllTests.cpp
+++ b/cppe/test/IceE/retry/AllTests.cpp
@@ -42,12 +42,12 @@ allTests(const Ice::CommunicatorPtr& communicator)
tprintf("calling operation to kill connection with second proxy... ");
try
{
- retry2->op(true);
- test(false);
+ retry2->op(true);
+ test(false);
}
catch(Ice::ConnectionLostException)
{
- tprintf("ok\n");
+ tprintf("ok\n");
}
tprintf("calling regular operation with first proxy again... ");
diff --git a/cppe/test/IceE/retry/Client.cpp b/cppe/test/IceE/retry/Client.cpp
index 0cbafc1b3cd..45ddd78d996 100644
--- a/cppe/test/IceE/retry/Client.cpp
+++ b/cppe/test/IceE/retry/Client.cpp
@@ -28,23 +28,23 @@ public:
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- //initData.properties->setProperty("Ice.Trace.Network", "5");
- //initData.properties->setProperty("Ice.Trace.Protocol", "5");
+ //initData.properties->setProperty("Ice.Trace.Network", "5");
+ //initData.properties->setProperty("Ice.Trace.Protocol", "5");
- loadConfig(initData.properties);
+ loadConfig(initData.properties);
- //
- // For this test, we want to disable retries.
- //
- initData.properties->setProperty("Ice.RetryIntervals", "-1");
+ //
+ // For this test, we want to disable retries.
+ //
+ initData.properties->setProperty("Ice.RetryIntervals", "-1");
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
- //
- // This test kills connections, so we don't want warnings.
- //
- communicator()->getProperties()->setProperty("Ice.Warn.Connections", "0");
+ //
+ // This test kills connections, so we don't want warnings.
+ //
+ communicator()->getProperties()->setProperty("Ice.Warn.Connections", "0");
Test::RetryPrx allTests(const Ice::CommunicatorPtr&);
Test::RetryPrx retry = allTests(communicator());
diff --git a/cppe/test/IceE/retry/Server.cpp b/cppe/test/IceE/retry/Server.cpp
index fba90fdde84..bd4e16a2dc9 100644
--- a/cppe/test/IceE/retry/Server.cpp
+++ b/cppe/test/IceE/retry/Server.cpp
@@ -26,16 +26,16 @@ public:
virtual int
run(int argc, char* argv[])
{
- Ice::InitializationData initData;
+ Ice::InitializationData initData;
initData.properties = Ice::createProperties();
- initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
- //initData.properties->setProperty("Ice.Trace.Network", "5");
- //initData.properties->setProperty("Ice.Trace.Protocol", "5");
+ initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ //initData.properties->setProperty("Ice.Trace.Network", "5");
+ //initData.properties->setProperty("Ice.Trace.Protocol", "5");
- loadConfig(initData.properties);
- initData.logger = getLogger();
- setCommunicator(Ice::initialize(argc, argv, initData));
+ loadConfig(initData.properties);
+ initData.logger = getLogger();
+ setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
Ice::ObjectPtr object = new RetryI;
diff --git a/cppe/test/IceE/retry/TestI.cpp b/cppe/test/IceE/retry/TestI.cpp
index c6429890591..d4d9666dc37 100644
--- a/cppe/test/IceE/retry/TestI.cpp
+++ b/cppe/test/IceE/retry/TestI.cpp
@@ -16,7 +16,7 @@ RetryI::op(bool kill, const Ice::Current& current)
{
if(kill)
{
- current.con->close(true);
+ current.con->close(true);
}
}
diff --git a/cppe/test/IceE/slicing/AllTests.cpp b/cppe/test/IceE/slicing/AllTests.cpp
index 8172ce850fe..9e7f7301b0f 100644
--- a/cppe/test/IceE/slicing/AllTests.cpp
+++ b/cppe/test/IceE/slicing/AllTests.cpp
@@ -19,7 +19,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex>
public:
CallbackBase() :
- _called(false)
+ _called(false)
{
}
@@ -29,26 +29,26 @@ public:
bool check()
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- while(!_called)
- {
- if(!timedWait(IceUtil::Time::seconds(5)))
- {
- return false;
- }
- }
- _called = false;
- return true;
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ while(!_called)
+ {
+ if(!timedWait(IceUtil::Time::seconds(5)))
+ {
+ return false;
+ }
+ }
+ _called = false;
+ return true;
}
protected:
void called()
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- assert(!_called);
- _called = true;
- notify();
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ assert(!_called);
+ _called = true;
+ notify();
}
private:
@@ -65,260 +65,260 @@ allTests(const Ice::CommunicatorPtr& communicator)
tprintf("base... "); fflush(stdout);
{
- try
- {
- test->baseAsBase();
- test(false);
- }
- catch(const Base& b)
- {
- test(b.b == "Base.b");
- test(b.ice_name() =="Test::Base");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->baseAsBase();
+ test(false);
+ }
+ catch(const Base& b)
+ {
+ test(b.b == "Base.b");
+ test(b.ice_name() =="Test::Base");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("slicing of unknown derived... "); fflush(stdout);
{
- try
- {
- test->unknownDerivedAsBase();
- test(false);
- }
- catch(const Base& b)
- {
- test(b.b == "UnknownDerived.b");
- test(b.ice_name() =="Test::Base");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->unknownDerivedAsBase();
+ test(false);
+ }
+ catch(const Base& b)
+ {
+ test(b.b == "UnknownDerived.b");
+ test(b.ice_name() =="Test::Base");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("non-slicing of known derived as base... "); fflush(stdout);
{
- try
- {
- test->knownDerivedAsBase();
- test(false);
- }
- catch(const KnownDerived& k)
- {
- test(k.b == "KnownDerived.b");
- test(k.kd == "KnownDerived.kd");
- test(k.ice_name() =="Test::KnownDerived");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->knownDerivedAsBase();
+ test(false);
+ }
+ catch(const KnownDerived& k)
+ {
+ test(k.b == "KnownDerived.b");
+ test(k.kd == "KnownDerived.kd");
+ test(k.ice_name() =="Test::KnownDerived");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("non-slicing of known derived as derived... "); fflush(stdout);
{
- try
- {
- test->knownDerivedAsKnownDerived();
- test(false);
- }
- catch(const KnownDerived& k)
- {
- test(k.b == "KnownDerived.b");
- test(k.kd == "KnownDerived.kd");
- test(k.ice_name() =="Test::KnownDerived");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->knownDerivedAsKnownDerived();
+ test(false);
+ }
+ catch(const KnownDerived& k)
+ {
+ test(k.b == "KnownDerived.b");
+ test(k.kd == "KnownDerived.kd");
+ test(k.ice_name() =="Test::KnownDerived");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("slicing of unknown intermediate as base... "); fflush(stdout);
{
- try
- {
- test->unknownIntermediateAsBase();
- test(false);
- }
- catch(const Base& b)
- {
- test(b.b == "UnknownIntermediate.b");
- test(b.ice_name() =="Test::Base");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->unknownIntermediateAsBase();
+ test(false);
+ }
+ catch(const Base& b)
+ {
+ test(b.b == "UnknownIntermediate.b");
+ test(b.ice_name() =="Test::Base");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("slicing of known intermediate as base... "); fflush(stdout);
{
- try
- {
- test->knownIntermediateAsBase();
- test(false);
- }
- catch(const KnownIntermediate& ki)
- {
- test(ki.b == "KnownIntermediate.b");
- test(ki.ki == "KnownIntermediate.ki");
- test(ki.ice_name() =="Test::KnownIntermediate");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->knownIntermediateAsBase();
+ test(false);
+ }
+ catch(const KnownIntermediate& ki)
+ {
+ test(ki.b == "KnownIntermediate.b");
+ test(ki.ki == "KnownIntermediate.ki");
+ test(ki.ice_name() =="Test::KnownIntermediate");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("slicing of known most derived as base... "); fflush(stdout);
{
- try
- {
- test->knownMostDerivedAsBase();
- test(false);
- }
- catch(const KnownMostDerived& kmd)
- {
- test(kmd.b == "KnownMostDerived.b");
- test(kmd.ki == "KnownMostDerived.ki");
- test(kmd.kmd == "KnownMostDerived.kmd");
- test(kmd.ice_name() =="Test::KnownMostDerived");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->knownMostDerivedAsBase();
+ test(false);
+ }
+ catch(const KnownMostDerived& kmd)
+ {
+ test(kmd.b == "KnownMostDerived.b");
+ test(kmd.ki == "KnownMostDerived.ki");
+ test(kmd.kmd == "KnownMostDerived.kmd");
+ test(kmd.ice_name() =="Test::KnownMostDerived");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("non-slicing of known intermediate as intermediate... "); fflush(stdout);
{
- try
- {
- test->knownIntermediateAsKnownIntermediate();
- test(false);
- }
- catch(const KnownIntermediate& ki)
- {
- test(ki.b == "KnownIntermediate.b");
- test(ki.ki == "KnownIntermediate.ki");
- test(ki.ice_name() =="Test::KnownIntermediate");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->knownIntermediateAsKnownIntermediate();
+ test(false);
+ }
+ catch(const KnownIntermediate& ki)
+ {
+ test(ki.b == "KnownIntermediate.b");
+ test(ki.ki == "KnownIntermediate.ki");
+ test(ki.ice_name() =="Test::KnownIntermediate");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("non-slicing of known most derived exception as intermediate... "); fflush(stdout);
{
- try
- {
- test->knownMostDerivedAsKnownIntermediate();
- test(false);
- }
- catch(const KnownMostDerived& kmd)
- {
- test(kmd.b == "KnownMostDerived.b");
- test(kmd.ki == "KnownMostDerived.ki");
- test(kmd.kmd == "KnownMostDerived.kmd");
- test(kmd.ice_name() =="Test::KnownMostDerived");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->knownMostDerivedAsKnownIntermediate();
+ test(false);
+ }
+ catch(const KnownMostDerived& kmd)
+ {
+ test(kmd.b == "KnownMostDerived.b");
+ test(kmd.ki == "KnownMostDerived.ki");
+ test(kmd.kmd == "KnownMostDerived.kmd");
+ test(kmd.ice_name() =="Test::KnownMostDerived");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("non-slicing of known most derived as most derived... "); fflush(stdout);
{
- try
- {
- test->knownMostDerivedAsKnownMostDerived();
- test(false);
- }
- catch(const KnownMostDerived& kmd)
- {
- test(kmd.b == "KnownMostDerived.b");
- test(kmd.ki == "KnownMostDerived.ki");
- test(kmd.kmd == "KnownMostDerived.kmd");
- test(kmd.ice_name() =="Test::KnownMostDerived");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->knownMostDerivedAsKnownMostDerived();
+ test(false);
+ }
+ catch(const KnownMostDerived& kmd)
+ {
+ test(kmd.b == "KnownMostDerived.b");
+ test(kmd.ki == "KnownMostDerived.ki");
+ test(kmd.kmd == "KnownMostDerived.kmd");
+ test(kmd.ice_name() =="Test::KnownMostDerived");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("slicing of unknown most derived, known intermediate as base... "); fflush(stdout);
{
- try
- {
- test->unknownMostDerived1AsBase();
- test(false);
- }
- catch(const KnownIntermediate& ki)
- {
- test(ki.b == "UnknownMostDerived1.b");
- test(ki.ki == "UnknownMostDerived1.ki");
- test(ki.ice_name() =="Test::KnownIntermediate");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->unknownMostDerived1AsBase();
+ test(false);
+ }
+ catch(const KnownIntermediate& ki)
+ {
+ test(ki.b == "UnknownMostDerived1.b");
+ test(ki.ki == "UnknownMostDerived1.ki");
+ test(ki.ice_name() =="Test::KnownIntermediate");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("slicing of unknown most derived, known intermediate as intermediate... "); fflush(stdout);
{
- try
- {
- test->unknownMostDerived1AsKnownIntermediate();
- test(false);
- }
- catch(const KnownIntermediate& ki)
- {
- test(ki.b == "UnknownMostDerived1.b");
- test(ki.ki == "UnknownMostDerived1.ki");
- test(ki.ice_name() =="Test::KnownIntermediate");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->unknownMostDerived1AsKnownIntermediate();
+ test(false);
+ }
+ catch(const KnownIntermediate& ki)
+ {
+ test(ki.b == "UnknownMostDerived1.b");
+ test(ki.ki == "UnknownMostDerived1.ki");
+ test(ki.ice_name() =="Test::KnownIntermediate");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
tprintf("slicing of unknown most derived, unknown intermediate as base... "); fflush(stdout);
{
- try
- {
- test->unknownMostDerived2AsBase();
- test(false);
- }
- catch(const Base& b)
- {
- test(b.b == "UnknownMostDerived2.b");
- test(b.ice_name() =="Test::Base");
- }
- catch(...)
- {
- test(false);
- }
+ try
+ {
+ test->unknownMostDerived2AsBase();
+ test(false);
+ }
+ catch(const Base& b)
+ {
+ test(b.b == "UnknownMostDerived2.b");
+ test(b.ice_name() =="Test::Base");
+ }
+ catch(...)
+ {
+ test(false);
+ }
}
tprintf("ok\n");
diff --git a/cppe/test/IceE/slicing/Client.cpp b/cppe/test/IceE/slicing/Client.cpp
index 62f10a5ca01..7ae8414a960 100644
--- a/cppe/test/IceE/slicing/Client.cpp
+++ b/cppe/test/IceE/slicing/Client.cpp
@@ -29,7 +29,7 @@ public:
Ice::InitializationData initData;
initData.properties = Ice::createProperties();
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
TestIntfPrx allTests(const Ice::CommunicatorPtr&);
diff --git a/cppe/test/IceE/slicing/Server.cpp b/cppe/test/IceE/slicing/Server.cpp
index 3d21896dbf2..479b3db1982 100644
--- a/cppe/test/IceE/slicing/Server.cpp
+++ b/cppe/test/IceE/slicing/Server.cpp
@@ -31,7 +31,7 @@ public:
initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
loadConfig(initData.properties);
- initData.logger = getLogger();
+ initData.logger = getLogger();
setCommunicator(Ice::initialize(argc, argv, initData));
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("TestAdapter");
@@ -40,7 +40,7 @@ public:
adapter->activate();
#ifndef _WIN32_WCE
- communicator()->waitForShutdown();
+ communicator()->waitForShutdown();
#endif
return EXIT_SUCCESS;
diff --git a/cppe/test/IceE/thread/AliveTest.cpp b/cppe/test/IceE/thread/AliveTest.cpp
index 8961b07157f..eda4e37e7a6 100644
--- a/cppe/test/IceE/thread/AliveTest.cpp
+++ b/cppe/test/IceE/thread/AliveTest.cpp
@@ -21,24 +21,24 @@ class CondVar : public IceUtil::Monitor<IceUtil::RecMutex>
public:
CondVar() :
- _done(false)
+ _done(false)
{
}
void waitForSignal()
{
- IceUtil::Monitor<IceUtil::RecMutex>::Lock lock(*this);
- while(!_done)
- {
- wait();
- }
+ IceUtil::Monitor<IceUtil::RecMutex>::Lock lock(*this);
+ while(!_done)
+ {
+ wait();
+ }
}
void signal()
{
- IceUtil::Monitor<IceUtil::RecMutex>::Lock lock(*this);
- _done = true;
- notify();
+ IceUtil::Monitor<IceUtil::RecMutex>::Lock lock(*this);
+ _done = true;
+ notify();
}
private:
@@ -51,20 +51,20 @@ class AliveTestThread : public Thread
public:
AliveTestThread(CondVar& childCreated, CondVar& parentReady) :
- _childCreated(childCreated), _parentReady(parentReady)
+ _childCreated(childCreated), _parentReady(parentReady)
{
}
virtual void run()
{
- try
- {
- _childCreated.signal();
- _parentReady.waitForSignal();
- }
- catch(IceUtil::ThreadLockedException &)
- {
- }
+ try
+ {
+ _childCreated.signal();
+ _parentReady.waitForSignal();
+ }
+ catch(IceUtil::ThreadLockedException &)
+ {
+ }
}
private:
diff --git a/cppe/test/IceE/thread/Client.cpp b/cppe/test/IceE/thread/Client.cpp
index 7c38af8b853..a0a25c350bc 100644
--- a/cppe/test/IceE/thread/Client.cpp
+++ b/cppe/test/IceE/thread/Client.cpp
@@ -27,21 +27,21 @@ public:
virtual int run(int argc, char* argv[])
{
- try
- {
- initializeTestSuite();
+ try
+ {
+ initializeTestSuite();
- for(list<TestBasePtr>::const_iterator p = allTests.begin(); p != allTests.end(); ++p)
- {
- (*p)->start();
- }
- }
- catch(const TestFailed& e)
- {
- tprintf("test %s failed\n", e.name.c_str());
- return EXIT_FAILURE;
- }
- return EXIT_SUCCESS;
+ for(list<TestBasePtr>::const_iterator p = allTests.begin(); p != allTests.end(); ++p)
+ {
+ (*p)->start();
+ }
+ }
+ catch(const TestFailed& e)
+ {
+ tprintf("test %s failed\n", e.name.c_str());
+ return EXIT_FAILURE;
+ }
+ return EXIT_SUCCESS;
}
};
diff --git a/cppe/test/IceE/thread/CreateTest.cpp b/cppe/test/IceE/thread/CreateTest.cpp
index 9bee30ac317..70ff6513d7d 100644
--- a/cppe/test/IceE/thread/CreateTest.cpp
+++ b/cppe/test/IceE/thread/CreateTest.cpp
@@ -25,13 +25,13 @@ class CreateTestThread : public Thread
public:
CreateTestThread() :
- threadran(false)
+ threadran(false)
{
}
virtual void run()
{
- threadran = true;
+ threadran = true;
}
bool threadran;
@@ -56,22 +56,22 @@ CreateTest::run()
#endif
for(int i = 0; i < nthreads ; ++i)
{
- CreateTestThreadPtr t = new CreateTestThread();
- ThreadControl control = t->start();
- control.join();
- test(t->threadran);
+ CreateTestThreadPtr t = new CreateTestThread();
+ ThreadControl control = t->start();
+ control.join();
+ test(t->threadran);
#ifdef _WIN32_WCE
- if((i % 32) == 0)
- {
- tprintf(".");
- }
+ if((i % 32) == 0)
+ {
+ tprintf(".");
+ }
#else
- if((i % 256) == 0)
- {
- char buf[5];
- sprintf(buf, "%04d", i);
- tprintf("%s", buf);
- }
+ if((i % 256) == 0)
+ {
+ char buf[5];
+ sprintf(buf, "%04d", i);
+ tprintf("%s", buf);
+ }
#endif
}
#ifndef _WIN32_WCE
diff --git a/cppe/test/IceE/thread/MonitorMutexTest.cpp b/cppe/test/IceE/thread/MonitorMutexTest.cpp
index d987205033f..55dbf5531b3 100644
--- a/cppe/test/IceE/thread/MonitorMutexTest.cpp
+++ b/cppe/test/IceE/thread/MonitorMutexTest.cpp
@@ -20,33 +20,33 @@ class MonitorMutexTestThread : public Thread
public:
MonitorMutexTestThread(Monitor<Mutex>& m) :
- _monitor(m),
- _tryLock(false)
+ _monitor(m),
+ _tryLock(false)
{
}
virtual void run()
{
- Monitor<Mutex>::TryLock tlock(_monitor);
- test(!tlock.acquired());
-
- {
- Mutex::Lock lock(_tryLockMutex);
- _tryLock = true;
- }
- _tryLockCond.signal();
-
- Monitor<Mutex>::Lock lock(_monitor);
+ Monitor<Mutex>::TryLock tlock(_monitor);
+ test(!tlock.acquired());
+
+ {
+ Mutex::Lock lock(_tryLockMutex);
+ _tryLock = true;
+ }
+ _tryLockCond.signal();
+
+ Monitor<Mutex>::Lock lock(_monitor);
}
void
waitTryLock()
{
- Mutex::Lock lock(_tryLockMutex);
- while(!_tryLock)
- {
- _tryLockCond.wait(lock);
- }
+ Mutex::Lock lock(_tryLockMutex);
+ while(!_tryLock)
+ {
+ _tryLockCond.wait(lock);
+ }
}
private:
@@ -67,16 +67,16 @@ class MonitorMutexTestThread2 : public Thread
public:
MonitorMutexTestThread2(Monitor<Mutex>& monitor) :
- finished(false),
- _monitor(monitor)
+ finished(false),
+ _monitor(monitor)
{
}
virtual void run()
{
- Monitor<Mutex>::Lock lock(_monitor);
- _monitor.wait();
- finished = true;
+ Monitor<Mutex>::Lock lock(_monitor);
+ _monitor.wait();
+ finished = true;
}
bool finished;
@@ -106,23 +106,23 @@ MonitorMutexTest::run()
ThreadControl control2;
{
- Monitor<Mutex>::Lock lock(monitor);
-
- try
- {
- Monitor<Mutex>::TryLock tlock(monitor);
- test(!tlock.acquired());
- }
- catch(const ThreadLockedException&)
- {
- }
-
- // TEST: Start thread, try to acquire the mutex.
- t = new MonitorMutexTestThread(monitor);
- control = t->start();
-
- // TEST: Wait until the tryLock has been tested.
- t->waitTryLock();
+ Monitor<Mutex>::Lock lock(monitor);
+
+ try
+ {
+ Monitor<Mutex>::TryLock tlock(monitor);
+ test(!tlock.acquired());
+ }
+ catch(const ThreadLockedException&)
+ {
+ }
+
+ // TEST: Start thread, try to acquire the mutex.
+ t = new MonitorMutexTestThread(monitor);
+ control = t->start();
+
+ // TEST: Wait until the tryLock has been tested.
+ t->waitTryLock();
}
//
@@ -141,8 +141,8 @@ MonitorMutexTest::run()
ThreadControl::sleep(Time::seconds(1));
{
- Monitor<Mutex>::Lock lock(monitor);
- monitor.notify();
+ Monitor<Mutex>::Lock lock(monitor);
+ monitor.notify();
}
// Give one thread time to terminate
@@ -151,8 +151,8 @@ MonitorMutexTest::run()
test((t2->finished && !t3->finished) || (t3->finished && !t2->finished));
{
- Monitor<Mutex>::Lock lock(monitor);
- monitor.notify();
+ Monitor<Mutex>::Lock lock(monitor);
+ monitor.notify();
}
control.join();
control2.join();
@@ -167,8 +167,8 @@ MonitorMutexTest::run()
ThreadControl::sleep(Time::seconds(1));
{
- Monitor<Mutex>::Lock lock(monitor);
- monitor.notifyAll();
+ Monitor<Mutex>::Lock lock(monitor);
+ monitor.notifyAll();
}
control.join();
@@ -176,7 +176,7 @@ MonitorMutexTest::run()
// TEST: timedWait
{
- Monitor<Mutex>::Lock lock(monitor);
- test(!monitor.timedWait(Time::milliSeconds(500)));
+ Monitor<Mutex>::Lock lock(monitor);
+ test(!monitor.timedWait(Time::milliSeconds(500)));
}
}
diff --git a/cppe/test/IceE/thread/MonitorRecMutexTest.cpp b/cppe/test/IceE/thread/MonitorRecMutexTest.cpp
index ca4c5072a5b..8cd2e1854cd 100644
--- a/cppe/test/IceE/thread/MonitorRecMutexTest.cpp
+++ b/cppe/test/IceE/thread/MonitorRecMutexTest.cpp
@@ -20,34 +20,34 @@ class MonitorRecMutexTestThread : public Thread
public:
MonitorRecMutexTestThread(Monitor<RecMutex>& m) :
- _monitor(m),
- _tryLock(false)
+ _monitor(m),
+ _tryLock(false)
{
}
virtual void run()
{
-
- Monitor<RecMutex>::TryLock tlock(_monitor);
- test(!tlock.acquired());
-
- {
- Mutex::Lock lock(_tryLockMutex);
- _tryLock = true;
- }
- _tryLockCond.signal();
-
- Monitor<RecMutex>::Lock lock(_monitor);
+
+ Monitor<RecMutex>::TryLock tlock(_monitor);
+ test(!tlock.acquired());
+
+ {
+ Mutex::Lock lock(_tryLockMutex);
+ _tryLock = true;
+ }
+ _tryLockCond.signal();
+
+ Monitor<RecMutex>::Lock lock(_monitor);
}
void
waitTryLock()
{
- Mutex::Lock lock(_tryLockMutex);
- while(!_tryLock)
- {
- _tryLockCond.wait(lock);
- }
+ Mutex::Lock lock(_tryLockMutex);
+ while(!_tryLock)
+ {
+ _tryLockCond.wait(lock);
+ }
}
private:
@@ -68,16 +68,16 @@ class MonitorRecMutexTestThread2 : public Thread, public Monitor<RecMutex>
public:
MonitorRecMutexTestThread2(Monitor<RecMutex>& monitor) :
- finished(false),
- _monitor(monitor)
+ finished(false),
+ _monitor(monitor)
{
}
virtual void run()
{
- Monitor<RecMutex>::Lock lock(_monitor);
- _monitor.wait();
- finished = true;
+ Monitor<RecMutex>::Lock lock(_monitor);
+ _monitor.wait();
+ finished = true;
}
bool finished;
@@ -108,22 +108,22 @@ MonitorRecMutexTest::run()
{
- Monitor<RecMutex>::Lock lock(monitor);
-
- Monitor<RecMutex>::TryLock lock2(monitor);
- test(lock2.acquired());
-
- // TEST: TryLock
-
- Monitor<RecMutex>::TryLock tlock(monitor);
- test(tlock.acquired());
-
- // TEST: Start thread, try to acquire the mutex.
- t = new MonitorRecMutexTestThread(monitor);
- control = t->start();
-
- // TEST: Wait until the tryLock has been tested.
- t->waitTryLock();
+ Monitor<RecMutex>::Lock lock(monitor);
+
+ Monitor<RecMutex>::TryLock lock2(monitor);
+ test(lock2.acquired());
+
+ // TEST: TryLock
+
+ Monitor<RecMutex>::TryLock tlock(monitor);
+ test(tlock.acquired());
+
+ // TEST: Start thread, try to acquire the mutex.
+ t = new MonitorRecMutexTestThread(monitor);
+ control = t->start();
+
+ // TEST: Wait until the tryLock has been tested.
+ t->waitTryLock();
}
//
@@ -142,8 +142,8 @@ MonitorRecMutexTest::run()
ThreadControl::sleep(Time::seconds(1));
{
- Monitor<RecMutex>::Lock lock(monitor);
- monitor.notify();
+ Monitor<RecMutex>::Lock lock(monitor);
+ monitor.notify();
}
// Give one thread time to terminate
@@ -152,8 +152,8 @@ MonitorRecMutexTest::run()
test((t2->finished && !t3->finished) || (t3->finished && !t2->finished));
{
- Monitor<RecMutex>::Lock lock(monitor);
- monitor.notify();
+ Monitor<RecMutex>::Lock lock(monitor);
+ monitor.notify();
}
control.join();
control2.join();
@@ -168,8 +168,8 @@ MonitorRecMutexTest::run()
ThreadControl::sleep(Time::seconds(1));
{
- Monitor<RecMutex>::Lock lock(monitor);
- monitor.notifyAll();
+ Monitor<RecMutex>::Lock lock(monitor);
+ monitor.notifyAll();
}
control.join();
@@ -177,7 +177,7 @@ MonitorRecMutexTest::run()
// TEST: timedWait
{
- Monitor<RecMutex>::Lock lock(monitor);
- test(!monitor.timedWait(Time::milliSeconds(500)));
+ Monitor<RecMutex>::Lock lock(monitor);
+ test(!monitor.timedWait(Time::milliSeconds(500)));
}
}
diff --git a/cppe/test/IceE/thread/MutexTest.cpp b/cppe/test/IceE/thread/MutexTest.cpp
index b5a29e7e9b2..371af7d08a6 100644
--- a/cppe/test/IceE/thread/MutexTest.cpp
+++ b/cppe/test/IceE/thread/MutexTest.cpp
@@ -22,33 +22,33 @@ class MutexTestThread : public Thread
public:
MutexTestThread(Mutex& m) :
- _mutex(m),
- _tryLock(false)
+ _mutex(m),
+ _tryLock(false)
{
}
virtual void run()
- {
- Mutex::TryLock tlock(_mutex);
- test(!tlock.acquired());
+ {
+ Mutex::TryLock tlock(_mutex);
+ test(!tlock.acquired());
- {
- Mutex::Lock lock(_tryLockMutex);
- _tryLock = true;
- }
- _tryLockCond.signal();
+ {
+ Mutex::Lock lock(_tryLockMutex);
+ _tryLock = true;
+ }
+ _tryLockCond.signal();
- Mutex::Lock lock(_mutex);
+ Mutex::Lock lock(_mutex);
}
void
waitTryLock()
{
- Mutex::Lock lock(_tryLockMutex);
- while(!_tryLock)
- {
- _tryLockCond.wait(lock);
- }
+ Mutex::Lock lock(_tryLockMutex);
+ while(!_tryLock)
+ {
+ _tryLockCond.wait(lock);
+ }
}
private:
@@ -77,79 +77,79 @@ MutexTest::run()
ThreadControl control;
{
- Mutex::Lock lock(mutex);
-
- // LockT testing:
- //
-
- test(lock.acquired());
-
- try
- {
- lock.acquire();
- test(false);
- }
- catch(const ThreadLockedException&)
- {
- // Expected
- }
-
- try
- {
- lock.tryAcquire();
- test(false);
- }
- catch(const ThreadLockedException&)
- {
- // Expected
- }
-
- test(lock.acquired());
- lock.release();
- test(!lock.acquired());
-
- try
- {
- lock.release();
- test(false);
- }
- catch(const ThreadLockedException&)
- {
- // Expected
- }
-
- Mutex::TryLock lock2(mutex);
- try
- {
- test(lock.tryAcquire() == false);
- }
- catch(const IceUtil::ThreadLockedException&)
- {
- }
- lock2.release();
- test(lock.tryAcquire() == true);
- test(lock.acquired());
-
- // Deadlock testing
- //
+ Mutex::Lock lock(mutex);
+
+ // LockT testing:
+ //
+
+ test(lock.acquired());
+
+ try
+ {
+ lock.acquire();
+ test(false);
+ }
+ catch(const ThreadLockedException&)
+ {
+ // Expected
+ }
+
+ try
+ {
+ lock.tryAcquire();
+ test(false);
+ }
+ catch(const ThreadLockedException&)
+ {
+ // Expected
+ }
+
+ test(lock.acquired());
+ lock.release();
+ test(!lock.acquired());
+
+ try
+ {
+ lock.release();
+ test(false);
+ }
+ catch(const ThreadLockedException&)
+ {
+ // Expected
+ }
+
+ Mutex::TryLock lock2(mutex);
+ try
+ {
+ test(lock.tryAcquire() == false);
+ }
+ catch(const IceUtil::ThreadLockedException&)
+ {
+ }
+ lock2.release();
+ test(lock.tryAcquire() == true);
+ test(lock.acquired());
+
+ // Deadlock testing
+ //
#if !defined(NDEBUG) && !defined(_WIN32)
- try
- {
- Mutex::Lock lock3(mutex);
- test(false);
- }
- catch(const ThreadLockedException&)
- {
- }
+ try
+ {
+ Mutex::Lock lock3(mutex);
+ test(false);
+ }
+ catch(const ThreadLockedException&)
+ {
+ }
#endif
- // TEST: Start thread, try to acquire the mutex.
- t = new MutexTestThread(mutex);
- control = t->start();
-
- // TEST: Wait until the tryLock has been tested.
- t->waitTryLock();
+ // TEST: Start thread, try to acquire the mutex.
+ t = new MutexTestThread(mutex);
+ control = t->start();
+
+ // TEST: Wait until the tryLock has been tested.
+ t->waitTryLock();
}
//
diff --git a/cppe/test/IceE/thread/RecMutexTest.cpp b/cppe/test/IceE/thread/RecMutexTest.cpp
index 3d52bb13164..0e4d8c14fb7 100644
--- a/cppe/test/IceE/thread/RecMutexTest.cpp
+++ b/cppe/test/IceE/thread/RecMutexTest.cpp
@@ -22,34 +22,34 @@ class RecMutexTestThread : public Thread
public:
RecMutexTestThread(RecMutex& m) :
- _mutex(m),
- _tryLock(false)
+ _mutex(m),
+ _tryLock(false)
{
}
virtual void run()
{
-
- RecMutex::TryLock tlock(_mutex);
- test(!tlock.acquired());
-
- {
- Mutex::Lock lock(_tryLockMutex);
- _tryLock = true;
- }
- _tryLockCond.signal();
-
- RecMutex::Lock lock(_mutex);
+
+ RecMutex::TryLock tlock(_mutex);
+ test(!tlock.acquired());
+
+ {
+ Mutex::Lock lock(_tryLockMutex);
+ _tryLock = true;
+ }
+ _tryLockCond.signal();
+
+ RecMutex::Lock lock(_mutex);
}
void
waitTryLock()
{
- Mutex::Lock lock(_tryLockMutex);
- while(!_tryLock)
- {
- _tryLockCond.wait(lock);
- }
+ Mutex::Lock lock(_tryLockMutex);
+ while(!_tryLock)
+ {
+ _tryLockCond.wait(lock);
+ }
}
private:
@@ -78,22 +78,22 @@ RecMutexTest::run()
ThreadControl control;
{
- RecMutex::Lock lock(mutex);
-
- // TEST: lock twice
- RecMutex::Lock lock2(mutex);
-
- // TEST: TryLock
- RecMutex::TryLock lock3(mutex);
- test(lock3.acquired());
-
- // TEST: Start thread, try to acquire the mutex.
- t = new RecMutexTestThread(mutex);
- control = t->start();
-
- // TEST: Wait until the tryLock has been tested.
- t->waitTryLock();
-
+ RecMutex::Lock lock(mutex);
+
+ // TEST: lock twice
+ RecMutex::Lock lock2(mutex);
+
+ // TEST: TryLock
+ RecMutex::TryLock lock3(mutex);
+ test(lock3.acquired());
+
+ // TEST: Start thread, try to acquire the mutex.
+ t = new RecMutexTestThread(mutex);
+ control = t->start();
+
+ // TEST: Wait until the tryLock has been tested.
+ t->waitTryLock();
+
}
//
diff --git a/cppe/test/IceE/thread/StartTest.cpp b/cppe/test/IceE/thread/StartTest.cpp
index fc19b8e1907..5545b1a737b 100644
--- a/cppe/test/IceE/thread/StartTest.cpp
+++ b/cppe/test/IceE/thread/StartTest.cpp
@@ -32,8 +32,8 @@ public:
virtual void run()
{
- IceUtil::Mutex::Lock sync(threadCountMutex);
- --threadCount;
+ IceUtil::Mutex::Lock sync(threadCountMutex);
+ --threadCount;
}
};
@@ -55,8 +55,8 @@ StartTest::run()
control.join();
try
{
- t->start();
- test(false);
+ t->start();
+ test(false);
}
catch(const ThreadStartedException&)
{
@@ -69,39 +69,39 @@ StartTest::run()
#ifdef _WIN32_WCE
for(int i = 0; i < 50; i++)
{
- for(int j = 0; j < 5; j++)
- {
- {
- IceUtil::Mutex::Lock sync(threadCountMutex);
- ++threadCount;
- }
- Thread* t = new StartTestThread;
- t->start().detach();
- }
+ for(int j = 0; j < 5; j++)
+ {
+ {
+ IceUtil::Mutex::Lock sync(threadCountMutex);
+ ++threadCount;
+ }
+ Thread* t = new StartTestThread;
+ t->start().detach();
+ }
- // Wait for the threads to all terminate. I don't want to use
- // a monitor here, since monitor hasn't been tested yet.
- while(true)
- {
- {
- IceUtil::Mutex::Lock sync(threadCountMutex);
- if(threadCount == 0)
- {
- break;
- }
- }
- ThreadControl::sleep(Time::milliSeconds(5));
- }
+ // Wait for the threads to all terminate. I don't want to use
+ // a monitor here, since monitor hasn't been tested yet.
+ while(true)
+ {
+ {
+ IceUtil::Mutex::Lock sync(threadCountMutex);
+ if(threadCount == 0)
+ {
+ break;
+ }
+ }
+ ThreadControl::sleep(Time::milliSeconds(5));
+ }
}
#else
for(int i = 0; i < 50; i++)
{
- for(int j = 0; j < 50; j++)
- {
- Thread* t = new StartTestThread;
- t->start().detach();
- }
- ThreadControl::sleep(Time::milliSeconds(5));
+ for(int j = 0; j < 50; j++)
+ {
+ Thread* t = new StartTestThread;
+ t->start().detach();
+ }
+ ThreadControl::sleep(Time::milliSeconds(5));
}
#endif
}
diff --git a/cppe/test/IceE/thread/StaticMutexTest.cpp b/cppe/test/IceE/thread/StaticMutexTest.cpp
index f7c40712bc7..e1133d04dde 100644
--- a/cppe/test/IceE/thread/StaticMutexTest.cpp
+++ b/cppe/test/IceE/thread/StaticMutexTest.cpp
@@ -25,32 +25,32 @@ class StaticMutexTestThread : public Thread
public:
StaticMutexTestThread() :
- _tryLock(false)
+ _tryLock(false)
{
}
virtual void run()
- {
- StaticMutex::TryLock tlock(staticMutex);
- test(!tlock.acquired());
+ {
+ StaticMutex::TryLock tlock(staticMutex);
+ test(!tlock.acquired());
- {
- Mutex::Lock lock(_tryLockMutex);
- _tryLock = true;
- }
- _tryLockCond.signal();
+ {
+ Mutex::Lock lock(_tryLockMutex);
+ _tryLock = true;
+ }
+ _tryLockCond.signal();
- StaticMutex::Lock lock(staticMutex);
+ StaticMutex::Lock lock(staticMutex);
}
void
waitTryLock()
{
- Mutex::Lock lock(_tryLockMutex);
- while(!_tryLock)
- {
- _tryLockCond.wait(lock);
- }
+ Mutex::Lock lock(_tryLockMutex);
+ while(!_tryLock)
+ {
+ _tryLockCond.wait(lock);
+ }
}
private:
@@ -77,70 +77,70 @@ StaticMutexTest::run()
ThreadControl control;
{
- StaticMutex::Lock lock(staticMutex);
-
- // LockT testing:
- //
-
- test(lock.acquired());
-
- try
- {
- lock.acquire();
- test(false);
- }
- catch(const ThreadLockedException&)
- {
- // Expected
- }
-
- try
- {
- lock.tryAcquire();
- test(false);
- }
- catch(const ThreadLockedException&)
- {
- // Expected
- }
-
- test(lock.acquired());
- lock.release();
- test(!lock.acquired());
-
- try
- {
- lock.release();
- test(false);
- }
- catch(const ThreadLockedException&)
- {
- // Expected
- }
-
- StaticMutex::TryLock lock2(staticMutex);
- //
- // Under WinCE tryAcquire() does not do recursion checks.
- //
+ StaticMutex::Lock lock(staticMutex);
+
+ // LockT testing:
+ //
+
+ test(lock.acquired());
+
+ try
+ {
+ lock.acquire();
+ test(false);
+ }
+ catch(const ThreadLockedException&)
+ {
+ // Expected
+ }
+
+ try
+ {
+ lock.tryAcquire();
+ test(false);
+ }
+ catch(const ThreadLockedException&)
+ {
+ // Expected
+ }
+
+ test(lock.acquired());
+ lock.release();
+ test(!lock.acquired());
+
+ try
+ {
+ lock.release();
+ test(false);
+ }
+ catch(const ThreadLockedException&)
+ {
+ // Expected
+ }
+
+ StaticMutex::TryLock lock2(staticMutex);
+ //
+ // Under WinCE tryAcquire() does not do recursion checks.
+ //
#ifndef _WIN32_WCE
- try
- {
- test(lock.tryAcquire() == false);
- }
- catch(const IceUtil::ThreadLockedException&)
- {
- }
- lock2.release();
- test(lock.tryAcquire() == true);
- test(lock.acquired());
+ try
+ {
+ test(lock.tryAcquire() == false);
+ }
+ catch(const IceUtil::ThreadLockedException&)
+ {
+ }
+ lock2.release();
+ test(lock.tryAcquire() == true);
+ test(lock.acquired());
#endif
- // TEST: Start thread, try to acquire the mutex.
- t = new StaticMutexTestThread;
- control = t->start();
-
- // TEST: Wait until the tryLock has been tested.
- t->waitTryLock();
+ // TEST: Start thread, try to acquire the mutex.
+ t = new StaticMutexTestThread;
+ control = t->start();
+
+ // TEST: Wait until the tryLock has been tested.
+ t->waitTryLock();
}
//
diff --git a/cppe/test/IceE/thread/TestBase.cpp b/cppe/test/IceE/thread/TestBase.cpp
index 7fdb25442eb..6628ad2f3c4 100644
--- a/cppe/test/IceE/thread/TestBase.cpp
+++ b/cppe/test/IceE/thread/TestBase.cpp
@@ -38,12 +38,12 @@ TestBase::start()
tprintf("running %s test... ", _name.c_str());
try
{
- run();
+ run();
}
catch(const IceUtil::Exception& e)
{
tprintf("%s failed\n", e.toString().c_str());
- throw TestFailed(_name);
+ throw TestFailed(_name);
}
tprintf("ok\n");
}
diff --git a/cppe/test/IceE/uuid/Client.cpp b/cppe/test/IceE/uuid/Client.cpp
index ae3645ba9b4..62daa8a64b2 100644
--- a/cppe/test/IceE/uuid/Client.cpp
+++ b/cppe/test/IceE/uuid/Client.cpp
@@ -31,36 +31,36 @@ class CountedBarrier : public Shared, public Monitor<Mutex>
public:
CountedBarrier(int count) :
- _count(count)
+ _count(count)
{
}
void
decrement()
{
- Lock sync(*this);
- --_count;
- if(_count == 0)
- {
- notifyAll();
- }
+ Lock sync(*this);
+ --_count;
+ if(_count == 0)
+ {
+ notifyAll();
+ }
}
void
waitZero()
{
- Lock sync(*this);
- while(_count != 0)
- {
- wait();
- }
+ Lock sync(*this);
+ while(_count != 0)
+ {
+ wait();
+ }
}
bool
isZero() const
{
- Lock sync(*this);
- return _count == 0;
+ Lock sync(*this);
+ return _count == 0;
}
private:
@@ -74,63 +74,63 @@ class InsertThread : public Thread, public Mutex
public:
InsertThread(const CountedBarrierPtr& start, const CountedBarrierPtr& stop, int threadId, set<string>& uuidSet, long howMany, bool verbose)
- : _start(start), _stop(stop), _threadId(threadId), _uuidSet(uuidSet), _howMany(howMany), _verbose(verbose), _destroyed(false)
+ : _start(start), _stop(stop), _threadId(threadId), _uuidSet(uuidSet), _howMany(howMany), _verbose(verbose), _destroyed(false)
{
}
virtual void
run()
{
- _start->decrement();
- _start->waitZero();
-
- for(long i = 0; i < _howMany && !destroyed(); i++)
- {
- string uuid = generateUUID();
- {
- StaticMutex::Lock lock(staticMutex);
- pair<set<string>::iterator, bool> ok = _uuidSet.insert(uuid);
- if(!ok.second)
- {
- tprintf("******* iteration %d\n", i);
- tprintf("******* Duplicate UUID: %s\n", (*ok.first).c_str());
- }
-
- test(ok.second);
- }
+ _start->decrement();
+ _start->waitZero();
+
+ for(long i = 0; i < _howMany && !destroyed(); i++)
+ {
+ string uuid = generateUUID();
+ {
+ StaticMutex::Lock lock(staticMutex);
+ pair<set<string>::iterator, bool> ok = _uuidSet.insert(uuid);
+ if(!ok.second)
+ {
+ tprintf("******* iteration %d\n", i);
+ tprintf("******* Duplicate UUID: %s\n", (*ok.first).c_str());
+ }
+
+ test(ok.second);
+ }
#ifdef _WIN32_WCE
- if(i > 0 && (i % 100) == 0)
- {
- tprintf(".");
- }
+ if(i > 0 && (i % 100) == 0)
+ {
+ tprintf(".");
+ }
#else
- if(_verbose && i > 0 && (i % 100000 == 0))
- {
- tprintf("Thread %d: generated %d UUIDs.\n", _threadId, i);
- }
+ if(_verbose && i > 0 && (i % 100000 == 0))
+ {
+ tprintf("Thread %d: generated %d UUIDs.\n", _threadId, i);
+ }
#endif
- }
+ }
- _stop->decrement();
+ _stop->decrement();
#ifdef _WIN32_WCE
- // This will cause the main thread to wake.
- tprintf(".");
+ // This will cause the main thread to wake.
+ tprintf(".");
#endif
}
void
destroy()
{
- Lock sync(*this);
- _destroyed = true;
+ Lock sync(*this);
+ _destroyed = true;
}
bool
destroyed() const
{
- Lock sync(*this);
- return _destroyed;
+ Lock sync(*this);
+ return _destroyed;
}
private:
@@ -166,56 +166,56 @@ public:
if(argc > 3)
{
- usage(argv[0]);
- return EXIT_FAILURE;
+ usage(argv[0]);
+ return EXIT_FAILURE;
}
else if(argc == 3)
{
- howMany = atol(argv[1]);
- if (howMany == 0)
- {
- usage(argv[0]);
- return EXIT_FAILURE;
- }
- threadCount = atoi(argv[2]);
- if(threadCount <= 0)
- {
- usage(argv[0]);
- return EXIT_FAILURE;
- }
- verbose = true;
+ howMany = atol(argv[1]);
+ if (howMany == 0)
+ {
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+ threadCount = atoi(argv[2]);
+ if(threadCount <= 0)
+ {
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+ verbose = true;
}
else if(argc == 2)
{
- howMany = atol(argv[1]);
- if (howMany == 0)
- {
- usage(argv[0]);
- return EXIT_FAILURE;
- }
+ howMany = atol(argv[1]);
+ if (howMany == 0)
+ {
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
}
- tprintf("Generating %d UUIDs", howMany);
+ tprintf("Generating %d UUIDs", howMany);
tprintf("... ");
if(verbose)
{
- tprintf("\n");
+ tprintf("\n");
}
- //
- // First measure raw time to produce UUIDs.
- //
+ //
+ // First measure raw time to produce UUIDs.
+ //
Time startTime = Time::now();
- long i;
- for(i = 0; i < howMany; i++)
- {
- generateUUID();
- }
+ long i;
+ for(i = 0; i < howMany; i++)
+ {
+ generateUUID();
+ }
#ifdef _WIN32_WCE
- if(terminated())
- {
- return EXIT_SUCCESS;
- }
+ if(terminated())
+ {
+ return EXIT_SUCCESS;
+ }
#endif
Time finish = Time::now();
@@ -227,73 +227,73 @@ public:
#endif
{
tprintf("Each UUID took an average of %.04f ms to generate and insert into a set<string>.\n",
- ((double) ((finish - startTime).toMilliSeconds())) / howMany);
+ ((double) ((finish - startTime).toMilliSeconds())) / howMany);
}
tprintf("Generating %d UUIDs using %d thread", howMany, threadCount);
if(threadCount > 1)
{
- tprintf("s");
+ tprintf("s");
}
tprintf("... ");
if(verbose)
{
- tprintf("\n");
+ tprintf("\n");
}
- set<string> uuidSet;
+ set<string> uuidSet;
- startTime = Time::now();
- vector<InsertThreadPtr> threads;
+ startTime = Time::now();
+ vector<InsertThreadPtr> threads;
- CountedBarrierPtr stop = new CountedBarrier(threadCount);
- CountedBarrierPtr start = new CountedBarrier(threadCount);
+ CountedBarrierPtr stop = new CountedBarrier(threadCount);
+ CountedBarrierPtr start = new CountedBarrier(threadCount);
for(i = 0; i < threadCount; i++)
{
- InsertThreadPtr t = new InsertThread(start, stop, i, uuidSet, howMany / threadCount, verbose);
- t->start();
- threads.push_back(t);
+ InsertThreadPtr t = new InsertThread(start, stop, i, uuidSet, howMany / threadCount, verbose);
+ t->start();
+ threads.push_back(t);
}
vector<InsertThreadPtr>::iterator p;
#ifdef _WIN32_WCE
- while(!stop->isZero() && !terminated())
- {
- MSG Msg;
- if(GetMessage(&Msg, NULL, 0, 0))
- {
- //
- // Process all pending events.
- //
- do
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
- while(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE));
- }
- }
-
- //
- // If the user terminated the app, the destroy all the
- // threads. This loop will end once all the threads have gone.
- //
- if(terminated())
- {
- for(p = threads.begin(); p != threads.end(); ++p)
- {
- (*p)->destroy();
- }
- }
+ while(!stop->isZero() && !terminated())
+ {
+ MSG Msg;
+ if(GetMessage(&Msg, NULL, 0, 0))
+ {
+ //
+ // Process all pending events.
+ //
+ do
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
+ while(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE));
+ }
+ }
+
+ //
+ // If the user terminated the app, the destroy all the
+ // threads. This loop will end once all the threads have gone.
+ //
+ if(terminated())
+ {
+ for(p = threads.begin(); p != threads.end(); ++p)
+ {
+ (*p)->destroy();
+ }
+ }
#endif
- stop->waitZero();
+ stop->waitZero();
finish = Time::now();
- for(p = threads.begin(); p != threads.end(); ++p)
+ for(p = threads.begin(); p != threads.end(); ++p)
{
- (*p)->getThreadControl().join();
+ (*p)->getThreadControl().join();
}
tprintf("ok\n");
@@ -303,7 +303,7 @@ public:
#endif
{
tprintf("Each UUID took an average of %.04f ms to generate and insert into a set<string>.\n",
- ((double) ((finish - startTime).toMilliSeconds())) / howMany);
+ ((double) ((finish - startTime).toMilliSeconds())) / howMany);
}
return EXIT_SUCCESS;