diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2005-07-11 16:41:12 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2005-07-11 16:41:12 +0000 |
commit | 8ff7c2608eb845c3b6b637f4648ae726a11a158b (patch) | |
tree | f1dfb4d3a63752357480561fdd94f37692d8eb47 /cppe/src | |
parent | fix some recent changes to build in J2ME (diff) | |
download | ice-8ff7c2608eb845c3b6b637f4648ae726a11a158b.tar.bz2 ice-8ff7c2608eb845c3b6b637f4648ae726a11a158b.tar.xz ice-8ff7c2608eb845c3b6b637f4648ae726a11a158b.zip |
Put back IceUtil namespace
Diffstat (limited to 'cppe/src')
50 files changed, 443 insertions, 443 deletions
diff --git a/cppe/src/IceE/Acceptor.h b/cppe/src/IceE/Acceptor.h index 082be176d72..6b15360fc38 100644 --- a/cppe/src/IceE/Acceptor.h +++ b/cppe/src/IceE/Acceptor.h @@ -32,7 +32,7 @@ namespace IceInternal // XXX: EndpointF? class Endpoint; -class ICEE_API Acceptor : public ::Ice::Shared +class ICEE_API Acceptor : public ::IceUtil::Shared { public: diff --git a/cppe/src/IceE/Cond.cpp b/cppe/src/IceE/Cond.cpp index 0809bac980a..407f499f2c7 100644 --- a/cppe/src/IceE/Cond.cpp +++ b/cppe/src/IceE/Cond.cpp @@ -15,7 +15,7 @@ #ifdef _WIN32 -Ice::Semaphore::Semaphore(long initial) +IceUtil::Semaphore::Semaphore(long initial) { _sem = CreateSemaphore(0, initial, 0x7fffffff, 0); if(_sem == INVALID_HANDLE_VALUE) @@ -24,13 +24,13 @@ Ice::Semaphore::Semaphore(long initial) } } -Ice::Semaphore::~Semaphore() +IceUtil::Semaphore::~Semaphore() { CloseHandle(_sem); } void -Ice::Semaphore::wait() const +IceUtil::Semaphore::wait() const { int rc = WaitForSingleObject(_sem, INFINITE); if(rc != WAIT_OBJECT_0) @@ -40,7 +40,7 @@ Ice::Semaphore::wait() const } bool -Ice::Semaphore::timedWait(const Time& timeout) const +IceUtil::Semaphore::timedWait(const Time& timeout) const { long msec = (long)timeout.toMilliSeconds(); @@ -53,7 +53,7 @@ Ice::Semaphore::timedWait(const Time& timeout) const } void -Ice::Semaphore::post(int count) const +IceUtil::Semaphore::post(int count) const { int rc = ReleaseSemaphore(_sem, count, 0); if(rc == 0) @@ -62,7 +62,7 @@ Ice::Semaphore::post(int count) const } } -Ice::Cond::Cond() : +IceUtil::Cond::Cond() : _gate(1), _blocked(0), _unblocked(0), @@ -70,24 +70,24 @@ Ice::Cond::Cond() : { } -Ice::Cond::~Cond() +IceUtil::Cond::~Cond() { } void -Ice::Cond::signal() +IceUtil::Cond::signal() { wake(false); } void -Ice::Cond::broadcast() +IceUtil::Cond::broadcast() { wake(true); } void -Ice::Cond::wake(bool broadcast) +IceUtil::Cond::wake(bool broadcast) { // // Lock gate & mutex. @@ -121,7 +121,7 @@ Ice::Cond::wake(bool broadcast) } void -Ice::Cond::preWait() const +IceUtil::Cond::preWait() const { _gate.wait(); _blocked++; @@ -129,7 +129,7 @@ Ice::Cond::preWait() const } void -Ice::Cond::postWait(bool timedOut) const +IceUtil::Cond::postWait(bool timedOut) const { _internal.lock(); _unblocked++; @@ -160,7 +160,7 @@ Ice::Cond::postWait(bool timedOut) const } void -Ice::Cond::dowait() const +IceUtil::Cond::dowait() const { try { @@ -175,7 +175,7 @@ Ice::Cond::dowait() const } bool -Ice::Cond::timedDowait(const Time& timeout) const +IceUtil::Cond::timedDowait(const Time& timeout) const { try { @@ -192,7 +192,7 @@ Ice::Cond::timedDowait(const Time& timeout) const #else -Ice::Cond::Cond() +IceUtil::Cond::Cond() { int rc; @@ -217,7 +217,7 @@ Ice::Cond::Cond() } } -Ice::Cond::~Cond() +IceUtil::Cond::~Cond() { int rc = 0; rc = pthread_cond_destroy(&_cond); @@ -225,7 +225,7 @@ Ice::Cond::~Cond() } void -Ice::Cond::signal() +IceUtil::Cond::signal() { int rc = pthread_cond_signal(&_cond); if(rc != 0) @@ -235,7 +235,7 @@ Ice::Cond::signal() } void -Ice::Cond::broadcast() +IceUtil::Cond::broadcast() { int rc = pthread_cond_broadcast(&_cond); if(rc != 0) diff --git a/cppe/src/IceE/Connection.cpp b/cppe/src/IceE/Connection.cpp index 4b5542db74d..5d05d3a3afb 100755 --- a/cppe/src/IceE/Connection.cpp +++ b/cppe/src/IceE/Connection.cpp @@ -53,7 +53,7 @@ Ice::operator<(const Connection& l, const Connection& r) void Ice::Connection::waitForValidation() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); while(_state == StateNotValidated) { @@ -71,14 +71,14 @@ Ice::Connection::waitForValidation() void Ice::Connection::activate() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateActive); } void Ice::Connection::hold() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateHolding); } #endif @@ -86,7 +86,7 @@ Ice::Connection::hold() void Ice::Connection::destroy(DestructionReason reason) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); switch(reason) { @@ -109,7 +109,7 @@ Ice::Connection::destroy(DestructionReason reason) void Ice::Connection::close(bool force) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(force) { @@ -129,7 +129,7 @@ Ice::Connection::isDestroyed() const // factory might return destroyed (closing or closed) connections, // resulting in connection retry exhaustion. // - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); return _state >= StateClosing; } @@ -137,7 +137,7 @@ Ice::Connection::isDestroyed() const bool Ice::Connection::isFinished() const { - Ice::ThreadPtr threadPerConnection; + IceUtil::ThreadPtr threadPerConnection; { // @@ -145,7 +145,7 @@ Ice::Connection::isFinished() const // threads operating in this connection object, connection // destruction is considered as not yet finished. // - Ice::Monitor<Ice::Mutex>::TryLock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::TryLock sync(*this); if(!sync.acquired()) { @@ -173,7 +173,7 @@ Ice::Connection::isFinished() const void Ice::Connection::waitUntilHolding() const { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); while(_state < StateHolding || _dispatchCount > 0) { @@ -185,10 +185,10 @@ Ice::Connection::waitUntilHolding() const void Ice::Connection::waitUntilFinished() { - Ice::ThreadPtr threadPerConnection; + IceUtil::ThreadPtr threadPerConnection; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // We wait indefinitely until connection closing has been @@ -210,10 +210,10 @@ Ice::Connection::waitUntilFinished() { if(_state != StateClosed && _endpoint->timeout() >= 0) { - Ice::Time timeout = Ice::Time::milliSeconds(_endpoint->timeout()); - Ice::Time waitTime = _stateTime + timeout - Ice::Time::now(); + IceUtil::Time timeout = IceUtil::Time::milliSeconds(_endpoint->timeout()); + IceUtil::Time waitTime = _stateTime + timeout - IceUtil::Time::now(); - if(waitTime > Ice::Time()) + if(waitTime > IceUtil::Time()) { // // We must wait a bit longer until we close this @@ -271,7 +271,7 @@ Ice::Connection::sendRequest(BasicStream* os, Outgoing* out) Int requestId; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(_exception.get()) { @@ -315,7 +315,7 @@ Ice::Connection::sendRequest(BasicStream* os, Outgoing* out) try { - Ice::Mutex::Lock sendSync(_sendMutex); + IceUtil::Mutex::Lock sendSync(_sendMutex); if(!_transceiver) // Has the transceiver already been closed? { @@ -340,7 +340,7 @@ Ice::Connection::sendRequest(BasicStream* os, Outgoing* out) } catch(const LocalException& ex) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateClosed, ex); assert(_exception.get()); @@ -387,7 +387,7 @@ Ice::Connection::sendRequest(BasicStream* os, Outgoing* out) void Ice::Connection::prepareBatchRequest(BasicStream* os) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // Wait if flushing is currently in progress. @@ -430,7 +430,7 @@ Ice::Connection::prepareBatchRequest(BasicStream* os) void Ice::Connection::finishBatchRequest(BasicStream* os) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // Get the batch stream back and increment the number of requests @@ -450,7 +450,7 @@ Ice::Connection::finishBatchRequest(BasicStream* os) void Ice::Connection::abortBatchRequest() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // Destroy and reset the batch stream and batch count. We cannot @@ -474,7 +474,7 @@ void Ice::Connection::flushBatchRequests() { { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); while(_batchStreamInUse && !_exception.get()) { @@ -505,7 +505,7 @@ Ice::Connection::flushBatchRequests() try { - Ice::Mutex::Lock sendSync(_sendMutex); + IceUtil::Mutex::Lock sendSync(_sendMutex); if(!_transceiver) // Has the transceiver already been closed? { @@ -540,7 +540,7 @@ Ice::Connection::flushBatchRequests() } catch(const LocalException& ex) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateClosed, ex); assert(_exception.get()); @@ -552,7 +552,7 @@ Ice::Connection::flushBatchRequests() } { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // Reset the batch stream, and notify that flushing is over. @@ -572,7 +572,7 @@ Ice::Connection::sendResponse(BasicStream* os) { try { - Ice::Mutex::Lock sendSync(_sendMutex); + IceUtil::Mutex::Lock sendSync(_sendMutex); if(!_transceiver) // Has the transceiver already been closed? { @@ -597,12 +597,12 @@ Ice::Connection::sendResponse(BasicStream* os) } catch(const LocalException& ex) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateClosed, ex); } { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_state > StateNotValidated); @@ -628,7 +628,7 @@ Ice::Connection::sendResponse(BasicStream* os) void Ice::Connection::sendNoResponse() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_state > StateNotValidated); @@ -673,7 +673,7 @@ Ice::Connection::createProxy(const Identity& ident) const void Ice::Connection::exception(const LocalException& ex) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateClosed, ex); } @@ -731,7 +731,7 @@ Ice::Connection::Connection(const InstancePtr& instance, _requestsHint(_requests.end()), _dispatchCount(0), _state(StateNotValidated), - _stateTime(Ice::Time::now()) + _stateTime(IceUtil::Time::now()) { vector<Byte>& requestHdr = const_cast<vector<Byte>&>(_requestHdr); requestHdr[0] = magic[0]; @@ -812,7 +812,7 @@ Ice::Connection::Connection(const InstancePtr& instance, Ice::Connection::~Connection() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_state == StateClosed); assert(!_transceiver); @@ -827,7 +827,7 @@ Ice::Connection::validate() bool active; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_state == StateNotValidated); @@ -946,7 +946,7 @@ Ice::Connection::validate() } catch(const LocalException& ex) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateClosed, ex); assert(_exception.get()); _exception->ice_throw(); @@ -954,7 +954,7 @@ Ice::Connection::validate() #ifndef ICEE_PURE_CLIENT { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // We start out in holding state. @@ -963,7 +963,7 @@ Ice::Connection::validate() } #else { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // We start out in active state. @@ -1107,7 +1107,7 @@ Ice::Connection::setState(State state) } _state = state; - _stateTime = Ice::Time::now(); + _stateTime = IceUtil::Time::now(); notifyAll(); @@ -1130,7 +1130,7 @@ Ice::Connection::initiateShutdown() const assert(_state == StateClosing); assert(_dispatchCount == 0); - Ice::Mutex::Lock sendSync(_sendMutex); + IceUtil::Mutex::Lock sendSync(_sendMutex); // // Before we shut down, we send a close connection message. @@ -1368,19 +1368,19 @@ Ice::Connection::invokeAll(BasicStream& stream, Int invokeNum, Int requestId, } catch(const LocalException& ex) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateClosed, ex); } catch(const std::exception& ex) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); UnknownException uex(__FILE__, __LINE__); uex.unknown = string("std::exception: ") + ex.what(); setState(StateClosed, uex); } catch(...) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); UnknownException uex(__FILE__, __LINE__); uex.unknown = "unknown c++ exception"; setState(StateClosed, uex); @@ -1393,7 +1393,7 @@ Ice::Connection::invokeAll(BasicStream& stream, Int invokeNum, Int requestId, // if(invokeNum > 0) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_dispatchCount > 0); _dispatchCount -= invokeNum; assert(_dispatchCount >= 0); @@ -1419,7 +1419,7 @@ Ice::Connection::run() } catch(const LocalException&) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_state == StateClosed); @@ -1427,7 +1427,7 @@ Ice::Connection::run() // We must make sure that nobody is sending when we close // the transceiver. // - Ice::Mutex::Lock sendSync(_sendMutex); + IceUtil::Mutex::Lock sendSync(_sendMutex); try { @@ -1444,7 +1444,7 @@ Ice::Connection::run() } { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateActive); } @@ -1545,7 +1545,7 @@ Ice::Connection::run() map<Int, Outgoing*> requests; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); #ifndef ICEE_PURE_CLIENT while(_state == StateHolding) @@ -1573,7 +1573,7 @@ Ice::Connection::run() // We must make sure that nobody is sending when we close // the transceiver. // - Ice::Mutex::Lock sendSync(_sendMutex); + IceUtil::Mutex::Lock sendSync(_sendMutex); try { @@ -1660,7 +1660,7 @@ Ice::Connection::ThreadPerConnection::run() void Ice::Connection::setAdapter(const ObjectAdapterPtr& adapter) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(_exception.get()) { @@ -1704,7 +1704,7 @@ Ice::Connection::setAdapter(const ObjectAdapterPtr& adapter) ObjectAdapterPtr Ice::Connection::getAdapter() const { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); return _adapter; } #endif diff --git a/cppe/src/IceE/Connector.h b/cppe/src/IceE/Connector.h index aa582822282..48fedb8ca83 100755 --- a/cppe/src/IceE/Connector.h +++ b/cppe/src/IceE/Connector.h @@ -28,7 +28,7 @@ namespace IceInternal class Endpoint; -class ICEE_API Connector : public ::Ice::Shared +class ICEE_API Connector : public ::IceUtil::Shared { public: diff --git a/cppe/src/IceE/DefaultsAndOverrides.h b/cppe/src/IceE/DefaultsAndOverrides.h index c77634d860a..400cf5d4ee7 100644 --- a/cppe/src/IceE/DefaultsAndOverrides.h +++ b/cppe/src/IceE/DefaultsAndOverrides.h @@ -17,7 +17,7 @@ namespace IceInternal { -class DefaultsAndOverrides : public ::Ice::Shared +class DefaultsAndOverrides : public ::IceUtil::Shared { public: diff --git a/cppe/src/IceE/Endpoint.h b/cppe/src/IceE/Endpoint.h index f953ba14c00..82fc42e6763 100644 --- a/cppe/src/IceE/Endpoint.h +++ b/cppe/src/IceE/Endpoint.h @@ -26,7 +26,7 @@ namespace IceInternal class BasicStream; -class ICEE_API Endpoint : public Ice::Shared +class ICEE_API Endpoint : public IceUtil::Shared { public: diff --git a/cppe/src/IceE/EndpointFactory.h b/cppe/src/IceE/EndpointFactory.h index ccdf3f72341..25c5539f66d 100644 --- a/cppe/src/IceE/EndpointFactory.h +++ b/cppe/src/IceE/EndpointFactory.h @@ -20,7 +20,7 @@ namespace IceInternal class BasicStream; -class ICEE_API EndpointFactory : public ::Ice::Shared +class ICEE_API EndpointFactory : public ::IceUtil::Shared { public: diff --git a/cppe/src/IceE/ExceptionBase.cpp b/cppe/src/IceE/ExceptionBase.cpp index b7513b64faf..a9eb9b183c7 100755 --- a/cppe/src/IceE/ExceptionBase.cpp +++ b/cppe/src/IceE/ExceptionBase.cpp @@ -12,39 +12,39 @@ using namespace std; -namespace Ice +namespace IceUtil { bool ICEE_API nullHandleAbort = false; }; -Ice::Exception::Exception() : +IceUtil::Exception::Exception() : _file(0), _line(0) { } -Ice::Exception::Exception(const char* file, int line) : +IceUtil::Exception::Exception(const char* file, int line) : _file(file), _line(line) { } -Ice::Exception::~Exception() +IceUtil::Exception::~Exception() { } -const char* Ice::Exception::_name = "Ice::Exception"; +const char* IceUtil::Exception::_name = "IceUtil::Exception"; const string -Ice::Exception::ice_name() const +IceUtil::Exception::ice_name() const { return _name; } string -Ice::Exception::toString() const +IceUtil::Exception::toString() const { string out; if(_file && _line > 0) @@ -55,31 +55,31 @@ Ice::Exception::toString() const return out; } -Ice::Exception* -Ice::Exception::ice_clone() const +IceUtil::Exception* +IceUtil::Exception::ice_clone() const { return new Exception(*this); } void -Ice::Exception::ice_throw() const +IceUtil::Exception::ice_throw() const { throw *this; } const char* -Ice::Exception::ice_file() const +IceUtil::Exception::ice_file() const { return _file; } int -Ice::Exception::ice_line() const +IceUtil::Exception::ice_line() const { return _line; } -Ice::NullHandleException::NullHandleException(const char* file, int line) : +IceUtil::NullHandleException::NullHandleException(const char* file, int line) : Exception(file, line) { if(nullHandleAbort) @@ -95,22 +95,22 @@ Ice::NullHandleException::NullHandleException(const char* file, int line) : } } -const char* Ice::NullHandleException::_name = "Ice::NullHandleException"; +const char* IceUtil::NullHandleException::_name = "IceUtil::NullHandleException"; const string -Ice::NullHandleException::ice_name() const +IceUtil::NullHandleException::ice_name() const { return _name; } -Ice::Exception* -Ice::NullHandleException::ice_clone() const +IceUtil::Exception* +IceUtil::NullHandleException::ice_clone() const { return new NullHandleException(*this); } void -Ice::NullHandleException::ice_throw() const +IceUtil::NullHandleException::ice_throw() const { throw *this; } diff --git a/cppe/src/IceE/FactoryTableDef.cpp b/cppe/src/IceE/FactoryTableDef.cpp index 2a8155a0a0d..85cf344f6fd 100644 --- a/cppe/src/IceE/FactoryTableDef.cpp +++ b/cppe/src/IceE/FactoryTableDef.cpp @@ -31,7 +31,7 @@ ICEE_API FactoryTableDef* factoryTable; // Single global instance of the factor void Ice::FactoryTableDef::addExceptionFactory(const std::string& t, const IceInternal::UserExceptionFactoryPtr& f) { - Ice::Mutex::Lock lock(_m); + IceUtil::Mutex::Lock lock(_m); EFTable::iterator i = _eft.find(t); if(i == _eft.end()) { @@ -49,7 +49,7 @@ Ice::FactoryTableDef::addExceptionFactory(const std::string& t, const IceInterna IceInternal::UserExceptionFactoryPtr Ice::FactoryTableDef::getExceptionFactory(const std::string& t) const { - Ice::Mutex::Lock lock(_m); + IceUtil::Mutex::Lock lock(_m); EFTable::const_iterator i = _eft.find(t); #ifdef __APPLE__ if(i == _eft.end()) @@ -85,7 +85,7 @@ Ice::FactoryTableDef::getExceptionFactory(const std::string& t) const void Ice::FactoryTableDef::removeExceptionFactory(const std::string& t) { - Ice::Mutex::Lock lock(_m); + IceUtil::Mutex::Lock lock(_m); EFTable::iterator i = _eft.find(t); if(i != _eft.end()) { @@ -119,7 +119,7 @@ Ice::FactoryTableWrapper::~FactoryTableWrapper() void Ice::FactoryTableWrapper::initialize() { - Ice::StaticMutex::Lock lock(_m); + IceUtil::StaticMutex::Lock lock(_m); if(_initCount == 0) { factoryTable = new FactoryTableDef; @@ -133,12 +133,12 @@ Ice::FactoryTableWrapper::initialize() void Ice::FactoryTableWrapper::finalize() { - Ice::StaticMutex::Lock lock(_m); + IceUtil::StaticMutex::Lock lock(_m); if(--_initCount == 0) { delete factoryTable; } } -Ice::StaticMutex Ice::FactoryTableWrapper::_m = ICEE_STATIC_MUTEX_INITIALIZER; +IceUtil::StaticMutex Ice::FactoryTableWrapper::_m = ICEE_STATIC_MUTEX_INITIALIZER; int Ice::FactoryTableWrapper::_initCount = 0; // Initialization count diff --git a/cppe/src/IceE/IdentityUtil.cpp b/cppe/src/IceE/IdentityUtil.cpp index 6c2b343f305..c992c98b43f 100644 --- a/cppe/src/IceE/IdentityUtil.cpp +++ b/cppe/src/IceE/IdentityUtil.cpp @@ -47,7 +47,7 @@ Ice::stringToIdentity(const string& s) if(slash == string::npos) { - if(!Ice::unescapeString(s, 0, s.size(), ident.name)) + if(!IceUtil::unescapeString(s, 0, s.size(), ident.name)) { IdentityParseException ex(__FILE__, __LINE__); ex.str = s; @@ -56,7 +56,7 @@ Ice::stringToIdentity(const string& s) } else { - if(!Ice::unescapeString(s, 0, slash, ident.category)) + if(!IceUtil::unescapeString(s, 0, slash, ident.category)) { IdentityParseException ex(__FILE__, __LINE__); ex.str = s; @@ -64,7 +64,7 @@ Ice::stringToIdentity(const string& s) } if(slash + 1 < s.size()) { - if(!Ice::unescapeString(s, slash + 1, s.size(), ident.name)) + if(!IceUtil::unescapeString(s, slash + 1, s.size(), ident.name)) { IdentityParseException ex(__FILE__, __LINE__); ex.str = s; @@ -81,10 +81,10 @@ Ice::identityToString(const Identity& ident) { if(ident.category.empty()) { - return Ice::escapeString(ident.name, "/"); + return IceUtil::escapeString(ident.name, "/"); } else { - return Ice::escapeString(ident.category, "/") + '/' + Ice::escapeString(ident.name, "/"); + return IceUtil::escapeString(ident.category, "/") + '/' + IceUtil::escapeString(ident.name, "/"); } } diff --git a/cppe/src/IceE/Incoming.cpp b/cppe/src/IceE/Incoming.cpp index 58c9c52e34e..3c9300c23c7 100644 --- a/cppe/src/IceE/Incoming.cpp +++ b/cppe/src/IceE/Incoming.cpp @@ -57,7 +57,7 @@ IceInternal::IncomingBase::__warning(const string& msg) const Warning out(_os.instance()->logger()); out << "dispatch exception: " << msg; out << "\nidentity: " << identityToString(_current.id); - out << "\nfacet: " << Ice::escapeString(_current.facet, ""); + out << "\nfacet: " << IceUtil::escapeString(_current.facet, ""); out << "\noperation: " << _current.operation; } diff --git a/cppe/src/IceE/IncomingConnectionFactory.cpp b/cppe/src/IceE/IncomingConnectionFactory.cpp index cd13a16c650..32098c12702 100644 --- a/cppe/src/IceE/IncomingConnectionFactory.cpp +++ b/cppe/src/IceE/IncomingConnectionFactory.cpp @@ -30,21 +30,21 @@ void IceInternal::decRef(IncomingConnectionFactory* p) { p->__decRef(); } void IceInternal::IncomingConnectionFactory::activate() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateActive); } void IceInternal::IncomingConnectionFactory::hold() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateHolding); } void IceInternal::IncomingConnectionFactory::destroy() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateClosed); } @@ -54,7 +54,7 @@ IceInternal::IncomingConnectionFactory::waitUntilHolding() const list<ConnectionPtr> connections; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // First we wait until the connection factory itself is in holding @@ -81,11 +81,11 @@ IceInternal::IncomingConnectionFactory::waitUntilHolding() const void IceInternal::IncomingConnectionFactory::waitUntilFinished() { - Ice::ThreadPtr threadPerIncomingConnectionFactory; + IceUtil::ThreadPtr threadPerIncomingConnectionFactory; list<ConnectionPtr> connections; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // First we wait until the factory is destroyed. If we are using @@ -136,7 +136,7 @@ IceInternal::IncomingConnectionFactory::equivalent(const EndpointPtr& endp) cons list<ConnectionPtr> IceInternal::IncomingConnectionFactory::connections() const { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); list<ConnectionPtr> result; @@ -170,7 +170,7 @@ IceInternal::IncomingConnectionFactory::flushBatchRequests() string IceInternal::IncomingConnectionFactory::toString() const { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(_transceiver) { @@ -239,7 +239,7 @@ IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const Instance IceInternal::IncomingConnectionFactory::~IncomingConnectionFactory() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_state == StateClosed); assert(!_acceptor); @@ -341,7 +341,7 @@ IceInternal::IncomingConnectionFactory::run() ConnectionPtr connection; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); while(_state == StateHolding) { diff --git a/cppe/src/IceE/IncomingConnectionFactory.h b/cppe/src/IceE/IncomingConnectionFactory.h index 11fc19a5fda..639bebc46ba 100755 --- a/cppe/src/IceE/IncomingConnectionFactory.h +++ b/cppe/src/IceE/IncomingConnectionFactory.h @@ -28,7 +28,7 @@ namespace IceInternal { -class IncomingConnectionFactory : public Ice::Monitor<Ice::Mutex>, public Ice::Shared +class IncomingConnectionFactory : public IceUtil::Monitor<IceUtil::Mutex>, public IceUtil::Shared { public: @@ -65,7 +65,7 @@ private: void run(); - class ThreadPerIncomingConnectionFactory : public Ice::Thread + class ThreadPerIncomingConnectionFactory : public IceUtil::Thread { public: @@ -77,7 +77,7 @@ private: IncomingConnectionFactoryPtr _factory; }; friend class ThreadPerIncomingConnectionFactory; - Ice::ThreadPtr _threadPerIncomingConnectionFactory; + IceUtil::ThreadPtr _threadPerIncomingConnectionFactory; const InstancePtr _instance; AcceptorPtr _acceptor; diff --git a/cppe/src/IceE/Instance.cpp b/cppe/src/IceE/Instance.cpp index 2cdc0bf984d..b4e83ee421a 100644 --- a/cppe/src/IceE/Instance.cpp +++ b/cppe/src/IceE/Instance.cpp @@ -45,12 +45,12 @@ using namespace std; using namespace Ice; using namespace IceInternal; -static Ice::StaticMutex staticMutex = ICEE_STATIC_MUTEX_INITIALIZER; +static IceUtil::StaticMutex staticMutex = ICEE_STATIC_MUTEX_INITIALIZER; static bool oneOffDone = false; static int instanceCount = 0; static bool printProcessIdDone = false; -namespace Ice +namespace IceUtil { extern bool ICEE_API nullHandleAbort; @@ -70,7 +70,7 @@ IceInternal::Instance::properties() const LoggerPtr IceInternal::Instance::logger() const { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); // // Don't throw CommunicatorDestroyedException if destroyed. We @@ -82,7 +82,7 @@ IceInternal::Instance::logger() const void IceInternal::Instance::logger(const LoggerPtr& logger) { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -111,7 +111,7 @@ IceInternal::Instance::defaultsAndOverrides() const RouterManagerPtr IceInternal::Instance::routerManager() const { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -128,7 +128,7 @@ IceInternal::Instance::routerManager() const LocatorManagerPtr IceInternal::Instance::locatorManager() const { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -143,7 +143,7 @@ IceInternal::Instance::locatorManager() const ReferenceFactoryPtr IceInternal::Instance::referenceFactory() const { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -156,7 +156,7 @@ IceInternal::Instance::referenceFactory() const ProxyFactoryPtr IceInternal::Instance::proxyFactory() const { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -169,7 +169,7 @@ IceInternal::Instance::proxyFactory() const OutgoingConnectionFactoryPtr IceInternal::Instance::outgoingConnectionFactory() const { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -183,7 +183,7 @@ IceInternal::Instance::outgoingConnectionFactory() const ObjectAdapterFactoryPtr IceInternal::Instance::objectAdapterFactory() const { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -204,7 +204,7 @@ IceInternal::Instance::threadPerConnectionStackSize() const EndpointFactoryPtr IceInternal::Instance::endpointFactory() const { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -232,7 +232,7 @@ IceInternal::Instance::flushBatchRequests() #endif { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); if(_destroyed) { @@ -275,7 +275,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope { __setNoDelete(true); - Ice::StaticMutex::Lock sync(staticMutex); + IceUtil::StaticMutex::Lock sync(staticMutex); instanceCount++; if(!oneOffDone) @@ -311,7 +311,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope } #endif - unsigned int seed = static_cast<unsigned int>(Ice::Time::now().toMicroSeconds()); + unsigned int seed = static_cast<unsigned int>(IceUtil::Time::now().toMicroSeconds()); srand(seed); #ifndef _WIN32 srand48(seed); @@ -319,7 +319,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope if(_properties->getPropertyAsInt("IceE.NullHandleAbort") > 0) { - Ice::nullHandleAbort = true; + IceUtil::nullHandleAbort = true; } #ifndef _WIN32 @@ -436,7 +436,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope catch(...) { { - Ice::StaticMutex::Lock sync(staticMutex); + IceUtil::StaticMutex::Lock sync(staticMutex); --instanceCount; } destroy(); @@ -462,7 +462,7 @@ IceInternal::Instance::~Instance() #endif assert(!_endpointFactory); - Ice::StaticMutex::Lock sync(staticMutex); + IceUtil::StaticMutex::Lock sync(staticMutex); if(--instanceCount == 0) { #ifdef _WIN32 @@ -512,7 +512,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[]) // // Safe double-check locking (no dependent variable!) // - Ice::StaticMutex::Lock sync(staticMutex); + IceUtil::StaticMutex::Lock sync(staticMutex); printProcessId = !printProcessIdDone; // @@ -568,7 +568,7 @@ IceInternal::Instance::destroy() #endif { - Ice::RecMutex::Lock sync(*this); + IceUtil::RecMutex::Lock sync(*this); #ifndef ICEE_PURE_CLIENT _objectAdapterFactory = 0; diff --git a/cppe/src/IceE/Instance.h b/cppe/src/IceE/Instance.h index 6b6d190ee18..3c0530479e2 100644 --- a/cppe/src/IceE/Instance.h +++ b/cppe/src/IceE/Instance.h @@ -38,7 +38,7 @@ class CommunicatorI; namespace IceInternal { -class Instance : public Ice::Shared, public Ice::RecMutex +class Instance : public IceUtil::Shared, public IceUtil::RecMutex { public: diff --git a/cppe/src/IceE/LocatorInfo.cpp b/cppe/src/IceE/LocatorInfo.cpp index 0e367a18f4f..13b623f316f 100644 --- a/cppe/src/IceE/LocatorInfo.cpp +++ b/cppe/src/IceE/LocatorInfo.cpp @@ -44,7 +44,7 @@ IceInternal::LocatorManager::LocatorManager() : void IceInternal::LocatorManager::destroy() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); for_each(_table.begin(), _table.end(), Ice::secondVoidMemFun<const LocatorPrx, LocatorInfo>(&LocatorInfo::destroy)); @@ -68,7 +68,7 @@ IceInternal::LocatorManager::get(const LocatorPrx& loc) // TODO: reap unused locator info objects? // - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<LocatorPrx, LocatorInfoPtr>::iterator p = _table.end(); @@ -118,7 +118,7 @@ IceInternal::LocatorTable::LocatorTable() void IceInternal::LocatorTable::clear() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _adapterEndpointsMap.clear(); _objectMap.clear(); @@ -127,7 +127,7 @@ IceInternal::LocatorTable::clear() bool IceInternal::LocatorTable::getAdapterEndpoints(const string& adapter, vector<EndpointPtr>& endpoints) const { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<string, vector<EndpointPtr> >::const_iterator p = _adapterEndpointsMap.find(adapter); @@ -145,7 +145,7 @@ IceInternal::LocatorTable::getAdapterEndpoints(const string& adapter, vector<End void IceInternal::LocatorTable::addAdapterEndpoints(const string& adapter, const vector<EndpointPtr>& endpoints) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _adapterEndpointsMap.insert(make_pair(adapter, endpoints)); } @@ -153,7 +153,7 @@ IceInternal::LocatorTable::addAdapterEndpoints(const string& adapter, const vect vector<EndpointPtr> IceInternal::LocatorTable::removeAdapterEndpoints(const string& adapter) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<string, vector<EndpointPtr> >::iterator p = _adapterEndpointsMap.find(adapter); if(p == _adapterEndpointsMap.end()) @@ -171,7 +171,7 @@ IceInternal::LocatorTable::removeAdapterEndpoints(const string& adapter) bool IceInternal::LocatorTable::getProxy(const Identity& id, ObjectPrx& proxy) const { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<Identity, ObjectPrx>::const_iterator p = _objectMap.find(id); @@ -189,14 +189,14 @@ IceInternal::LocatorTable::getProxy(const Identity& id, ObjectPrx& proxy) const void IceInternal::LocatorTable::addProxy(const Identity& id, const ObjectPrx& proxy) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _objectMap.insert(make_pair(id, proxy)); } ObjectPrx IceInternal::LocatorTable::removeProxy(const Identity& id) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<Identity, ObjectPrx>::iterator p = _objectMap.find(id); if(p == _objectMap.end()) @@ -220,7 +220,7 @@ IceInternal::LocatorInfo::LocatorInfo(const LocatorPrx& locator, const LocatorTa void IceInternal::LocatorInfo::destroy() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _locatorRegistry = 0; _table->clear(); @@ -256,7 +256,7 @@ IceInternal::LocatorInfo::getLocator() const LocatorRegistryPrx IceInternal::LocatorInfo::getLocatorRegistry() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); if(!_locatorRegistry) // Lazy initialization. { diff --git a/cppe/src/IceE/LocatorInfo.h b/cppe/src/IceE/LocatorInfo.h index 7e093325bed..1ec21aafa89 100644 --- a/cppe/src/IceE/LocatorInfo.h +++ b/cppe/src/IceE/LocatorInfo.h @@ -24,7 +24,7 @@ namespace IceInternal { -class LocatorManager : public Ice::Shared, public Ice::Mutex +class LocatorManager : public IceUtil::Shared, public IceUtil::Mutex { public: @@ -46,7 +46,7 @@ private: std::map<Ice::Identity, LocatorTablePtr> _locatorTables; }; -class LocatorTable : public Ice::Shared, public Ice::Mutex +class LocatorTable : public IceUtil::Shared, public IceUtil::Mutex { public: @@ -68,7 +68,7 @@ private: std::map<Ice::Identity, Ice::ObjectPrx > _objectMap; }; -class LocatorInfo : public Ice::Shared, public Ice::Mutex +class LocatorInfo : public IceUtil::Shared, public IceUtil::Mutex { public: diff --git a/cppe/src/IceE/LoggerI.cpp b/cppe/src/IceE/LoggerI.cpp index 72bdcebc07c..89510b7ee0e 100644 --- a/cppe/src/IceE/LoggerI.cpp +++ b/cppe/src/IceE/LoggerI.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -Ice::Mutex Ice::LoggerI::_globalMutex; +IceUtil::Mutex Ice::LoggerI::_globalMutex; Ice::LoggerI::LoggerI(const string& prefix) { @@ -26,7 +26,7 @@ Ice::LoggerI::LoggerI(const string& prefix) void Ice::LoggerI::print(const string& message) { - Ice::Mutex::Lock sync(_globalMutex); + IceUtil::Mutex::Lock sync(_globalMutex); fprintf(stderr, "%s\n", message.c_str()); } @@ -34,7 +34,7 @@ Ice::LoggerI::print(const string& message) void Ice::LoggerI::trace(const string& category, const string& message) { - Ice::Mutex::Lock sync(_globalMutex); + IceUtil::Mutex::Lock sync(_globalMutex); string s = "[ "; s += _prefix; @@ -56,13 +56,13 @@ Ice::LoggerI::trace(const string& category, const string& message) void Ice::LoggerI::warning(const string& message) { - Ice::Mutex::Lock sync(_globalMutex); + IceUtil::Mutex::Lock sync(_globalMutex); fprintf(stderr, "%s warning: %s\n", _prefix.c_str(), message.c_str()); } void Ice::LoggerI::error(const string& message) { - Ice::Mutex::Lock sync(_globalMutex); + IceUtil::Mutex::Lock sync(_globalMutex); fprintf(stderr, "%s error: %s\n", _prefix.c_str(), message.c_str()); } diff --git a/cppe/src/IceE/LoggerI.h b/cppe/src/IceE/LoggerI.h index 96ceee31eb2..3f529ec3697 100644 --- a/cppe/src/IceE/LoggerI.h +++ b/cppe/src/IceE/LoggerI.h @@ -36,7 +36,7 @@ private: // A global mutex is used to avoid garbled output with multiple // communicators. // - static Ice::Mutex _globalMutex; + static IceUtil::Mutex _globalMutex; }; } diff --git a/cppe/src/IceE/ObjectAdapter.cpp b/cppe/src/IceE/ObjectAdapter.cpp index 0c34fef31cf..788d4c0f650 100644 --- a/cppe/src/IceE/ObjectAdapter.cpp +++ b/cppe/src/IceE/ObjectAdapter.cpp @@ -78,7 +78,7 @@ Ice::ObjectAdapter::getName() const CommunicatorPtr Ice::ObjectAdapter::getCommunicator() const { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -94,7 +94,7 @@ Ice::ObjectAdapter::activate() bool printAdapterReady = false; { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -163,7 +163,7 @@ Ice::ObjectAdapter::activate() void Ice::ObjectAdapter::hold() { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -174,7 +174,7 @@ Ice::ObjectAdapter::hold() void Ice::ObjectAdapter::waitForHold() { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -189,7 +189,7 @@ Ice::ObjectAdapter::deactivate() OutgoingConnectionFactoryPtr outgoingConnectionFactory; { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); // // Ignore deactivation requests if the object adapter has already @@ -228,7 +228,7 @@ void Ice::ObjectAdapter::waitForDeactivate() { { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); // // First we wait for deactivation of the adapter itself, and for @@ -267,7 +267,7 @@ Ice::ObjectAdapter::waitForDeactivate() } { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); // // Signal that waiting is complete. @@ -299,7 +299,7 @@ Ice::ObjectAdapter::add(const ObjectPtr& object, const Identity& ident) ObjectPrx Ice::ObjectAdapter::addFacet(const ObjectPtr& object, const Identity& ident, const string& facet) { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); checkIdentity(ident); @@ -319,7 +319,7 @@ ObjectPrx Ice::ObjectAdapter::addFacetWithUUID(const ObjectPtr& object, const string& facet) { Identity ident; - ident.name = Ice::generateUUID(); + ident.name = IceUtil::generateUUID(); return addFacet(object, ident, facet); } @@ -332,7 +332,7 @@ Ice::ObjectAdapter::remove(const Identity& ident) ObjectPtr Ice::ObjectAdapter::removeFacet(const Identity& ident, const string& facet) { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); checkIdentity(ident); @@ -343,7 +343,7 @@ Ice::ObjectAdapter::removeFacet(const Identity& ident, const string& facet) FacetMap Ice::ObjectAdapter::removeAllFacets(const Identity& ident) { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); checkIdentity(ident); @@ -360,7 +360,7 @@ Ice::ObjectAdapter::find(const Identity& ident) const ObjectPtr Ice::ObjectAdapter::findFacet(const Identity& ident, const string& facet) const { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); checkIdentity(ident); @@ -371,7 +371,7 @@ Ice::ObjectAdapter::findFacet(const Identity& ident, const string& facet) const FacetMap Ice::ObjectAdapter::findAllFacets(const Identity& ident) const { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); checkIdentity(ident); @@ -382,7 +382,7 @@ Ice::ObjectAdapter::findAllFacets(const Identity& ident) const ObjectPtr Ice::ObjectAdapter::findByProxy(const ObjectPrx& proxy) const { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -393,7 +393,7 @@ Ice::ObjectAdapter::findByProxy(const ObjectPrx& proxy) const ObjectPrx Ice::ObjectAdapter::createProxy(const Identity& ident) const { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); checkIdentity(ident); @@ -404,7 +404,7 @@ Ice::ObjectAdapter::createProxy(const Identity& ident) const ObjectPrx Ice::ObjectAdapter::createDirectProxy(const Identity& ident) const { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); checkIdentity(ident); @@ -415,7 +415,7 @@ Ice::ObjectAdapter::createDirectProxy(const Identity& ident) const ObjectPrx Ice::ObjectAdapter::createReverseProxy(const Identity& ident) const { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); checkIdentity(ident); @@ -445,7 +445,7 @@ void Ice::ObjectAdapter::addRouter(const RouterPrx& router) { #ifdef ICEE_HAS_ROUTER - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -485,7 +485,7 @@ void Ice::ObjectAdapter::setLocator(const LocatorPrx& locator) { #ifdef ICEE_HAS_LOCATOR - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -496,7 +496,7 @@ Ice::ObjectAdapter::setLocator(const LocatorPrx& locator) bool Ice::ObjectAdapter::isLocal(const ObjectPrx& proxy) const { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -560,7 +560,7 @@ Ice::ObjectAdapter::flushBatchRequests() { vector<IncomingConnectionFactoryPtr> f; { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); f = _incomingConnectionFactories; } for_each(f.begin(), f.end(), Ice::voidMemFun(&IncomingConnectionFactory::flushBatchRequests)); @@ -569,7 +569,7 @@ Ice::ObjectAdapter::flushBatchRequests() void Ice::ObjectAdapter::incDirectCount() { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); checkForDeactivation(); @@ -580,7 +580,7 @@ Ice::ObjectAdapter::incDirectCount() void Ice::ObjectAdapter::decDirectCount() { - Ice::Monitor<Ice::RecMutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); // Not check for deactivation here! diff --git a/cppe/src/IceE/ObjectAdapterFactory.cpp b/cppe/src/IceE/ObjectAdapterFactory.cpp index c42b620657e..033e5ec5192 100644 --- a/cppe/src/IceE/ObjectAdapterFactory.cpp +++ b/cppe/src/IceE/ObjectAdapterFactory.cpp @@ -25,7 +25,7 @@ IceInternal::ObjectAdapterFactory::shutdown() map<string, ObjectAdapterPtr> adapters; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // Ignore shutdown requests if the object adapter factory has @@ -61,7 +61,7 @@ void IceInternal::ObjectAdapterFactory::waitForShutdown() { { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // First we wait for the shutdown of the factory itself. @@ -98,7 +98,7 @@ IceInternal::ObjectAdapterFactory::waitForShutdown() _adapters.clear(); { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // Signal that waiting is complete. @@ -111,7 +111,7 @@ IceInternal::ObjectAdapterFactory::waitForShutdown() ObjectAdapterPtr IceInternal::ObjectAdapterFactory::createObjectAdapter(const string& name) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(!_instance) { @@ -132,7 +132,7 @@ IceInternal::ObjectAdapterFactory::createObjectAdapter(const string& name) ObjectAdapterPtr IceInternal::ObjectAdapterFactory::findObjectAdapter(const ObjectPrx& proxy) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(!_instance) { @@ -174,7 +174,7 @@ IceInternal::ObjectAdapterFactory::flushBatchRequests() const { list<ObjectAdapterPtr> a; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); for(map<string, ObjectAdapterPtr>::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p) { diff --git a/cppe/src/IceE/ObjectAdapterFactory.h b/cppe/src/IceE/ObjectAdapterFactory.h index 5407f97d8ca..8573bea9e31 100644 --- a/cppe/src/IceE/ObjectAdapterFactory.h +++ b/cppe/src/IceE/ObjectAdapterFactory.h @@ -22,7 +22,7 @@ namespace IceInternal { -class ObjectAdapterFactory : public ::Ice::Shared, public ::Ice::Monitor< ::Ice::Mutex> +class ObjectAdapterFactory : public ::IceUtil::Shared, public ::IceUtil::Monitor< ::IceUtil::Mutex> { public: diff --git a/cppe/src/IceE/Outgoing.cpp b/cppe/src/IceE/Outgoing.cpp index fadd564fd90..257f556a0c0 100644 --- a/cppe/src/IceE/Outgoing.cpp +++ b/cppe/src/IceE/Outgoing.cpp @@ -125,7 +125,7 @@ IceInternal::Outgoing::invoke() bool timedOut = false; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // It's possible that the request has already @@ -143,7 +143,7 @@ IceInternal::Outgoing::invoke() { if(timeout >= 0) { - timedWait(Ice::Time::milliSeconds(timeout)); + timedWait(IceUtil::Time::milliSeconds(timeout)); if(_state == StateInProgress) { @@ -170,7 +170,7 @@ IceInternal::Outgoing::invoke() // propagated to this Outgoing object. // { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); while(_state == StateInProgress) { @@ -278,7 +278,7 @@ IceInternal::Outgoing::abort(const LocalException& ex) void IceInternal::Outgoing::finished(BasicStream& is) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_reference->getMode() == Reference::ModeTwoway); // Can only be called for twoways. @@ -444,7 +444,7 @@ IceInternal::Outgoing::finished(BasicStream& is) void IceInternal::Outgoing::finished(const LocalException& ex) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); assert(_reference->getMode() == Reference::ModeTwoway); // Can only be called for twoways. diff --git a/cppe/src/IceE/OutgoingConnectionFactory.cpp b/cppe/src/IceE/OutgoingConnectionFactory.cpp index e6ebcbfe69c..fea82eba346 100755 --- a/cppe/src/IceE/OutgoingConnectionFactory.cpp +++ b/cppe/src/IceE/OutgoingConnectionFactory.cpp @@ -33,7 +33,7 @@ void IceInternal::decRef(OutgoingConnectionFactory* p) { p->__decRef(); } void IceInternal::OutgoingConnectionFactory::destroy() { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(_destroyed) { @@ -61,7 +61,7 @@ IceInternal::OutgoingConnectionFactory::waitUntilFinished() multimap<EndpointPtr, ConnectionPtr> connections; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // First we wait until the factory is destroyed. We also wait @@ -91,7 +91,7 @@ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpts vector<EndpointPtr> endpoints = endpts; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(_destroyed) { @@ -294,7 +294,7 @@ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpts } { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); // // Signal other threads that we are done with trying to @@ -333,7 +333,7 @@ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpts void IceInternal::OutgoingConnectionFactory::setRouter(const RouterPrx& router) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(_destroyed) { @@ -395,7 +395,7 @@ IceInternal::OutgoingConnectionFactory::flushBatchRequests() list<ConnectionPtr> c; { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); for(std::multimap<EndpointPtr, ConnectionPtr>::const_iterator p = _connections.begin(); p != _connections.end(); @@ -436,7 +436,7 @@ IceInternal::OutgoingConnectionFactory::~OutgoingConnectionFactory() void IceInternal::OutgoingConnectionFactory::removeAdapter(const ObjectAdapterPtr& adapter) { - Ice::Monitor<Ice::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(_destroyed) { diff --git a/cppe/src/IceE/OutgoingConnectionFactory.h b/cppe/src/IceE/OutgoingConnectionFactory.h index 022a0180e5a..b3170b9a795 100755 --- a/cppe/src/IceE/OutgoingConnectionFactory.h +++ b/cppe/src/IceE/OutgoingConnectionFactory.h @@ -25,7 +25,7 @@ namespace IceInternal { -class OutgoingConnectionFactory : public Ice::Shared, public Ice::Monitor<Ice::Mutex> +class OutgoingConnectionFactory : public IceUtil::Shared, public IceUtil::Monitor<IceUtil::Mutex> { public: diff --git a/cppe/src/IceE/Properties.cpp b/cppe/src/IceE/Properties.cpp index 3f8acf1502e..d7f70c384c6 100644 --- a/cppe/src/IceE/Properties.cpp +++ b/cppe/src/IceE/Properties.cpp @@ -32,7 +32,7 @@ IceInternal::decRef(::Ice::Properties* p) string Ice::Properties::getProperty(const string& key) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<string, string>::const_iterator p = _properties.find(key); if(p != _properties.end()) @@ -48,7 +48,7 @@ Ice::Properties::getProperty(const string& key) string Ice::Properties::getPropertyWithDefault(const string& key, const string& value) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<string, string>::const_iterator p = _properties.find(key); if(p != _properties.end()) @@ -70,7 +70,7 @@ Ice::Properties::getPropertyAsInt(const string& key) Int Ice::Properties::getPropertyAsIntWithDefault(const string& key, Int value) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<string, string>::const_iterator p = _properties.find(key); if(p != _properties.end()) @@ -84,7 +84,7 @@ Ice::Properties::getPropertyAsIntWithDefault(const string& key, Int value) PropertyDict Ice::Properties::getPropertiesForPrefix(const string& prefix) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); PropertyDict result; map<string, string>::const_iterator p; @@ -130,7 +130,7 @@ Ice::Properties::setProperty(const string& key, const string& value) bool found = false; for(const char* const* j = *i; *j != 0 && !found; ++j) { - found = Ice::match(key, *j); + found = IceUtil::match(key, *j); } if(!found) { @@ -139,7 +139,7 @@ Ice::Properties::setProperty(const string& key, const string& value) } } - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); // // Set or clear the property. @@ -157,7 +157,7 @@ Ice::Properties::setProperty(const string& key, const string& value) StringSeq Ice::Properties::getCommandLineOptions() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); StringSeq result; result.reserve(_properties.size()); @@ -230,7 +230,7 @@ Ice::Properties::load(const std::string& file) PropertiesPtr Ice::Properties::clone() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); return new Properties(this); } diff --git a/cppe/src/IceE/Proxy.cpp b/cppe/src/IceE/Proxy.cpp index 8bca4ad0848..e972b00ccdb 100644 --- a/cppe/src/IceE/Proxy.cpp +++ b/cppe/src/IceE/Proxy.cpp @@ -558,7 +558,7 @@ IceProxy::Ice::Object::__copyFrom(const ObjectPrx& from) ::IceInternal::Handle< ::IceDelegate::Ice::Object> delegate; { - ::Ice::Mutex::Lock sync(*from.get()); + ::IceUtil::Mutex::Lock sync(*from.get()); ref = from->_reference; delegate = dynamic_cast< ::IceDelegate::Ice::Object*>(from->_delegate.get()); @@ -588,7 +588,7 @@ IceProxy::Ice::Object::__handleException(const LocalException& ex, int& cnt) // Only _delegate needs to be mutex protected here. // { - ::Ice::Mutex::Lock sync(*this); + ::IceUtil::Mutex::Lock sync(*this); _delegate = 0; } @@ -613,7 +613,7 @@ IceProxy::Ice::Object::__rethrowException(const LocalException& ex) // Only _delegate needs to be mutex protected here. // { - ::Ice::Mutex::Lock sync(*this); + ::IceUtil::Mutex::Lock sync(*this); _delegate = 0; } @@ -639,7 +639,7 @@ IceProxy::Ice::Object::__checkTwowayOnly(const char* name) const ::IceInternal::Handle< ::IceDelegate::Ice::Object> IceProxy::Ice::Object::__getDelegate() { - ::Ice::Mutex::Lock sync(*this); + ::IceUtil::Mutex::Lock sync(*this); if(!_delegate) { diff --git a/cppe/src/IceE/ProxyFactory.cpp b/cppe/src/IceE/ProxyFactory.cpp index c8280586099..8d47970de78 100644 --- a/cppe/src/IceE/ProxyFactory.cpp +++ b/cppe/src/IceE/ProxyFactory.cpp @@ -151,7 +151,7 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co // // Sleep before retrying. // - Ice::ThreadControl::sleep(Ice::Time::milliSeconds(_retryIntervals[cnt - 1])); + IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(_retryIntervals[cnt - 1])); } } else diff --git a/cppe/src/IceE/ProxyFactory.h b/cppe/src/IceE/ProxyFactory.h index 6e1a1d3c95a..ba252ba2c98 100644 --- a/cppe/src/IceE/ProxyFactory.h +++ b/cppe/src/IceE/ProxyFactory.h @@ -22,7 +22,7 @@ namespace IceInternal class BasicStream; -class ProxyFactory : public Ice::Shared +class ProxyFactory : public IceUtil::Shared { public: diff --git a/cppe/src/IceE/RWRecMutex.cpp b/cppe/src/IceE/RWRecMutex.cpp index 2b08c424158..6bc9782b1c4 100644 --- a/cppe/src/IceE/RWRecMutex.cpp +++ b/cppe/src/IceE/RWRecMutex.cpp @@ -12,19 +12,19 @@ #include <IceE/Time.h> -Ice::RWRecMutex::RWRecMutex() : +IceUtil::RWRecMutex::RWRecMutex() : _count(0), _writerId(0), _waitingWriters(0) { } -Ice::RWRecMutex::~RWRecMutex() +IceUtil::RWRecMutex::~RWRecMutex() { } void -Ice::RWRecMutex::readLock() const +IceUtil::RWRecMutex::readLock() const { Mutex::Lock lock(_mutex); @@ -40,7 +40,7 @@ Ice::RWRecMutex::readLock() const } bool -Ice::RWRecMutex::tryReadLock() const +IceUtil::RWRecMutex::tryReadLock() const { Mutex::Lock lock(_mutex); @@ -57,7 +57,7 @@ Ice::RWRecMutex::tryReadLock() const } bool -Ice::RWRecMutex::timedReadLock(const Time& timeout) const +IceUtil::RWRecMutex::timedReadLock(const Time& timeout) const { Mutex::Lock lock(_mutex); @@ -87,7 +87,7 @@ Ice::RWRecMutex::timedReadLock(const Time& timeout) const } void -Ice::RWRecMutex::writeLock() const +IceUtil::RWRecMutex::writeLock() const { Mutex::Lock lock(_mutex); @@ -128,7 +128,7 @@ Ice::RWRecMutex::writeLock() const } bool -Ice::RWRecMutex::tryWriteLock() const +IceUtil::RWRecMutex::tryWriteLock() const { Mutex::Lock lock(_mutex); @@ -159,7 +159,7 @@ Ice::RWRecMutex::tryWriteLock() const } bool -Ice::RWRecMutex::timedWriteLock(const Time& timeout) const +IceUtil::RWRecMutex::timedWriteLock(const Time& timeout) const { Mutex::Lock lock(_mutex); @@ -213,7 +213,7 @@ Ice::RWRecMutex::timedWriteLock(const Time& timeout) const } void -Ice::RWRecMutex::unlock() const +IceUtil::RWRecMutex::unlock() const { bool ww; bool wr; @@ -282,7 +282,7 @@ Ice::RWRecMutex::unlock() const } void -Ice::RWRecMutex::upgrade() const +IceUtil::RWRecMutex::upgrade() const { Mutex::Lock lock(_mutex); @@ -318,7 +318,7 @@ Ice::RWRecMutex::upgrade() const } bool -Ice::RWRecMutex::timedUpgrade(const Time& timeout) const +IceUtil::RWRecMutex::timedUpgrade(const Time& timeout) const { Mutex::Lock lock(_mutex); diff --git a/cppe/src/IceE/RecMutex.cpp b/cppe/src/IceE/RecMutex.cpp index 0ce7f11c43e..7575a1ce6e4 100644 --- a/cppe/src/IceE/RecMutex.cpp +++ b/cppe/src/IceE/RecMutex.cpp @@ -16,20 +16,20 @@ using namespace std; # if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0400 -Ice::RecMutex::RecMutex() : +IceUtil::RecMutex::RecMutex() : _count(0) { InitializeCriticalSection(&_mutex); } -Ice::RecMutex::~RecMutex() +IceUtil::RecMutex::~RecMutex() { assert(_count == 0); DeleteCriticalSection(&_mutex); } void -Ice::RecMutex::lock() const +IceUtil::RecMutex::lock() const { EnterCriticalSection(&_mutex); if(++_count > 1) @@ -39,7 +39,7 @@ Ice::RecMutex::lock() const } bool -Ice::RecMutex::tryLock() const +IceUtil::RecMutex::tryLock() const { if(!TryEnterCriticalSection(&_mutex)) { @@ -53,7 +53,7 @@ Ice::RecMutex::tryLock() const } void -Ice::RecMutex::unlock() const +IceUtil::RecMutex::unlock() const { if(--_count == 0) { @@ -62,7 +62,7 @@ Ice::RecMutex::unlock() const } void -Ice::RecMutex::unlock(LockState& state) const +IceUtil::RecMutex::unlock(LockState& state) const { state.count = _count; _count = 0; @@ -70,7 +70,7 @@ Ice::RecMutex::unlock(LockState& state) const } void -Ice::RecMutex::lock(LockState& state) const +IceUtil::RecMutex::lock(LockState& state) const { EnterCriticalSection(&_mutex); _count = state.count; @@ -78,7 +78,7 @@ Ice::RecMutex::lock(LockState& state) const # else -Ice::RecMutex::RecMutex() : +IceUtil::RecMutex::RecMutex() : _count(0) { _mutex = CreateMutex(0, false, 0); @@ -88,7 +88,7 @@ Ice::RecMutex::RecMutex() : } } -Ice::RecMutex::~RecMutex() +IceUtil::RecMutex::~RecMutex() { assert(_count == 0); BOOL rc = CloseHandle(_mutex); @@ -99,7 +99,7 @@ Ice::RecMutex::~RecMutex() } void -Ice::RecMutex::lock() const +IceUtil::RecMutex::lock() const { DWORD rc = WaitForSingleObject(_mutex, INFINITE); if(rc != WAIT_OBJECT_0) @@ -125,7 +125,7 @@ Ice::RecMutex::lock() const } bool -Ice::RecMutex::tryLock() const +IceUtil::RecMutex::tryLock() const { DWORD rc = WaitForSingleObject(_mutex, 0); if(rc != WAIT_OBJECT_0) @@ -144,7 +144,7 @@ Ice::RecMutex::tryLock() const } void -Ice::RecMutex::unlock() const +IceUtil::RecMutex::unlock() const { if(--_count == 0) { @@ -157,7 +157,7 @@ Ice::RecMutex::unlock() const } void -Ice::RecMutex::unlock(LockState& state) const +IceUtil::RecMutex::unlock(LockState& state) const { state.count = _count; _count = 0; @@ -169,7 +169,7 @@ Ice::RecMutex::unlock(LockState& state) const } void -Ice::RecMutex::lock(LockState& state) const +IceUtil::RecMutex::lock(LockState& state) const { DWORD rc = WaitForSingleObject(_mutex, INFINITE); if(rc != WAIT_OBJECT_0) @@ -191,7 +191,7 @@ Ice::RecMutex::lock(LockState& state) const #else -Ice::RecMutex::RecMutex() : +IceUtil::RecMutex::RecMutex() : _count(0) { int rc; @@ -229,7 +229,7 @@ Ice::RecMutex::RecMutex() : #endif } -Ice::RecMutex::~RecMutex() +IceUtil::RecMutex::~RecMutex() { assert(_count == 0); int rc = 0; @@ -238,7 +238,7 @@ Ice::RecMutex::~RecMutex() } void -Ice::RecMutex::lock() const +IceUtil::RecMutex::lock() const { int rc = pthread_mutex_lock(&_mutex); if(rc != 0) @@ -253,7 +253,7 @@ Ice::RecMutex::lock() const } bool -Ice::RecMutex::tryLock() const +IceUtil::RecMutex::tryLock() const { int rc = pthread_mutex_trylock(&_mutex); bool result = (rc == 0); @@ -276,7 +276,7 @@ Ice::RecMutex::tryLock() const } void -Ice::RecMutex::unlock() const +IceUtil::RecMutex::unlock() const { if(--_count == 0) { @@ -287,7 +287,7 @@ Ice::RecMutex::unlock() const } void -Ice::RecMutex::unlock(LockState& state) const +IceUtil::RecMutex::unlock(LockState& state) const { state.mutex = &_mutex; state.count = _count; @@ -295,7 +295,7 @@ Ice::RecMutex::unlock(LockState& state) const } void -Ice::RecMutex::lock(LockState& state) const +IceUtil::RecMutex::lock(LockState& state) const { _count = state.count; } @@ -303,7 +303,7 @@ Ice::RecMutex::lock(LockState& state) const #endif bool -Ice::RecMutex::willUnlock() const +IceUtil::RecMutex::willUnlock() const { return _count == 1; } diff --git a/cppe/src/IceE/Reference.cpp b/cppe/src/IceE/Reference.cpp index 3444bb0acc3..96b263ca004 100644 --- a/cppe/src/IceE/Reference.cpp +++ b/cppe/src/IceE/Reference.cpp @@ -118,7 +118,7 @@ IceInternal::Reference::changeDefault() const Int Reference::hash() const { - Ice::Mutex::Lock sync(_hashMutex); + IceUtil::Mutex::Lock sync(_hashMutex); if(_hashInitialized) { @@ -226,7 +226,7 @@ IceInternal::Reference::toString() const // the reference parser uses as separators, then we enclose // the facet string in quotes. // - string fs = Ice::escapeString(_facet, ""); + string fs = IceUtil::escapeString(_facet, ""); if(fs.find_first_of(" \t\n\r:@") != string::npos) { s += "\""; diff --git a/cppe/src/IceE/Reference.h b/cppe/src/IceE/Reference.h index cdda94fcb4c..7308f6ccb7b 100644 --- a/cppe/src/IceE/Reference.h +++ b/cppe/src/IceE/Reference.h @@ -31,7 +31,7 @@ namespace IceInternal class BasicStream; -class Reference : public Ice::Shared +class Reference : public IceUtil::Shared { public: @@ -117,7 +117,7 @@ private: Ice::Context _context; std::string _facet; - Ice::Mutex _hashMutex; // For lazy initialization of hash value. + IceUtil::Mutex _hashMutex; // For lazy initialization of hash value. mutable Ice::Int _hashValue; mutable bool _hashInitialized; }; diff --git a/cppe/src/IceE/ReferenceFactory.cpp b/cppe/src/IceE/ReferenceFactory.cpp index 7a4def68b71..9cac8af81c6 100644 --- a/cppe/src/IceE/ReferenceFactory.cpp +++ b/cppe/src/IceE/ReferenceFactory.cpp @@ -171,7 +171,7 @@ IceInternal::ReferenceFactory::create(const string& str) // or double quotation marks. // string idstr; - end = Ice::checkQuote(s, beg); + end = IceUtil::checkQuote(s, beg); if(end == string::npos) { ProxyParseException ex(__FILE__, __LINE__); @@ -284,7 +284,7 @@ IceInternal::ReferenceFactory::create(const string& str) if(s[argumentBeg] != '@' && s[argumentBeg] != ':' && s[argumentBeg] != '-') { beg = argumentBeg; - end = Ice::checkQuote(s, beg); + end = IceUtil::checkQuote(s, beg); if(end == string::npos) { ProxyParseException ex(__FILE__, __LINE__); @@ -324,7 +324,7 @@ IceInternal::ReferenceFactory::create(const string& str) throw ex; } - if(!Ice::unescapeString(argument, 0, argument.size(), facet)) + if(!IceUtil::unescapeString(argument, 0, argument.size(), facet)) { ProxyParseException ex(__FILE__, __LINE__); ex.str = str; @@ -599,14 +599,14 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s) void IceInternal::ReferenceFactory::setDefaultRouter(const RouterPrx& defaultRouter) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _defaultRouter = defaultRouter; } RouterPrx IceInternal::ReferenceFactory::getDefaultRouter() const { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); return _defaultRouter; } @@ -617,14 +617,14 @@ IceInternal::ReferenceFactory::getDefaultRouter() const void IceInternal::ReferenceFactory::setDefaultLocator(const LocatorPrx& defaultLocator) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _defaultLocator = defaultLocator; } LocatorPrx IceInternal::ReferenceFactory::getDefaultLocator() const { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); return _defaultLocator; } diff --git a/cppe/src/IceE/ReferenceFactory.h b/cppe/src/IceE/ReferenceFactory.h index ee1ea1535c2..af242aaa972 100644 --- a/cppe/src/IceE/ReferenceFactory.h +++ b/cppe/src/IceE/ReferenceFactory.h @@ -19,7 +19,7 @@ namespace IceInternal { -class ReferenceFactory : public ::Ice::Shared, public ::Ice::Mutex +class ReferenceFactory : public ::IceUtil::Shared, public ::IceUtil::Mutex { public: diff --git a/cppe/src/IceE/RouterInfo.cpp b/cppe/src/IceE/RouterInfo.cpp index a738e75b905..1226bddb79c 100644 --- a/cppe/src/IceE/RouterInfo.cpp +++ b/cppe/src/IceE/RouterInfo.cpp @@ -36,7 +36,7 @@ IceInternal::RouterManager::RouterManager() : void IceInternal::RouterManager::destroy() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); for_each(_table.begin(), _table.end(), Ice::secondVoidMemFun<const RouterPrx, RouterInfo>(&RouterInfo::destroy)); @@ -54,7 +54,7 @@ IceInternal::RouterManager::get(const RouterPrx& rtr) RouterPrx router = RouterPrx::uncheckedCast(rtr->ice_router(0)); // The router cannot be routed. - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<RouterPrx, RouterInfoPtr>::iterator p = _table.end(); @@ -93,7 +93,7 @@ IceInternal::RouterInfo::RouterInfo(const RouterPrx& router) : void IceInternal::RouterInfo::destroy() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _clientProxy = 0; _serverProxy = 0; @@ -131,7 +131,7 @@ IceInternal::RouterInfo::getRouter() const ObjectPrx IceInternal::RouterInfo::getClientProxy() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); if(!_clientProxy) // Lazy initialization. { @@ -157,7 +157,7 @@ IceInternal::RouterInfo::getClientProxy() void IceInternal::RouterInfo::setClientProxy(const ObjectPrx& clientProxy) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _clientProxy = clientProxy->ice_router(0); // The client proxy cannot be routed. @@ -171,7 +171,7 @@ IceInternal::RouterInfo::setClientProxy(const ObjectPrx& clientProxy) ObjectPrx IceInternal::RouterInfo::getServerProxy() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); if(!_serverProxy) // Lazy initialization. { @@ -190,7 +190,7 @@ IceInternal::RouterInfo::getServerProxy() void IceInternal::RouterInfo::setServerProxy(const ObjectPrx& serverProxy) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _serverProxy = serverProxy->ice_router(0); // The server proxy cannot be routed. } @@ -211,14 +211,14 @@ IceInternal::RouterInfo::addProxy(const ObjectPrx& proxy) void IceInternal::RouterInfo::setAdapter(const ObjectAdapterPtr& adapter) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _adapter = adapter; } ObjectAdapterPtr IceInternal::RouterInfo::getAdapter() const { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); return _adapter; } diff --git a/cppe/src/IceE/RouterInfo.h b/cppe/src/IceE/RouterInfo.h index d646363d59f..cff07a02984 100644 --- a/cppe/src/IceE/RouterInfo.h +++ b/cppe/src/IceE/RouterInfo.h @@ -23,7 +23,7 @@ namespace IceInternal { -class RouterManager : public Ice::Shared, public Ice::Mutex +class RouterManager : public IceUtil::Shared, public IceUtil::Mutex { public: @@ -43,7 +43,7 @@ private: std::map<Ice::RouterPrx, RouterInfoPtr>::iterator _tableHint; }; -class RouterInfo : public Ice::Shared, public Ice::Mutex +class RouterInfo : public IceUtil::Shared, public IceUtil::Mutex { public: diff --git a/cppe/src/IceE/RoutingTable.cpp b/cppe/src/IceE/RoutingTable.cpp index c63a646ceab..2f7c4d91889 100644 --- a/cppe/src/IceE/RoutingTable.cpp +++ b/cppe/src/IceE/RoutingTable.cpp @@ -29,7 +29,7 @@ IceInternal::RoutingTable::RoutingTable() : void IceInternal::RoutingTable::clear() { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); _table.clear(); _tableHint = _table.end(); @@ -45,7 +45,7 @@ IceInternal::RoutingTable::add(const ObjectPrx& prx) ObjectPrx proxy = prx->ice_default(); // We insert the proxy in its default form into the routing table. - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<Identity, ObjectPrx>::iterator p = _table.end(); @@ -81,7 +81,7 @@ IceInternal::RoutingTable::get(const Identity& ident) return 0; } - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); map<Identity, ObjectPrx>::iterator p = _table.end(); diff --git a/cppe/src/IceE/ServantManager.cpp b/cppe/src/IceE/ServantManager.cpp index 739ad8d5fc0..2e3b53b0ff8 100644 --- a/cppe/src/IceE/ServantManager.cpp +++ b/cppe/src/IceE/ServantManager.cpp @@ -23,7 +23,7 @@ void IceInternal::decRef(ServantManager* p) { p->__decRef(); } void IceInternal::ServantManager::addServant(const ObjectPtr& object, const Identity& ident, const string& facet) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); assert(_instance); // Must not be called after destruction. @@ -47,7 +47,7 @@ IceInternal::ServantManager::addServant(const ObjectPtr& object, const Identity& ex.id = identityToString(ident); if(!facet.empty()) { - ex.id += " -f " + Ice::escapeString(facet, ""); + ex.id += " -f " + IceUtil::escapeString(facet, ""); } throw ex; } @@ -68,7 +68,7 @@ IceInternal::ServantManager::removeServant(const Identity& ident, const string& // ObjectPtr servant = 0; - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); assert(_instance); // Must not be called after destruction. @@ -87,7 +87,7 @@ IceInternal::ServantManager::removeServant(const Identity& ident, const string& ex.id = identityToString(ident); if(!facet.empty()) { - ex.id += " -f " + Ice::escapeString(facet, ""); + ex.id += " -f " + IceUtil::escapeString(facet, ""); } throw ex; } @@ -113,7 +113,7 @@ IceInternal::ServantManager::removeServant(const Identity& ident, const string& FacetMap IceInternal::ServantManager::removeAllFacets(const Identity& ident) { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); assert(_instance); // Must not be called after destruction. @@ -150,7 +150,7 @@ IceInternal::ServantManager::removeAllFacets(const Identity& ident) ObjectPtr IceInternal::ServantManager::findServant(const Identity& ident, const string& facet) const { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); assert(_instance); // Must not be called after destruction. @@ -178,7 +178,7 @@ IceInternal::ServantManager::findServant(const Identity& ident, const string& fa FacetMap IceInternal::ServantManager::findAllFacets(const Identity& ident) const { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); assert(_instance); // Must not be called after destruction. @@ -205,7 +205,7 @@ IceInternal::ServantManager::findAllFacets(const Identity& ident) const bool IceInternal::ServantManager::hasServant(const Identity& ident) const { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); assert(_instance); // Must not be called after destruction. @@ -252,7 +252,7 @@ IceInternal::ServantManager::destroy() ServantMapMap servantMapMap; { - Ice::Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); assert(_instance); // Must not be called after destruction. diff --git a/cppe/src/IceE/ServantManager.h b/cppe/src/IceE/ServantManager.h index 63cf71e935e..0c5a42dae6a 100644 --- a/cppe/src/IceE/ServantManager.h +++ b/cppe/src/IceE/ServantManager.h @@ -20,7 +20,7 @@ namespace IceInternal { -class ServantManager : public Ice::Shared, public Ice::Mutex +class ServantManager : public IceUtil::Shared, public IceUtil::Mutex { public: diff --git a/cppe/src/IceE/Shared.cpp b/cppe/src/IceE/Shared.cpp index 48a2de9c62c..f040bc756f9 100644 --- a/cppe/src/IceE/Shared.cpp +++ b/cppe/src/IceE/Shared.cpp @@ -11,19 +11,19 @@ using namespace Ice;
-Ice::SimpleShared::SimpleShared() :
+IceUtil::SimpleShared::SimpleShared() :
_ref(0),
_noDelete(false)
{
}
-Ice::SimpleShared::SimpleShared(const SimpleShared&) :
+IceUtil::SimpleShared::SimpleShared(const SimpleShared&) :
_ref(0),
_noDelete(false)
{
}
-Ice::Shared::Shared() :
+IceUtil::Shared::Shared() :
#ifndef ICEE_HAS_ATOMIC_FUNCTIONS
_ref(0),
#endif
@@ -34,7 +34,7 @@ Ice::Shared::Shared() : #endif
}
-Ice::Shared::Shared(const Shared&) :
+IceUtil::Shared::Shared(const Shared&) :
#ifndef ICEE_HAS_ATOMIC_FUNCTIONS
_ref(0),
#endif
@@ -46,7 +46,7 @@ Ice::Shared::Shared(const Shared&) : }
int
-Ice::Shared::__getRef() const
+IceUtil::Shared::__getRef() const
{
#if defined(_WIN32)
return InterlockedExchangeAdd(const_cast<LONG*>(&_ref), 0);
@@ -61,7 +61,7 @@ Ice::Shared::__getRef() const }
void
-Ice::Shared::__setNoDelete(bool b)
+IceUtil::Shared::__setNoDelete(bool b)
{
_noDelete = b;
}
diff --git a/cppe/src/IceE/StaticMutex.cpp b/cppe/src/IceE/StaticMutex.cpp index 49be7cf91f1..e4c57f54f9a 100644 --- a/cppe/src/IceE/StaticMutex.cpp +++ b/cppe/src/IceE/StaticMutex.cpp @@ -10,7 +10,7 @@ #include <IceE/StaticMutex.h> #ifdef _WIN32 -void Ice::StaticMutex::initialize() const +void IceUtil::StaticMutex::initialize() const { // // First we create the new critical section @@ -39,4 +39,4 @@ void Ice::StaticMutex::initialize() const } #endif -Ice::StaticMutex Ice::globalMutex = ICEE_STATIC_MUTEX_INITIALIZER; +IceUtil::StaticMutex IceUtil::globalMutex = ICEE_STATIC_MUTEX_INITIALIZER; diff --git a/cppe/src/IceE/StringUtil.cpp b/cppe/src/IceE/StringUtil.cpp index 82582590066..26ba08c66ec 100644 --- a/cppe/src/IceE/StringUtil.cpp +++ b/cppe/src/IceE/StringUtil.cpp @@ -109,7 +109,7 @@ escapeChar(string::value_type b, string& s, const string& special) } string -Ice::escapeString(const string& s, const string& special) +IceUtil::escapeString(const string& s, const string& special) { string result; result.reserve(s.size()); @@ -123,7 +123,7 @@ Ice::escapeString(const string& s, const string& special) } bool -Ice::unescapeString(const string& s, string::size_type start, string::size_type end, string& result) +IceUtil::unescapeString(const string& s, string::size_type start, string::size_type end, string& result) { assert(end <= s.size()); assert(start <= end); @@ -236,7 +236,7 @@ Ice::unescapeString(const string& s, string::size_type start, string::size_type // If no matching closing quote is found, then -1 is returned. // string::size_type -Ice::checkQuote(const string& s, string::size_type start) +IceUtil::checkQuote(const string& s, string::size_type start) { string::value_type quoteChar = s[start]; if(quoteChar == '"' || quoteChar == '\'') @@ -263,7 +263,7 @@ Ice::checkQuote(const string& s, string::size_type start) // it's portable across platforms (whereas regex() isn't). // bool -Ice::match(const string& s, const string& pat, bool matchPeriod) +IceUtil::match(const string& s, const string& pat, bool matchPeriod) { assert(!s.empty()); assert(!pat.empty()); diff --git a/cppe/src/IceE/Thread.cpp b/cppe/src/IceE/Thread.cpp index f1033a1755d..e6af12c1e26 100644 --- a/cppe/src/IceE/Thread.cpp +++ b/cppe/src/IceE/Thread.cpp @@ -17,47 +17,47 @@ using namespace std; #ifdef _WIN32 -Ice::ThreadControl::ThreadControl() +IceUtil::ThreadControl::ThreadControl() { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _handle = new HandleWrapper(GetCurrentThread(), false); _id = GetCurrentThreadId(); } -Ice::ThreadControl::ThreadControl(const HandleWrapperPtr& handle, ThreadId id) +IceUtil::ThreadControl::ThreadControl(const HandleWrapperPtr& handle, ThreadId id) { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _handle = handle; _id = id; } -Ice::ThreadControl::ThreadControl(const ThreadControl& tc) +IceUtil::ThreadControl::ThreadControl(const ThreadControl& tc) { ThreadId id; HandleWrapperPtr handle; { - Ice::Mutex::Lock lock(tc._stateMutex); + IceUtil::Mutex::Lock lock(tc._stateMutex); id = tc._id; handle = tc._handle; } - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _handle = handle; _id = id; } -Ice::ThreadControl& -Ice::ThreadControl::operator=(const ThreadControl& rhs) +IceUtil::ThreadControl& +IceUtil::ThreadControl::operator=(const ThreadControl& rhs) { if(&rhs != this) { ThreadId id; HandleWrapperPtr handle; { - Ice::Mutex::Lock lock(rhs._stateMutex); + IceUtil::Mutex::Lock lock(rhs._stateMutex); handle = rhs._handle; id = rhs._id; } - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _handle = handle; _id = id; } @@ -65,40 +65,40 @@ Ice::ThreadControl::operator=(const ThreadControl& rhs) } bool -Ice::ThreadControl::operator==(const ThreadControl& rhs) const +IceUtil::ThreadControl::operator==(const ThreadControl& rhs) const { ThreadId id = rhs.id(); - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); return _id == id; } bool -Ice::ThreadControl::operator!=(const ThreadControl& rhs) const +IceUtil::ThreadControl::operator!=(const ThreadControl& rhs) const { return !operator==(rhs); } bool -Ice::ThreadControl::operator<(const ThreadControl& rhs) const +IceUtil::ThreadControl::operator<(const ThreadControl& rhs) const { ThreadId id = rhs.id(); - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); return _id < id; } -Ice::ThreadId -Ice::ThreadControl::id() const +IceUtil::ThreadId +IceUtil::ThreadControl::id() const { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); return _id; } void -Ice::ThreadControl::join() +IceUtil::ThreadControl::join() { HandleWrapperPtr handle; { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); handle = _handle; } int rc = WaitForSingleObject(handle->handle, INFINITE); @@ -109,17 +109,17 @@ Ice::ThreadControl::join() } void -Ice::ThreadControl::detach() +IceUtil::ThreadControl::detach() { // No-op: Windows doesn't have the concept of detaching a thread. } bool -Ice::ThreadControl::isAlive() const +IceUtil::ThreadControl::isAlive() const { HandleWrapperPtr handle; { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); handle = _handle; } DWORD rc; @@ -131,14 +131,14 @@ Ice::ThreadControl::isAlive() const } void -Ice::ThreadControl::sleep(const Time& timeout) +IceUtil::ThreadControl::sleep(const Time& timeout) { long msec = (long)timeout.toMilliSeconds(); Sleep(msec); } void -Ice::ThreadControl::yield() +IceUtil::ThreadControl::yield() { // // A value of zero causes the thread to relinquish the remainder @@ -148,22 +148,22 @@ Ice::ThreadControl::yield() Sleep(0); } -Ice::Thread::Thread() +IceUtil::Thread::Thread() { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _started = false; _id = 0; _handle = new HandleWrapper(0); } -Ice::Thread::~Thread() +IceUtil::Thread::~Thread() { } -Ice::ThreadId -Ice::Thread::id() const +IceUtil::ThreadId +IceUtil::Thread::id() const { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(!_started) { throw ThreadNotStartedException(__FILE__, __LINE__); @@ -176,29 +176,29 @@ startHook(void* arg) { try { - Ice::Thread* rawThread = static_cast<Ice::Thread*>(arg); + IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg); // // Initialize the random number generator in each thread. // - unsigned int seed = static_cast<unsigned int>(Ice::Time::now().toMicroSeconds()); + 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. // - Ice::ThreadPtr thread = rawThread; + IceUtil::ThreadPtr thread = rawThread; // - // See the comment in Ice::Thread::start() for details. + // See the comment in IceUtil::Thread::start() for details. // rawThread->__decRef(); thread->run(); } - catch(const Ice::Exception& e) + catch(const IceUtil::Exception& e) { - fprintf(stderr, "Ice::Thread::run(): uncaught exception: %s\n", e.toString()); + fprintf(stderr, "IceUtil::Thread::run(): uncaught exception: %s\n", e.toString()); } return 0; } @@ -207,15 +207,15 @@ startHook(void* arg) #include <process.h> #endif -Ice::ThreadControl -Ice::Thread::start(size_t stackSize) +IceUtil::ThreadControl +IceUtil::Thread::start(size_t stackSize) { // // Keep this alive for the duration of start // - Ice::ThreadPtr keepMe = this; + IceUtil::ThreadPtr keepMe = this; - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(_started) { @@ -251,10 +251,10 @@ Ice::Thread::start(size_t stackSize) return ThreadControl(_handle, _id); } -Ice::ThreadControl -Ice::Thread::getThreadControl() const +IceUtil::ThreadControl +IceUtil::Thread::getThreadControl() const { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(!_started) { throw ThreadNotStartedException(__FILE__, __LINE__); @@ -263,7 +263,7 @@ Ice::Thread::getThreadControl() const } bool -Ice::Thread::operator==(const Thread& rhs) const +IceUtil::Thread::operator==(const Thread& rhs) const { // // Get rhs ID. @@ -273,7 +273,7 @@ Ice::Thread::operator==(const Thread& rhs) const // // Check that this thread was started. // - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(!_started) { throw ThreadNotStartedException(__FILE__, __LINE__); @@ -287,13 +287,13 @@ Ice::Thread::operator==(const Thread& rhs) const } bool -Ice::Thread::operator!=(const Thread& rhs) const +IceUtil::Thread::operator!=(const Thread& rhs) const { return !operator==(rhs); } bool -Ice::Thread::operator<(const Thread& rhs) const +IceUtil::Thread::operator<(const Thread& rhs) const { // // Get rhs ID. @@ -303,7 +303,7 @@ Ice::Thread::operator<(const Thread& rhs) const // // Check that this thread was started. // - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(!_started) { throw ThreadNotStartedException(__FILE__, __LINE__); @@ -318,73 +318,73 @@ Ice::Thread::operator<(const Thread& rhs) const #else -Ice::ThreadControl::ThreadControl(ThreadId id) +IceUtil::ThreadControl::ThreadControl(ThreadId id) { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _id = id; } -Ice::ThreadControl::ThreadControl() +IceUtil::ThreadControl::ThreadControl() { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _id = pthread_self(); } -Ice::ThreadControl::ThreadControl(const ThreadControl& tc) +IceUtil::ThreadControl::ThreadControl(const ThreadControl& tc) { ThreadId id = tc.id(); - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _id = id; } -Ice::ThreadControl& -Ice::ThreadControl::operator=(const ThreadControl& rhs) +IceUtil::ThreadControl& +IceUtil::ThreadControl::operator=(const ThreadControl& rhs) { if(&rhs != this) { ThreadId id = rhs.id(); - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _id = id; } return *this; } bool -Ice::ThreadControl::operator==(const ThreadControl& rhs) const +IceUtil::ThreadControl::operator==(const ThreadControl& rhs) const { ThreadId id = rhs.id(); - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); return pthread_equal(_id, id); } bool -Ice::ThreadControl::operator!=(const ThreadControl& rhs) const +IceUtil::ThreadControl::operator!=(const ThreadControl& rhs) const { return !operator==(rhs); } bool -Ice::ThreadControl::operator<(const ThreadControl& rhs) const +IceUtil::ThreadControl::operator<(const ThreadControl& rhs) const { ThreadId id = rhs.id(); - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); // NOTE: Linux specific return _id < id; } -Ice::ThreadId -Ice::ThreadControl::id() const +IceUtil::ThreadId +IceUtil::ThreadControl::id() const { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); return _id; } void -Ice::ThreadControl::join() +IceUtil::ThreadControl::join() { ThreadId id; { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); id = _id; } void* ignore = 0; @@ -396,11 +396,11 @@ Ice::ThreadControl::join() } void -Ice::ThreadControl::detach() +IceUtil::ThreadControl::detach() { ThreadId id; { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); id = _id; } int rc = pthread_detach(id); @@ -411,12 +411,12 @@ Ice::ThreadControl::detach() } bool -Ice::ThreadControl::isAlive() const +IceUtil::ThreadControl::isAlive() const { int policy; int ret; struct sched_param param; - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); ret = pthread_getschedparam(_id, &policy, ¶m); #ifdef __APPLE__ @@ -429,7 +429,7 @@ Ice::ThreadControl::isAlive() const } void -Ice::ThreadControl::sleep(const Time& timeout) +IceUtil::ThreadControl::sleep(const Time& timeout) { struct timeval tv = timeout; struct timespec ts; @@ -439,26 +439,26 @@ Ice::ThreadControl::sleep(const Time& timeout) } void -Ice::ThreadControl::yield() +IceUtil::ThreadControl::yield() { sched_yield(); } -Ice::Thread::Thread() +IceUtil::Thread::Thread() { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); _started = false; _id = 0; } -Ice::Thread::~Thread() +IceUtil::Thread::~Thread() { } -Ice::ThreadId -Ice::Thread::id() const +IceUtil::ThreadId +IceUtil::Thread::id() const { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(!_started) { throw ThreadNotStartedException(__FILE__, __LINE__); @@ -472,41 +472,41 @@ startHook(void* arg) { try { - Ice::Thread* rawThread = static_cast<Ice::Thread*>(arg); + IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg); // // Ensure that the thread doesn't go away until run() has // completed. // - Ice::ThreadPtr thread = rawThread; + IceUtil::ThreadPtr thread = rawThread; // - // See the comment in Ice::Thread::start() for details. + // See the comment in IceUtil::Thread::start() for details. // rawThread->__decRef(); thread->run(); } - catch(const Ice::Exception& e) + catch(const IceUtil::Exception& e) { - //fprintf(stderr, "Ice::Thread::run(): uncaught exception: %s\n", e.toString()); + //fprintf(stderr, "IceUtil::Thread::run(): uncaught exception: %s\n", e.toString()); } catch(...) { - fprintf(stderr, "Ice::Thread::run(): uncaught exception\n"); + fprintf(stderr, "IceUtil::Thread::run(): uncaught exception\n"); } return 0; } } -Ice::ThreadControl -Ice::Thread::start(size_t stackSize) +IceUtil::ThreadControl +IceUtil::Thread::start(size_t stackSize) { // // Keep this alive for the duration of start // - Ice::ThreadPtr keepMe = this; + IceUtil::ThreadPtr keepMe = this; - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(_started) { @@ -561,10 +561,10 @@ Ice::Thread::start(size_t stackSize) return ThreadControl(_id); } -Ice::ThreadControl -Ice::Thread::getThreadControl() const +IceUtil::ThreadControl +IceUtil::Thread::getThreadControl() const { - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(!_started) { throw ThreadNotStartedException(__FILE__, __LINE__); @@ -573,7 +573,7 @@ Ice::Thread::getThreadControl() const } bool -Ice::Thread::operator==(const Thread& rhs) const +IceUtil::Thread::operator==(const Thread& rhs) const { // // Get rhs ID. @@ -583,7 +583,7 @@ Ice::Thread::operator==(const Thread& rhs) const // // Check that this thread was started. // - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(!_started) { throw ThreadNotStartedException(__FILE__, __LINE__); @@ -597,13 +597,13 @@ Ice::Thread::operator==(const Thread& rhs) const } bool -Ice::Thread::operator!=(const Thread& rhs) const +IceUtil::Thread::operator!=(const Thread& rhs) const { return !operator==(rhs); } bool -Ice::Thread::operator<(const Thread& rhs) const +IceUtil::Thread::operator<(const Thread& rhs) const { // // Get rhs ID. @@ -613,7 +613,7 @@ Ice::Thread::operator<(const Thread& rhs) const // // Check that this thread was started. // - Ice::Mutex::Lock lock(_stateMutex); + IceUtil::Mutex::Lock lock(_stateMutex); if(!_started) { throw ThreadNotStartedException(__FILE__, __LINE__); diff --git a/cppe/src/IceE/ThreadException.cpp b/cppe/src/IceE/ThreadException.cpp index e77309f463b..0193b9415ba 100644 --- a/cppe/src/IceE/ThreadException.cpp +++ b/cppe/src/IceE/ThreadException.cpp @@ -12,22 +12,22 @@ using namespace std; -Ice::ThreadSyscallException::ThreadSyscallException(const char* file, int line, int err ): +IceUtil::ThreadSyscallException::ThreadSyscallException(const char* file, int line, int err ): Exception(file, line), _error(err) { } -const char* Ice::ThreadSyscallException::_name = "Ice::ThreadSyscallException"; +const char* IceUtil::ThreadSyscallException::_name = "IceUtil::ThreadSyscallException"; const string -Ice::ThreadSyscallException::ice_name() const +IceUtil::ThreadSyscallException::ice_name() const { return _name; } string -Ice::ThreadSyscallException::toString() const +IceUtil::ThreadSyscallException::toString() const { string out = Exception::toString(); if(_error != 0) @@ -64,96 +64,96 @@ Ice::ThreadSyscallException::toString() const return out; } -Ice::Exception* -Ice::ThreadSyscallException::ice_clone() const +IceUtil::Exception* +IceUtil::ThreadSyscallException::ice_clone() const { return new ThreadSyscallException(*this); } void -Ice::ThreadSyscallException::ice_throw() const +IceUtil::ThreadSyscallException::ice_throw() const { throw *this; } int -Ice::ThreadSyscallException::error() const +IceUtil::ThreadSyscallException::error() const { return _error; } -Ice::ThreadLockedException::ThreadLockedException(const char* file, int line) : +IceUtil::ThreadLockedException::ThreadLockedException(const char* file, int line) : Exception(file, line) { } -const char* Ice::ThreadLockedException::_name = "Ice::ThreadLockedException"; +const char* IceUtil::ThreadLockedException::_name = "IceUtil::ThreadLockedException"; const string -Ice::ThreadLockedException::ice_name() const +IceUtil::ThreadLockedException::ice_name() const { return _name; } -Ice::Exception* -Ice::ThreadLockedException::ice_clone() const +IceUtil::Exception* +IceUtil::ThreadLockedException::ice_clone() const { return new ThreadLockedException(*this); } void -Ice::ThreadLockedException::ice_throw() const +IceUtil::ThreadLockedException::ice_throw() const { throw *this; } -Ice::ThreadStartedException::ThreadStartedException(const char* file, int line) : +IceUtil::ThreadStartedException::ThreadStartedException(const char* file, int line) : Exception(file, line) { } -const char* Ice::ThreadStartedException::_name = "Ice::ThreadStartedException"; +const char* IceUtil::ThreadStartedException::_name = "IceUtil::ThreadStartedException"; const string -Ice::ThreadStartedException::ice_name() const +IceUtil::ThreadStartedException::ice_name() const { return _name; } -Ice::Exception* -Ice::ThreadStartedException::ice_clone() const +IceUtil::Exception* +IceUtil::ThreadStartedException::ice_clone() const { return new ThreadStartedException(*this); } void -Ice::ThreadStartedException::ice_throw() const +IceUtil::ThreadStartedException::ice_throw() const { throw *this; } -Ice::ThreadNotStartedException::ThreadNotStartedException(const char* file, int line) : +IceUtil::ThreadNotStartedException::ThreadNotStartedException(const char* file, int line) : Exception(file, line) { } -const char* Ice::ThreadNotStartedException::_name = "Ice::ThreadNotStartedException"; +const char* IceUtil::ThreadNotStartedException::_name = "IceUtil::ThreadNotStartedException"; const string -Ice::ThreadNotStartedException::ice_name() const +IceUtil::ThreadNotStartedException::ice_name() const { return _name; } -Ice::Exception* -Ice::ThreadNotStartedException::ice_clone() const +IceUtil::Exception* +IceUtil::ThreadNotStartedException::ice_clone() const { return new ThreadNotStartedException(*this); } void -Ice::ThreadNotStartedException::ice_throw() const +IceUtil::ThreadNotStartedException::ice_throw() const { throw *this; } diff --git a/cppe/src/IceE/Time.cpp b/cppe/src/IceE/Time.cpp index 501326eec4f..0421202e3f9 100644 --- a/cppe/src/IceE/Time.cpp +++ b/cppe/src/IceE/Time.cpp @@ -18,15 +18,15 @@ # endif
#endif -using namespace Ice; +using namespace IceUtil; -Time::Time() : +IceUtil::Time::Time() : _usec(0) { } Time -Ice::Time::now() +IceUtil::Time::now() { #if defined(_WIN32_WCE)
// @@ -48,25 +48,25 @@ Ice::Time::now() } Time -Ice::Time::seconds(Int64 t) +IceUtil::Time::seconds(Int64 t) { return Time(t * static_cast<Int64>(1000000)); } Time -Ice::Time::milliSeconds(Int64 t) +IceUtil::Time::milliSeconds(Int64 t) { return Time(t * static_cast<Int64>(1000)); } Time -Ice::Time::microSeconds(Int64 t) +IceUtil::Time::microSeconds(Int64 t) { return Time(t); } #ifndef _WIN32 -Ice::Time::operator timeval() const +IceUtil::Time::operator timeval() const { timeval tv; tv.tv_sec = static_cast<long>(_usec / 1000000); @@ -76,37 +76,37 @@ Ice::Time::operator timeval() const #endif Int64 -Ice::Time::toSeconds() const +IceUtil::Time::toSeconds() const { return _usec / 1000000; } Int64 -Ice::Time::toMilliSeconds() const +IceUtil::Time::toMilliSeconds() const { return _usec / 1000; } Int64 -Ice::Time::toMicroSeconds() const +IceUtil::Time::toMicroSeconds() const { return _usec; } double -Ice::Time::toSecondsDouble() const +IceUtil::Time::toSecondsDouble() const { return _usec / 1000000.0; } double -Ice::Time::toMilliSecondsDouble() const +IceUtil::Time::toMilliSecondsDouble() const { return _usec / 1000.0; } double -Ice::Time::toMicroSecondsDouble() const +IceUtil::Time::toMicroSecondsDouble() const { return static_cast<double>(_usec); } diff --git a/cppe/src/IceE/TraceLevels.h b/cppe/src/IceE/TraceLevels.h index 7c9d6411464..e4f8e4249bf 100644 --- a/cppe/src/IceE/TraceLevels.h +++ b/cppe/src/IceE/TraceLevels.h @@ -17,7 +17,7 @@ namespace IceInternal { -class TraceLevels : public ::Ice::Shared +class TraceLevels : public ::IceUtil::Shared { public: diff --git a/cppe/src/IceE/TraceUtil.cpp b/cppe/src/IceE/TraceUtil.cpp index 550ebb21fe6..99682f8ec27 100644 --- a/cppe/src/IceE/TraceUtil.cpp +++ b/cppe/src/IceE/TraceUtil.cpp @@ -35,7 +35,7 @@ printIdentityFacetOperation(string& s, BasicStream& stream) s += "\nfacet = "; if(!facet.empty()) { - s += Ice::escapeString(facet[0], ""); + s += IceUtil::escapeString(facet[0], ""); } string operation; diff --git a/cppe/src/IceE/Transceiver.h b/cppe/src/IceE/Transceiver.h index e418d34ce42..e17d77faca5 100644 --- a/cppe/src/IceE/Transceiver.h +++ b/cppe/src/IceE/Transceiver.h @@ -30,7 +30,7 @@ class Connector; class Acceptor; class Buffer; -class ICEE_API Transceiver : public ::Ice::Shared +class ICEE_API Transceiver : public ::IceUtil::Shared { public: diff --git a/cppe/src/IceE/UUID.cpp b/cppe/src/IceE/UUID.cpp index cc7b75a476b..69cef2d4f19 100644 --- a/cppe/src/IceE/UUID.cpp +++ b/cppe/src/IceE/UUID.cpp @@ -58,12 +58,12 @@ inline void bytesToHex(unsigned char* bytes, size_t len, char*& hexBuffer) } -Ice::UUIDGenerationException::UUIDGenerationException(const char* file, int line) : +IceUtil::UUIDGenerationException::UUIDGenerationException(const char* file, int line) : Exception(file, line) { } -const char* Ice::UUIDGenerationException::_name = "Ice::UUIDGenerationException"; +const char* IceUtil::UUIDGenerationException::_name = "IceUtil::UUIDGenerationException"; #ifndef _WIN32 // @@ -77,7 +77,7 @@ const char* Ice::UUIDGenerationException::_name = "Ice::UUIDGenerationException" // a static mutex. // -static Ice::StaticMutex staticMutex = ICEE_STATIC_MUTEX_INITIALIZER; +static IceUtil::StaticMutex staticMutex = ICEE_STATIC_MUTEX_INITIALIZER; static int fd = -1; static char myPid[2]; @@ -93,7 +93,7 @@ public: ~UUIDCleanup() { - Ice::StaticMutex::Lock lock(staticMutex); + IceUtil::StaticMutex::Lock lock(staticMutex); if(fd != -1) { close(fd); @@ -108,26 +108,26 @@ static UUIDCleanup uuidCleanup; #endif const string -Ice::UUIDGenerationException::ice_name() const +IceUtil::UUIDGenerationException::ice_name() const { return _name; } -Ice::Exception* -Ice::UUIDGenerationException::ice_clone() const +IceUtil::Exception* +IceUtil::UUIDGenerationException::ice_clone() const { return new UUIDGenerationException(*this); } void -Ice::UUIDGenerationException::ice_throw() const +IceUtil::UUIDGenerationException::ice_throw() const { throw *this; } string -Ice::generateUUID() +IceUtil::generateUUID() { #if defined(_WIN32 ) && !defined(_WIN32_WCE) @@ -189,7 +189,7 @@ Ice::generateUUID() // // Serialize access to /dev/urandom; see comment above. // - Ice::StaticMutex::Lock lock(staticMutex); + IceUtil::StaticMutex::Lock lock(staticMutex); if(fd == -1) { fd = open("/dev/urandom", O_RDONLY); |