summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-02-08 18:02:47 -0500
committerBernard Normier <bernard@zeroc.com>2017-02-08 18:02:47 -0500
commitcee5e5067eff15b5a22a247805edb6c8dda77074 (patch)
treee67d772a753e3ffa491571a101afb43a24824e5e /cpp/src
parentUpdate Debug settings for VS 2017 (VC141) (diff)
downloadice-cee5e5067eff15b5a22a247805edb6c8dda77074.tar.bz2
ice-cee5e5067eff15b5a22a247805edb6c8dda77074.tar.xz
ice-cee5e5067eff15b5a22a247805edb6c8dda77074.zip
Removed cpp:unscoped from all Ice enums
CompressBatch is now "scoped" in C++98 and ObjC
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Glacier2/RequestQueue.cpp2
-rw-r--r--cpp/src/Glacier2Lib/Application.cpp6
-rw-r--r--cpp/src/Glacier2Lib/SessionHelper.cpp2
-rw-r--r--cpp/src/Ice/ACM.cpp46
-rw-r--r--cpp/src/Ice/Application.cpp20
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp4
-rw-r--r--cpp/src/Ice/ConnectionI.cpp42
-rw-r--r--cpp/src/Ice/DefaultsAndOverrides.cpp7
-rw-r--r--cpp/src/Ice/IPEndpointI.cpp8
-rw-r--r--cpp/src/Ice/Incoming.cpp2
-rw-r--r--cpp/src/Ice/InputStream.cpp88
-rw-r--r--cpp/src/Ice/Instance.cpp14
-rw-r--r--cpp/src/Ice/InstrumentationI.cpp54
-rw-r--r--cpp/src/Ice/LocatorInfo.cpp2
-rwxr-xr-xcpp/src/Ice/Network.cpp6
-rw-r--r--cpp/src/Ice/NetworkProxy.cpp4
-rw-r--r--cpp/src/Ice/OpaqueEndpointI.cpp2
-rw-r--r--cpp/src/Ice/OutputStream.cpp16
-rw-r--r--cpp/src/Ice/Proxy.cpp10
-rw-r--r--cpp/src/Ice/Reference.cpp8
-rw-r--r--cpp/src/Ice/ReferenceFactory.cpp4
-rw-r--r--cpp/src/Ice/ThreadPool.cpp14
-rw-r--r--cpp/src/IceGrid/Client.cpp2
-rw-r--r--cpp/src/IceGrid/SessionManager.cpp2
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp18
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.h2
-rw-r--r--cpp/src/slice2cpp/Gen.cpp12
27 files changed, 200 insertions, 197 deletions
diff --git a/cpp/src/Glacier2/RequestQueue.cpp b/cpp/src/Glacier2/RequestQueue.cpp
index 423b52b4e87..8fa3644cd2d 100644
--- a/cpp/src/Glacier2/RequestQueue.cpp
+++ b/cpp/src/Glacier2/RequestQueue.cpp
@@ -374,7 +374,7 @@ Glacier2::RequestQueue::flush()
if(flushBatchRequests)
{
- Ice::AsyncResultPtr result = _connection->begin_flushBatchRequests(Ice::BasedOnProxy, _flushCallback);
+ Ice::AsyncResultPtr result = _connection->begin_flushBatchRequests(ICE_SCOPED_ENUM(CompressBatch, BasedOnProxy), _flushCallback);
if(!result->sentSynchronously() && !result->isCompleted())
{
_pendingSend = true;
diff --git a/cpp/src/Glacier2Lib/Application.cpp b/cpp/src/Glacier2Lib/Application.cpp
index 447ac923430..b318af47f92 100644
--- a/cpp/src/Glacier2Lib/Application.cpp
+++ b/cpp/src/Glacier2Lib/Application.cpp
@@ -158,7 +158,7 @@ Glacier2::Application::doMain(Ice::StringSeq& args, const Ice::InitializationDat
//
// The default is to destroy when a signal is received.
//
- if(_signalPolicy == Ice::HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
destroyOnInterrupt();
}
@@ -195,7 +195,7 @@ Glacier2::Application::doMain(Ice::StringSeq& args, const Ice::InitializationDat
{
Ice::ConnectionPtr connection = _router->ice_getCachedConnection();
assert(connection);
- connection->setACM(acmTimeout, IceUtil::None, Ice::HeartbeatAlways);
+ connection->setACM(acmTimeout, IceUtil::None, ICE_ENUM(ACMHeartbeat, HeartbeatAlways));
#ifdef ICE_CPP11_MAPPING
auto app = this;
connection->setCloseCallback(
@@ -288,7 +288,7 @@ Glacier2::Application::doMain(Ice::StringSeq& args, const Ice::InitializationDat
// it would not make sense to release a held signal to run
// shutdown or destroy.
//
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
ignoreInterrupt();
}
diff --git a/cpp/src/Glacier2Lib/SessionHelper.cpp b/cpp/src/Glacier2Lib/SessionHelper.cpp
index 9048320f801..e0062fe898b 100644
--- a/cpp/src/Glacier2Lib/SessionHelper.cpp
+++ b/cpp/src/Glacier2Lib/SessionHelper.cpp
@@ -788,7 +788,7 @@ SessionHelperI::connected(const Glacier2::RouterPrxPtr& router, const Glacier2::
{
Ice::ConnectionPtr connection = _router->ice_getCachedConnection();
assert(connection);
- connection->setACM(acmTimeout, IceUtil::None, Ice::HeartbeatAlways);
+ connection->setACM(acmTimeout, IceUtil::None, Ice::ICE_ENUM(ACMHeartbeat, HeartbeatAlways));
#ifdef ICE_CPP11_MAPPING
auto self = shared_from_this();
connection->setCloseCallback([self](Ice::ConnectionPtr)
diff --git a/cpp/src/Ice/ACM.cpp b/cpp/src/Ice/ACM.cpp
index 9990d76f995..8795874212a 100644
--- a/cpp/src/Ice/ACM.cpp
+++ b/cpp/src/Ice/ACM.cpp
@@ -24,14 +24,14 @@ IceUtil::Shared* IceInternal::upCast(FactoryACMMonitor* p) { return p; }
#endif
IceInternal::ACMConfig::ACMConfig(bool server) :
- timeout(IceUtil::Time::seconds(60)),
- heartbeat(Ice::HeartbeatOnInvocation),
- close(server ? Ice::CloseOnInvocation : Ice::CloseOnInvocationAndIdle)
+ timeout(IceUtil::Time::seconds(60)),
+ heartbeat(ICE_ENUM(ACMHeartbeat, HeartbeatOnInvocation)),
+ close(server ? ICE_ENUM(ACMClose, CloseOnInvocation) : ICE_ENUM(ACMClose, CloseOnInvocationAndIdle))
{
}
-IceInternal::ACMConfig::ACMConfig(const Ice::PropertiesPtr& p,
- const Ice::LoggerPtr& l,
+IceInternal::ACMConfig::ACMConfig(const Ice::PropertiesPtr& p,
+ const Ice::LoggerPtr& l,
const string& prefix,
const ACMConfig& dflt)
{
@@ -45,10 +45,10 @@ IceInternal::ACMConfig::ACMConfig(const Ice::PropertiesPtr& p,
timeoutProperty = prefix + ".Timeout";
};
- this->timeout = IceUtil::Time::seconds(p->getPropertyAsIntWithDefault(timeoutProperty,
+ this->timeout = IceUtil::Time::seconds(p->getPropertyAsIntWithDefault(timeoutProperty,
static_cast<int>(dflt.timeout.toSeconds())));
- int hb = p->getPropertyAsIntWithDefault(prefix + ".Heartbeat", dflt.heartbeat);
- if(hb >= Ice::HeartbeatOff && hb <= Ice::HeartbeatAlways)
+ int hb = p->getPropertyAsIntWithDefault(prefix + ".Heartbeat", static_cast<int>(dflt.heartbeat));
+ if(hb >= static_cast<int>(ICE_ENUM(ACMHeartbeat, HeartbeatOff)) && hb <= static_cast<int>(ICE_ENUM(ACMHeartbeat, HeartbeatAlways)))
{
this->heartbeat = static_cast<Ice::ACMHeartbeat>(hb);
}
@@ -58,8 +58,8 @@ IceInternal::ACMConfig::ACMConfig(const Ice::PropertiesPtr& p,
this->heartbeat = dflt.heartbeat;
}
- int cl = p->getPropertyAsIntWithDefault(prefix + ".Close", dflt.close);
- if(cl >= Ice::CloseOff && cl <= Ice::CloseOnIdleForceful)
+ int cl = p->getPropertyAsIntWithDefault(prefix + ".Close", static_cast<int>(dflt.close));
+ if(cl >= static_cast<int>(ICE_ENUM(ACMClose, CloseOff)) && cl <= static_cast<int>(ICE_ENUM(ACMClose, CloseOnIdleForceful)))
{
this->close = static_cast<Ice::ACMClose>(cl);
}
@@ -138,8 +138,8 @@ IceInternal::FactoryACMMonitor::reap(const ConnectionIPtr& connection)
}
ACMMonitorPtr
-IceInternal::FactoryACMMonitor::acm(const IceUtil::Optional<int>& timeout,
- const IceUtil::Optional<Ice::ACMClose>& close,
+IceInternal::FactoryACMMonitor::acm(const IceUtil::Optional<int>& timeout,
+ const IceUtil::Optional<Ice::ACMClose>& close,
const IceUtil::Optional<Ice::ACMHeartbeat>& heartbeat)
{
Lock sync(*this);
@@ -208,7 +208,7 @@ IceInternal::FactoryACMMonitor::runTimerTask()
}
}
-
+
//
// Monitor connections outside the thread synchronization, so
// that connections can be added or removed during monitoring.
@@ -217,11 +217,11 @@ IceInternal::FactoryACMMonitor::runTimerTask()
for(set<ConnectionIPtr>::const_iterator p = _connections.begin(); p != _connections.end(); ++p)
{
try
- {
+ {
(*p)->monitor(now, _config);
}
catch(const exception& ex)
- {
+ {
handleException(ex);
}
catch(...)
@@ -239,7 +239,7 @@ FactoryACMMonitor::handleException(const exception& ex)
{
return;
}
-
+
Error out(_instance->initializationData().logger);
out << "exception in connection monitor:\n" << ex.what();
}
@@ -252,12 +252,12 @@ FactoryACMMonitor::handleException()
{
return;
}
-
+
Error out(_instance->initializationData().logger);
out << "unknown exception in connection monitor";
}
-IceInternal::ConnectionACMMonitor::ConnectionACMMonitor(const FactoryACMMonitorPtr& parent,
+IceInternal::ConnectionACMMonitor::ConnectionACMMonitor(const FactoryACMMonitorPtr& parent,
const IceUtil::TimerPtr& timer,
const ACMConfig& config) :
_parent(parent), _timer(timer), _config(config)
@@ -300,8 +300,8 @@ IceInternal::ConnectionACMMonitor::reap(const ConnectionIPtr& connection)
}
ACMMonitorPtr
-IceInternal::ConnectionACMMonitor::acm(const IceUtil::Optional<int>& timeout,
- const IceUtil::Optional<Ice::ACMClose>& close,
+IceInternal::ConnectionACMMonitor::acm(const IceUtil::Optional<int>& timeout,
+ const IceUtil::Optional<Ice::ACMClose>& close,
const IceUtil::Optional<Ice::ACMHeartbeat>& heartbeat)
{
return _parent->acm(timeout, close, heartbeat);
@@ -329,13 +329,13 @@ IceInternal::ConnectionACMMonitor::runTimerTask()
}
connection = _connection;
}
-
+
try
- {
+ {
connection->monitor(IceUtil::Time::now(IceUtil::Time::Monotonic), _config);
}
catch(const exception& ex)
- {
+ {
_parent->handleException(ex);
}
catch(...)
diff --git a/cpp/src/Ice/Application.cpp b/cpp/src/Ice/Application.cpp
index 35adba8549c..279e30d9b82 100644
--- a/cpp/src/Ice/Application.cpp
+++ b/cpp/src/Ice/Application.cpp
@@ -36,7 +36,7 @@ bool Ice::Application::_interrupted = false;
string Ice::Application::_appName;
Ice::CommunicatorPtr Ice::Application::_communicator;
-Ice::SignalPolicy Ice::Application::_signalPolicy = Ice::HandleSignals;
+Ice::SignalPolicy Ice::Application::_signalPolicy = ICE_ENUM(SignalPolicy, HandleSignals);
Ice::Application* Ice::Application::_application = 0;
namespace
@@ -177,7 +177,7 @@ Ice::Application::main(int argc, char* argv[], const InitializationData& initial
_application = this;
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
try
{
@@ -258,7 +258,7 @@ Ice::Application::communicator()
void
Ice::Application::destroyOnInterrupt()
{
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
if(_ctrlCHandler != 0)
{
@@ -281,7 +281,7 @@ Ice::Application::destroyOnInterrupt()
void
Ice::Application::shutdownOnInterrupt()
{
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
if(_ctrlCHandler != 0)
{
@@ -304,7 +304,7 @@ Ice::Application::shutdownOnInterrupt()
void
Ice::Application::ignoreInterrupt()
{
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
if(_ctrlCHandler != 0)
{
@@ -327,7 +327,7 @@ Ice::Application::ignoreInterrupt()
void
Ice::Application::callbackOnInterrupt()
{
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
if(_ctrlCHandler != 0)
{
@@ -350,7 +350,7 @@ Ice::Application::callbackOnInterrupt()
void
Ice::Application::holdInterrupt()
{
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
if(_ctrlCHandler != 0)
{
@@ -374,7 +374,7 @@ Ice::Application::holdInterrupt()
void
Ice::Application::releaseInterrupt()
{
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
if(_ctrlCHandler != 0)
{
@@ -437,7 +437,7 @@ Ice::Application::doMain(int argc, char* argv[], const InitializationData& initD
//
// The default is to destroy when a signal is received.
//
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
destroyOnInterrupt();
}
@@ -474,7 +474,7 @@ Ice::Application::doMain(int argc, char* argv[], const InitializationData& initD
// it would not make sense to release a held signal to run
// shutdown or destroy.
//
- if(_signalPolicy == HandleSignals)
+ if(_signalPolicy == ICE_ENUM(SignalPolicy, HandleSignals))
{
ignoreInterrupt();
}
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index 9b9e00ce239..3e31b9c7c71 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -138,11 +138,11 @@ CommunicatorFlushBatchAsync::flushConnection(const ConnectionIPtr& con, Ice::Com
}
else
{
- if(compressBatch == Ice::Yes)
+ if(compressBatch == ICE_SCOPED_ENUM(CompressBatch, Yes))
{
compress = true;
}
- else if(compressBatch == Ice::No)
+ else if(compressBatch == ICE_SCOPED_ENUM(CompressBatch, No))
{
compress = false;
}
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
index 598f4c983d3..223326203d1 100644
--- a/cpp/src/Ice/ConnectionI.cpp
+++ b/cpp/src/Ice/ConnectionI.cpp
@@ -153,14 +153,14 @@ private:
typedef IceUtil::Handle<ConnectionFlushBatchAsync> ConnectionFlushBatchAsyncPtr;
ConnectionState connectionStateMap[] = {
- ConnectionStateValidating, // StateNotInitialized
- ConnectionStateValidating, // StateNotValidated
- ConnectionStateActive, // StateActive
- ConnectionStateHolding, // StateHolding
- ConnectionStateClosing, // StateClosing
- ConnectionStateClosing, // StateClosingPending
- ConnectionStateClosed, // StateClosed
- ConnectionStateClosed, // StateFinished
+ ICE_ENUM(ConnectionState, ConnectionStateValidating), // StateNotInitialized
+ ICE_ENUM(ConnectionState, ConnectionStateValidating), // StateNotValidated
+ ICE_ENUM(ConnectionState, ConnectionStateActive), // StateActive
+ ICE_ENUM(ConnectionState, ConnectionStateHolding), // StateHolding
+ ICE_ENUM(ConnectionState, ConnectionStateClosing), // StateClosing
+ ICE_ENUM(ConnectionState, ConnectionStateClosing), // StateClosingPending
+ ICE_ENUM(ConnectionState, ConnectionStateClosed), // StateClosed
+ ICE_ENUM(ConnectionState, ConnectionStateClosed), // StateFinished
};
}
@@ -195,11 +195,11 @@ ConnectionFlushBatchAsync::invoke(const string& operation, Ice::CompressBatch co
}
else
{
- if(compressBatch == Ice::Yes)
+ if(compressBatch == ICE_SCOPED_ENUM(CompressBatch, Yes))
{
compress = true;
}
- else if(compressBatch == Ice::No)
+ else if(compressBatch == ICE_SCOPED_ENUM(CompressBatch, No))
{
compress = false;
}
@@ -498,17 +498,17 @@ Ice::ConnectionI::close(ConnectionClose mode)
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- if(mode == CloseForcefully)
+ if(mode == ICE_ENUM(ConnectionClose, CloseForcefully))
{
setState(StateClosed, ConnectionManuallyClosedException(__FILE__, __LINE__, false));
}
- else if(mode == CloseGracefully)
+ else if(mode == ICE_ENUM(ConnectionClose, CloseGracefully))
{
setState(StateClosing, ConnectionManuallyClosedException(__FILE__, __LINE__, true));
}
else
{
- assert(mode == CloseGracefullyAndWait);
+ assert(mode == ICE_ENUM(ConnectionClose, CloseGracefullyAndWait));
//
// Wait until all outstanding requests have been completed.
@@ -646,10 +646,10 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm)
// per timeout period because the monitor() method is still only
// called every (timeout / 2) period.
//
- if(acm.heartbeat == HeartbeatAlways ||
- (acm.heartbeat != HeartbeatOff && _writeStream.b.empty() && now >= (_acmLastActivity + acm.timeout / 4)))
+ if(acm.heartbeat == ICE_ENUM(ACMHeartbeat, HeartbeatAlways) ||
+ (acm.heartbeat != ICE_ENUM(ACMHeartbeat, HeartbeatOff) && _writeStream.b.empty() && now >= (_acmLastActivity + acm.timeout / 4)))
{
- if(acm.heartbeat != HeartbeatOnInvocation || _dispatchCount > 0)
+ if(acm.heartbeat != ICE_ENUM(ACMHeartbeat, HeartbeatOnInvocation) || _dispatchCount > 0)
{
sendHeartbeatNow();
}
@@ -666,9 +666,9 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm)
return;
}
- if(acm.close != CloseOff && now >= (_acmLastActivity + acm.timeout))
+ if(acm.close != ICE_ENUM(ACMClose, CloseOff) && now >= (_acmLastActivity + acm.timeout))
{
- if(acm.close == CloseOnIdleForceful || (acm.close != CloseOnIdle && !_asyncRequests.empty()))
+ if(acm.close == ICE_ENUM(ACMClose, CloseOnIdleForceful) || (acm.close != ICE_ENUM(ACMClose, CloseOnIdle) && !_asyncRequests.empty()))
{
//
// Close the connection if we didn't receive a heartbeat in
@@ -676,7 +676,7 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm)
//
setState(StateClosed, ConnectionTimeoutException(__FILE__, __LINE__));
}
- else if(acm.close != CloseOnInvocation && _dispatchCount == 0 && _batchRequestQueue->isEmpty() &&
+ else if(acm.close != ICE_ENUM(ACMClose, CloseOnInvocation) && _dispatchCount == 0 && _batchRequestQueue->isEmpty() &&
_asyncRequests.empty())
{
//
@@ -1180,8 +1180,8 @@ Ice::ConnectionI::getACM()
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
ACM acm;
acm.timeout = 0;
- acm.close = CloseOff;
- acm.heartbeat = HeartbeatOff;
+ acm.close = ICE_ENUM(ACMClose, CloseOff);
+ acm.heartbeat = ICE_ENUM(ACMHeartbeat, HeartbeatOff);
return _monitor ? _monitor->getACM() : acm;
}
diff --git a/cpp/src/Ice/DefaultsAndOverrides.cpp b/cpp/src/Ice/DefaultsAndOverrides.cpp
index 4c83a32799e..823cd1ebca3 100644
--- a/cpp/src/Ice/DefaultsAndOverrides.cpp
+++ b/cpp/src/Ice/DefaultsAndOverrides.cpp
@@ -112,11 +112,11 @@ IceInternal::DefaultsAndOverrides::DefaultsAndOverrides(const PropertiesPtr& pro
value = properties->getPropertyWithDefault("Ice.Default.EndpointSelection", "Random");
if(value == "Random")
{
- defaultEndpointSelection = Random;
+ defaultEndpointSelection = ICE_ENUM(EndpointSelectionType, Random);
}
else if(value == "Ordered")
{
- defaultEndpointSelection = Ordered;
+ defaultEndpointSelection = ICE_ENUM(EndpointSelectionType, Ordered);
}
else
{
@@ -163,5 +163,6 @@ IceInternal::DefaultsAndOverrides::DefaultsAndOverrides(const PropertiesPtr& pro
checkSupportedEncoding(defaultEncoding);
bool slicedFormat = properties->getPropertyAsIntWithDefault("Ice.Default.SlicedFormat", 0) > 0;
- const_cast<FormatType&>(defaultFormat) = slicedFormat ? SlicedFormat : CompactFormat;
+ const_cast<FormatType&>(defaultFormat) = slicedFormat ?
+ ICE_ENUM(FormatType, SlicedFormat) : ICE_ENUM(FormatType, CompactFormat);
}
diff --git a/cpp/src/Ice/IPEndpointI.cpp b/cpp/src/Ice/IPEndpointI.cpp
index aca36399b13..846e5151f49 100644
--- a/cpp/src/Ice/IPEndpointI.cpp
+++ b/cpp/src/Ice/IPEndpointI.cpp
@@ -607,7 +607,7 @@ IceInternal::EndpointHostResolver::run()
if(threadObserver)
{
- threadObserver->stateChanged(ThreadStateIdle, ThreadStateInUseForOther);
+ threadObserver->stateChanged(ICE_ENUM(ThreadState, ThreadStateIdle), ICE_ENUM(ThreadState, ThreadStateInUseForOther));
}
try
@@ -634,7 +634,7 @@ IceInternal::EndpointHostResolver::run()
if(threadObserver)
{
- threadObserver->stateChanged(ThreadStateInUseForOther, ThreadStateIdle);
+ threadObserver->stateChanged(ICE_ENUM(ThreadState, ThreadStateInUseForOther), ICE_ENUM(ThreadState, ThreadStateIdle));
}
}
@@ -642,7 +642,7 @@ IceInternal::EndpointHostResolver::run()
{
if(threadObserver)
{
- threadObserver->stateChanged(ThreadStateInUseForOther, ThreadStateIdle);
+ threadObserver->stateChanged(ICE_ENUM(ThreadState, ThreadStateInUseForOther), ICE_ENUM(ThreadState, ThreadStateIdle));
}
if(r.observer)
{
@@ -678,7 +678,7 @@ IceInternal::EndpointHostResolver::updateObserver()
const CommunicatorObserverPtr& obsv = _instance->initializationData().observer;
if(obsv)
{
- _observer.attach(obsv->getThreadObserver("Communicator", name(), ThreadStateIdle, _observer.get()));
+ _observer.attach(obsv->getThreadObserver("Communicator", name(), ICE_ENUM(ThreadState, ThreadStateIdle), _observer.get()));
}
}
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp
index 3db0c3ae2a1..b60e9135ce0 100644
--- a/cpp/src/Ice/Incoming.cpp
+++ b/cpp/src/Ice/Incoming.cpp
@@ -52,7 +52,7 @@ IceInternal::IncomingBase::IncomingBase(Instance* instance, ResponseHandler* res
bool response, Byte compress, Int requestId) :
_response(response),
_compress(compress),
- _format(Ice::DefaultFormat),
+ _format(Ice::ICE_ENUM(FormatType, DefaultFormat)),
_os(instance, Ice::currentProtocolEncoding),
_responseHandler(responseHandler)
{
diff --git a/cpp/src/Ice/InputStream.cpp b/cpp/src/Ice/InputStream.cpp
index 9389fb247b5..8d885109612 100644
--- a/cpp/src/Ice/InputStream.cpp
+++ b/cpp/src/Ice/InputStream.cpp
@@ -1485,52 +1485,52 @@ Ice::InputStream::skipOptional(OptionalFormat type)
{
switch(type)
{
- case Ice::OptionalFormatF1:
- {
- skip(1);
- break;
- }
- case Ice::OptionalFormatF2:
- {
- skip(2);
- break;
- }
- case Ice::OptionalFormatF4:
- {
- skip(4);
- break;
- }
- case Ice::OptionalFormatF8:
- {
- skip(8);
- break;
- }
- case Ice::OptionalFormatSize:
- {
- skipSize();
- break;
- }
- case Ice::OptionalFormatVSize:
- {
- skip(readSize());
- break;
- }
- case Ice::OptionalFormatFSize:
- {
- Int sz;
- read(sz);
- if(sz < 0)
+ case ICE_SCOPED_ENUM(OptionalFormat, F1):
{
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ skip(1);
+ break;
+ }
+ case ICE_SCOPED_ENUM(OptionalFormat, F2):
+ {
+ skip(2);
+ break;
+ }
+ case ICE_SCOPED_ENUM(OptionalFormat, F4):
+ {
+ skip(4);
+ break;
+ }
+ case ICE_SCOPED_ENUM(OptionalFormat, F8):
+ {
+ skip(8);
+ break;
+ }
+ case ICE_SCOPED_ENUM(OptionalFormat, Size):
+ {
+ skipSize();
+ break;
+ }
+ case ICE_SCOPED_ENUM(OptionalFormat, VSize):
+ {
+ skip(readSize());
+ break;
+ }
+ case ICE_SCOPED_ENUM(OptionalFormat, FSize):
+ {
+ Int sz;
+ read(sz);
+ if(sz < 0)
+ {
+ throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+ skip(sz);
+ break;
+ }
+ case ICE_SCOPED_ENUM(OptionalFormat, Class):
+ {
+ read(0, 0);
+ break;
}
- skip(sz);
- break;
- }
- case Ice::OptionalFormatClass:
- {
- read(0, 0);
- break;
- }
}
}
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 105f6b0bd39..af602c387e2 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -231,7 +231,7 @@ Timer::updateObserver(const Ice::Instrumentation::CommunicatorObserverPtr& obsv)
assert(obsv);
_observer.attach(obsv->getThreadObserver("Communicator",
"Ice.Timer",
- Ice::Instrumentation::ThreadStateIdle,
+ Instrumentation::ICE_ENUM(ThreadState, ThreadStateIdle),
_observer.get()));
_hasObserver.exchange(_observer.get() ? 1 : 0);
}
@@ -248,8 +248,8 @@ Timer::runTimerTask(const IceUtil::TimerTaskPtr& task)
}
if(threadObserver)
{
- threadObserver->stateChanged(Ice::Instrumentation::ThreadStateIdle,
- Ice::Instrumentation::ThreadStateInUseForOther);
+ threadObserver->stateChanged(Instrumentation::ICE_ENUM(ThreadState, ThreadStateIdle),
+ Instrumentation::ICE_ENUM(ThreadState, ThreadStateInUseForOther));
}
try
{
@@ -259,14 +259,14 @@ Timer::runTimerTask(const IceUtil::TimerTaskPtr& task)
{
if(threadObserver)
{
- threadObserver->stateChanged(Ice::Instrumentation::ThreadStateInUseForOther,
- Ice::Instrumentation::ThreadStateIdle);
+ threadObserver->stateChanged(Instrumentation::ICE_ENUM(ThreadState, ThreadStateInUseForOther),
+ Instrumentation::ICE_ENUM(ThreadState, ThreadStateIdle));
}
}
if(threadObserver)
{
- threadObserver->stateChanged(Ice::Instrumentation::ThreadStateInUseForOther,
- Ice::Instrumentation::ThreadStateIdle);
+ threadObserver->stateChanged(Instrumentation::ICE_ENUM(ThreadState, ThreadStateInUseForOther),
+ Instrumentation::ICE_ENUM(ThreadState, ThreadStateIdle));
}
}
else
diff --git a/cpp/src/Ice/InstrumentationI.cpp b/cpp/src/Ice/InstrumentationI.cpp
index 0f816647a11..4ee747d1296 100644
--- a/cpp/src/Ice/InstrumentationI.cpp
+++ b/cpp/src/Ice/InstrumentationI.cpp
@@ -36,17 +36,17 @@ getThreadStateMetric(ThreadState s)
{
switch(s)
{
- case ThreadStateIdle:
- return 0;
- case ThreadStateInUseForIO:
- return &ThreadMetrics::inUseForIO;
- case ThreadStateInUseForUser:
- return &ThreadMetrics::inUseForUser;
- case ThreadStateInUseForOther:
- return &ThreadMetrics::inUseForOther;
- default:
- assert(false);
- return 0;
+ case ICE_ENUM(ThreadState, ThreadStateIdle):
+ return 0;
+ case ICE_ENUM(ThreadState, ThreadStateInUseForIO):
+ return &ThreadMetrics::inUseForIO;
+ case ICE_ENUM(ThreadState, ThreadStateInUseForUser):
+ return &ThreadMetrics::inUseForUser;
+ case ICE_ENUM(ThreadState, ThreadStateInUseForOther):
+ return &ThreadMetrics::inUseForOther;
+ default:
+ assert(false);
+ return 0;
}
}
@@ -58,11 +58,11 @@ struct ThreadStateChanged
void operator()(const ThreadMetricsPtr& v)
{
- if(oldState != ThreadStateIdle)
+ if(oldState != ICE_ENUM(ThreadState, ThreadStateIdle))
{
--(v.get()->*getThreadStateMetric(oldState));
}
- if(newState != ThreadStateIdle)
+ if(newState != ICE_ENUM(ThreadState, ThreadStateIdle))
{
++(v.get()->*getThreadStateMetric(newState));
}
@@ -145,19 +145,19 @@ public:
{
switch(_state)
{
- case ConnectionStateValidating:
- return "validating";
- case ConnectionStateHolding:
- return "holding";
- case ConnectionStateActive:
- return "active";
- case ConnectionStateClosing:
- return "closing";
- case ConnectionStateClosed:
- return "closed";
- default:
- assert(false);
- return "";
+ case ICE_ENUM(ConnectionState, ConnectionStateValidating):
+ return "validating";
+ case ICE_ENUM(ConnectionState, ConnectionStateHolding):
+ return "holding";
+ case ICE_ENUM(ConnectionState, ConnectionStateActive):
+ return "active";
+ case ICE_ENUM(ConnectionState, ConnectionStateClosing):
+ return "closing";
+ case ICE_ENUM(ConnectionState, ConnectionStateClosed):
+ return "closed";
+ default:
+ assert(false);
+ return "";
}
}
@@ -686,7 +686,7 @@ public:
virtual void initMetrics(const ThreadMetricsPtr& v) const
{
- if(_state != ThreadStateIdle)
+ if(_state != ICE_ENUM(ThreadState, ThreadStateIdle))
{
++(v.get()->*getThreadStateMetric(_state));
}
diff --git a/cpp/src/Ice/LocatorInfo.cpp b/cpp/src/Ice/LocatorInfo.cpp
index 0871c59377e..d6b9e2c29c7 100644
--- a/cpp/src/Ice/LocatorInfo.cpp
+++ b/cpp/src/Ice/LocatorInfo.cpp
@@ -541,7 +541,7 @@ IceInternal::LocatorInfo::getLocatorRegistry()
// endpoint selection in case the locator returned a proxy
// with some endpoints which are prefered to be tried first.
//
- _locatorRegistry = locatorRegistry->ice_locator(0)->ice_endpointSelection(Ice::Ordered);
+ _locatorRegistry = locatorRegistry->ice_locator(0)->ice_endpointSelection(Ice::ICE_ENUM(EndpointSelectionType, Ordered));
return _locatorRegistry;
}
}
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 3f75d0f9270..f00d2e48f1e 100755
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -128,7 +128,7 @@ struct RandomNumberGenerator : public std::unary_function<ptrdiff_t, ptrdiff_t>
void
sortAddresses(vector<Address>& addrs, ProtocolSupport protocol, Ice::EndpointSelectionType selType, bool preferIPv6)
{
- if(selType == Ice::Random)
+ if(selType == Ice::ICE_ENUM(EndpointSelectionType, Random))
{
RandomNumberGenerator rng;
random_shuffle(addrs.begin(), addrs.end(), rng);
@@ -1216,7 +1216,7 @@ IceInternal::getAddressForServer(const string& host, int port, ProtocolSupport p
#endif
return addr;
}
- vector<Address> addrs = getAddresses(host, port, protocol, Ice::Ordered, preferIPv6, canBlock);
+ vector<Address> addrs = getAddresses(host, port, protocol, Ice::ICE_ENUM(EndpointSelectionType, Ordered), preferIPv6, canBlock);
return addrs.empty() ? Address() : addrs[0];
}
@@ -2366,7 +2366,7 @@ IceInternal::doBind(SOCKET fd, const Address& addr, const string&)
Address
IceInternal::getNumericAddress(const std::string& address)
{
- vector<Address> addrs = getAddresses(address, 0, EnableBoth, Ice::Ordered, false, false);
+ vector<Address> addrs = getAddresses(address, 0, EnableBoth, Ice::ICE_ENUM(EndpointSelectionType, Ordered), false, false);
if(addrs.empty())
{
return Address();
diff --git a/cpp/src/Ice/NetworkProxy.cpp b/cpp/src/Ice/NetworkProxy.cpp
index b4055bad7b9..6e70012e15f 100644
--- a/cpp/src/Ice/NetworkProxy.cpp
+++ b/cpp/src/Ice/NetworkProxy.cpp
@@ -168,7 +168,7 @@ NetworkProxyPtr
SOCKSNetworkProxy::resolveHost(ProtocolSupport protocol) const
{
assert(!_host.empty());
- return new SOCKSNetworkProxy(getAddresses(_host, _port, protocol, Ice::Random, false, true)[0]);
+ return new SOCKSNetworkProxy(getAddresses(_host, _port, protocol, Ice::ICE_ENUM(EndpointSelectionType, Random), false, true)[0]);
}
Address
@@ -272,7 +272,7 @@ NetworkProxyPtr
HTTPNetworkProxy::resolveHost(ProtocolSupport protocol) const
{
assert(!_host.empty());
- return new HTTPNetworkProxy(getAddresses(_host, _port, protocol, Ice::Random, false, true)[0], protocol);
+ return new HTTPNetworkProxy(getAddresses(_host, _port, protocol, Ice::ICE_ENUM(EndpointSelectionType, Random), false, true)[0], protocol);
}
Address
diff --git a/cpp/src/Ice/OpaqueEndpointI.cpp b/cpp/src/Ice/OpaqueEndpointI.cpp
index 2be3b400dcb..54aca2386f7 100644
--- a/cpp/src/Ice/OpaqueEndpointI.cpp
+++ b/cpp/src/Ice/OpaqueEndpointI.cpp
@@ -100,7 +100,7 @@ OpaqueEndpointInfoI::OpaqueEndpointInfoI(Ice::Short type, const Ice::EncodingVer
void
IceInternal::OpaqueEndpointI::streamWrite(OutputStream* s) const
{
- s->startEncapsulation(_rawEncoding, DefaultFormat);
+ s->startEncapsulation(_rawEncoding, ICE_ENUM(FormatType, DefaultFormat));
s->writeBlob(_rawBytes);
s->endEncapsulation();
}
diff --git a/cpp/src/Ice/OutputStream.cpp b/cpp/src/Ice/OutputStream.cpp
index 4c80fe57604..fe931ecebc3 100644
--- a/cpp/src/Ice/OutputStream.cpp
+++ b/cpp/src/Ice/OutputStream.cpp
@@ -76,7 +76,7 @@ Ice::OutputStream::OutputStream() :
_instance(0),
_closure(0),
_encoding(currentEncoding),
- _format(CompactFormat),
+ _format(ICE_ENUM(FormatType, CompactFormat)),
_currentEncaps(0)
{
}
@@ -216,7 +216,7 @@ Ice::OutputStream::startEncapsulation()
}
else
{
- startEncapsulation(_encoding, Ice::DefaultFormat);
+ startEncapsulation(_encoding, Ice::ICE_ENUM(FormatType, DefaultFormat));
}
}
@@ -898,7 +898,7 @@ Ice::OutputStream::initEncaps()
_currentEncaps->encoding = _encoding;
}
- if(_currentEncaps->format == Ice::DefaultFormat)
+ if(_currentEncaps->format == Ice::ICE_ENUM(FormatType, DefaultFormat))
{
_currentEncaps->format = _format;
}
@@ -1120,7 +1120,7 @@ Ice::OutputStream::EncapsEncoder11::write(const ValuePtr& v)
{
_stream->writeSize(0); // Nil reference.
}
- else if(_current && _encaps->format == SlicedFormat)
+ else if(_current && _encaps->format == ICE_ENUM(FormatType, SlicedFormat))
{
//
// If writing an instance within a slice and using the sliced
@@ -1188,7 +1188,7 @@ Ice::OutputStream::EncapsEncoder11::startSlice(const string& typeId, int compact
_current->sliceFlagsPos = _stream->b.size();
_current->sliceFlags = 0;
- if(_encaps->format == SlicedFormat)
+ if(_encaps->format == ICE_ENUM(FormatType, SlicedFormat))
{
_current->sliceFlags |= FLAG_HAS_SLICE_SIZE; // Encode the slice size if using the sliced format.
}
@@ -1210,7 +1210,7 @@ Ice::OutputStream::EncapsEncoder11::startSlice(const string& typeId, int compact
// Encode the type ID (only in the first slice for the compact
// encoding).
//
- if(_encaps->format == SlicedFormat || _current->firstSlice)
+ if(_encaps->format == ICE_ENUM(FormatType, SlicedFormat) || _current->firstSlice)
{
if(compactId >= 0)
{
@@ -1275,7 +1275,7 @@ Ice::OutputStream::EncapsEncoder11::endSlice()
//
if(!_current->indirectionTable.empty())
{
- assert(_encaps->format == SlicedFormat);
+ assert(_encaps->format == ICE_ENUM(FormatType, SlicedFormat));
_current->sliceFlags |= FLAG_HAS_INDIRECTION_TABLE;
//
@@ -1330,7 +1330,7 @@ Ice::OutputStream::EncapsEncoder11::writeSlicedData(const SlicedDataPtr& slicedD
// essentially "slices" the instance into the most-derived type
// known by the sender.
//
- if(_encaps->format != SlicedFormat)
+ if(_encaps->format != ICE_ENUM(FormatType, SlicedFormat))
{
return;
}
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp
index 2535c05c1e4..ab75dced077 100644
--- a/cpp/src/Ice/Proxy.cpp
+++ b/cpp/src/Ice/Proxy.cpp
@@ -161,7 +161,7 @@ Ice::ObjectPrx::_iceI_isA(const shared_ptr<IceInternal::OutgoingAsyncT<bool>>& o
const Context& ctx)
{
_checkTwowayOnly(ice_isA_name);
- outAsync->invoke(ice_isA_name, OperationMode::Nonmutating, DefaultFormat, ctx,
+ outAsync->invoke(ice_isA_name, OperationMode::Nonmutating, ICE_ENUM(FormatType, DefaultFormat), ctx,
[&](Ice::OutputStream* os)
{
os->write(typeId, false);
@@ -172,14 +172,14 @@ Ice::ObjectPrx::_iceI_isA(const shared_ptr<IceInternal::OutgoingAsyncT<bool>>& o
void
Ice::ObjectPrx::_iceI_ping(const shared_ptr<IceInternal::OutgoingAsyncT<void>>& outAsync, const Context& ctx)
{
- outAsync->invoke(ice_ping_name, OperationMode::Nonmutating, DefaultFormat, ctx, nullptr, nullptr);
+ outAsync->invoke(ice_ping_name, OperationMode::Nonmutating, ICE_ENUM(FormatType, DefaultFormat), ctx, nullptr, nullptr);
}
void
Ice::ObjectPrx::_iceI_ids(const shared_ptr<IceInternal::OutgoingAsyncT<vector<string>>>& outAsync, const Context& ctx)
{
_checkTwowayOnly(ice_ids_name);
- outAsync->invoke(ice_ids_name, OperationMode::Nonmutating, DefaultFormat, ctx, nullptr, nullptr,
+ outAsync->invoke(ice_ids_name, OperationMode::Nonmutating, ICE_ENUM(FormatType, DefaultFormat), ctx, nullptr, nullptr,
[](Ice::InputStream* stream)
{
vector<string> v;
@@ -192,7 +192,7 @@ void
Ice::ObjectPrx::_iceI_id(const shared_ptr<IceInternal::OutgoingAsyncT<string>>& outAsync, const Context& ctx)
{
_checkTwowayOnly(ice_id_name);
- outAsync->invoke(ice_id_name, OperationMode::Nonmutating, DefaultFormat, ctx, nullptr, nullptr,
+ outAsync->invoke(ice_id_name, OperationMode::Nonmutating, ICE_ENUM(FormatType, DefaultFormat), ctx, nullptr, nullptr,
[](Ice::InputStream* stream)
{
string v;
@@ -292,7 +292,7 @@ IceProxy::Ice::Object::_iceI_begin_ice_isA(const string& typeId,
try
{
result->prepare(ice_isA_name, Nonmutating, ctx);
- ::Ice::OutputStream* ostr = result->startWriteParams(DefaultFormat);
+ ::Ice::OutputStream* ostr = result->startWriteParams(ICE_ENUM(FormatType, DefaultFormat));
ostr->write(typeId, false);
result->endWriteParams();
result->invoke(ice_isA_name);
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index b222b506352..99bcdcdf030 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -643,7 +643,7 @@ IceInternal::FixedReference::getPreferSecure() const
Ice::EndpointSelectionType
IceInternal::FixedReference::getEndpointSelection() const
{
- return Random;
+ return ICE_ENUM(EndpointSelectionType, Random);
}
int
@@ -1262,7 +1262,7 @@ IceInternal::RoutableReference::toProperty(const string& prefix) const
properties[prefix + ".CollocationOptimized"] = _collocationOptimized ? "1" : "0";
properties[prefix + ".ConnectionCached"] = _cacheConnection ? "1" : "0";
properties[prefix + ".PreferSecure"] = _preferSecure ? "1" : "0";
- properties[prefix + ".EndpointSelection"] = _endpointSelection == Random ? "Random" : "Ordered";
+ properties[prefix + ".EndpointSelection"] = _endpointSelection == ICE_ENUM(EndpointSelectionType, Random) ? "Random" : "Ordered";
{
ostringstream s;
s << _locatorCacheTimeout;
@@ -1916,13 +1916,13 @@ IceInternal::RoutableReference::filterEndpoints(const vector<EndpointIPtr>& allE
//
switch(getEndpointSelection())
{
- case Random:
+ case ICE_ENUM(EndpointSelectionType, Random):
{
RandomNumberGenerator rng;
random_shuffle(endpoints.begin(), endpoints.end(), rng);
break;
}
- case Ordered:
+ case ICE_ENUM(EndpointSelectionType, Ordered):
{
// Nothing to do.
break;
diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp
index d4198699609..a73f3e52b33 100644
--- a/cpp/src/Ice/ReferenceFactory.cpp
+++ b/cpp/src/Ice/ReferenceFactory.cpp
@@ -857,11 +857,11 @@ IceInternal::ReferenceFactory::create(const Identity& ident,
string type = properties->getProperty(property);
if(type == "Random")
{
- endpointSelection = Random;
+ endpointSelection = ICE_ENUM(EndpointSelectionType, Random);
}
else if(type == "Ordered")
{
- endpointSelection = Ordered;
+ endpointSelection = ICE_ENUM(EndpointSelectionType, Ordered);
}
else
{
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index 8294b7c272a..d79a0900293 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -703,7 +703,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
current._handler = ICE_GET_SHARED_FROM_THIS(_nextHandler->first);
current.operation = _nextHandler->second;
++_nextHandler;
- thread->setState(ThreadStateInUseForIO);
+ thread->setState(ICE_ENUM(ThreadState, ThreadStateInUseForIO));
}
else
{
@@ -727,7 +727,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
_handlers.clear();
_selector.startSelect();
select = true;
- thread->setState(ThreadStateIdle);
+ thread->setState(ICE_ENUM(ThreadState, ThreadStateIdle));
}
}
else if(_sizeMax > 1)
@@ -822,7 +822,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- thread->setState(ThreadStateInUseForIO);
+ thread->setState(ICE_ENUM(ThreadState, ThreadStateInUseForIO));
}
try
@@ -865,7 +865,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
assert(_inUse > 0);
--_inUse;
}
- thread->setState(ThreadStateIdle);
+ thread->setState(ICE_ENUM(ThreadState, ThreadStateIdle));
}
}
#endif
@@ -878,7 +878,7 @@ IceInternal::ThreadPool::ioCompleted(ThreadPoolCurrent& current)
current._ioCompleted = true; // Set the IO completed flag to specifiy that ioCompleted() has been called.
- current._thread->setState(ThreadStateInUseForUser);
+ current._thread->setState(ICE_ENUM(ThreadState, ThreadStateInUseForUser));
if(_sizeMax > 1)
{
@@ -1078,7 +1078,7 @@ IceInternal::ThreadPool::followerWait(ThreadPoolCurrent& current)
{
assert(!current._leader);
- current._thread->setState(ThreadStateIdle);
+ current._thread->setState(ICE_ENUM(ThreadState, ThreadStateIdle));
//
// It's important to clear the handler before waiting to make sure that
@@ -1135,7 +1135,7 @@ IceInternal::ThreadPool::nextThreadId()
IceInternal::ThreadPool::EventHandlerThread::EventHandlerThread(const ThreadPoolPtr& pool, const string& name) :
IceUtil::Thread(name),
_pool(pool),
- _state(Ice::Instrumentation::ThreadStateIdle)
+ _state(ICE_ENUM(ThreadState, ThreadStateIdle))
{
updateObserver();
}
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp
index 6d042c73f45..f37bbf30ce5 100644
--- a/cpp/src/IceGrid/Client.cpp
+++ b/cpp/src/IceGrid/Client.cpp
@@ -872,7 +872,7 @@ Client::run(StringSeq& originalArgs)
if(acmTimeout > 0)
{
- session->ice_getConnection()->setACM(acmTimeout, IceUtil::None, Ice::HeartbeatAlways);
+ session->ice_getConnection()->setACM(acmTimeout, IceUtil::None, ICE_ENUM(ACMHeartbeat, HeartbeatAlways));
}
else if(sessionTimeout > 0)
{
diff --git a/cpp/src/IceGrid/SessionManager.cpp b/cpp/src/IceGrid/SessionManager.cpp
index 57ded43015f..c9b371000ff 100644
--- a/cpp/src/IceGrid/SessionManager.cpp
+++ b/cpp/src/IceGrid/SessionManager.cpp
@@ -58,7 +58,7 @@ SessionManager::findAllQueryObjects(bool cached)
{
try
{
- connection->close(Ice::CloseGracefullyAndWait);
+ connection->close(Ice::ICE_ENUM(ConnectionClose, CloseGracefullyAndWait));
}
catch(const Ice::LocalException&)
{
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 8b3219bf0fd..fd61a1272b7 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -1112,23 +1112,23 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList&
string
Slice::operationModeToString(Operation::Mode mode, bool cpp11)
{
+ string prefix = cpp11 ? "::Ice::OperationMode::" : "::Ice::";
switch(mode)
{
case Operation::Normal:
{
- return cpp11 ? "::Ice::OperationMode::Normal" : "::Ice::Normal";
+ return prefix + "Normal";
}
case Operation::Nonmutating:
{
- return cpp11 ? "::Ice::OperationMode::Nonmutating" : "::Ice::Nonmutating";
+ return prefix + "Nonmutating";
}
case Operation::Idempotent:
{
- return cpp11 ? "::Ice::OperationMode::Idempotent" : "::Ice::Idempotent";
+ return prefix + "Idempotent";
}
-
default:
{
assert(false);
@@ -1139,16 +1139,18 @@ Slice::operationModeToString(Operation::Mode mode, bool cpp11)
}
string
-Slice::opFormatTypeToString(const OperationPtr& op)
+Slice::opFormatTypeToString(const OperationPtr& op, bool cpp11)
{
+ string prefix = cpp11 ? "::Ice::FormatType::" : "::Ice::";
+
switch(op->format())
{
case DefaultFormat:
- return "::Ice::DefaultFormat";
+ return prefix + "DefaultFormat";
case CompactFormat:
- return "::Ice::CompactFormat";
+ return prefix + "CompactFormat";
case SlicedFormat:
- return "::Ice::SlicedFormat";
+ return prefix + "SlicedFormat";
default:
assert(false);
diff --git a/cpp/src/Slice/CPlusPlusUtil.h b/cpp/src/Slice/CPlusPlusUtil.h
index 61690026d1f..a57b33c9e68 100644
--- a/cpp/src/Slice/CPlusPlusUtil.h
+++ b/cpp/src/Slice/CPlusPlusUtil.h
@@ -43,7 +43,7 @@ std::string returnTypeToString(const TypePtr&, bool, const StringList& = StringL
std::string inputTypeToString(const TypePtr&, bool, const StringList& = StringList(), int = 0);
std::string outputTypeToString(const TypePtr&, bool, const StringList& = StringList(), int = 0);
std::string operationModeToString(Operation::Mode, bool = false);
-std::string opFormatTypeToString(const OperationPtr&);
+std::string opFormatTypeToString(const OperationPtr&, bool);
std::string fixKwd(const std::string&);
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index f33bfcb7896..7845b53633c 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -2033,7 +2033,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
}
else
{
- C << nl << "::Ice::OutputStream* ostr = result->startWriteParams(" << opFormatTypeToString(p) <<");";
+ C << nl << "::Ice::OutputStream* ostr = result->startWriteParams(" << opFormatTypeToString(p, false) <<");";
writeMarshalCode(C, inParams, 0, true, TypeContextInParam);
if(p->sendsClasses(false))
{
@@ -3057,7 +3057,7 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p)
}
if(p->format() != DefaultFormat)
{
- C << nl << "inS.setFormat(" << opFormatTypeToString(p) << ");";
+ C << nl << "inS.setFormat(" << opFormatTypeToString(p, false) << ");";
}
if(!amd)
@@ -6107,7 +6107,7 @@ Slice::Gen::Cpp11ProxyVisitor::visitOperation(const OperationPtr& p)
C << sp;
C << nl << "outAsync->invoke(" << flatName << ", ";
- C << operationModeToString(p->sendMode(), true) << ", " << opFormatTypeToString(p) << ", context, ";
+ C << operationModeToString(p->sendMode(), true) << ", " << opFormatTypeToString(p, true) << ", context, ";
C.inc();
C << nl;
@@ -6178,7 +6178,7 @@ Slice::Gen::Cpp11ProxyVisitor::visitOperation(const OperationPtr& p)
C << nl << "_checkTwowayOnly(" << flatName << ");";
}
C << nl << "outAsync->invoke(" << flatName << ", ";
- C << operationModeToString(p->sendMode(), true) << ", " << opFormatTypeToString(p) << ", context, ";
+ C << operationModeToString(p->sendMode(), true) << ", " << opFormatTypeToString(p, true) << ", context, ";
C.inc();
C << nl;
@@ -7042,7 +7042,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p)
C << nl << "MarshaledResult(current)";
C.dec();
C << sb;
- C << nl << "ostr->startEncapsulation(current.encoding, " << opFormatTypeToString(p) << ");";
+ C << nl << "ostr->startEncapsulation(current.encoding, " << opFormatTypeToString(p, true) << ");";
writeMarshalCode(C, outParams, p, true, TypeContextCpp11, "ostr");
if(p->returnsClasses(false))
{
@@ -7085,7 +7085,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p)
}
if(p->format() != DefaultFormat)
{
- C << nl << "inS.setFormat(" << opFormatTypeToString(p) << ");";
+ C << nl << "inS.setFormat(" << opFormatTypeToString(p, true) << ");";
}
if(!amd)