summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-07-28 10:40:12 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-07-28 10:40:12 +0200
commit0a3d021ac4e09d373925cbdc01d52b725603bca0 (patch)
tree51d431497165078c6aa9768e457a683d62c906ca /cpp/src
parentFixes for Ruby x64 on Windows + MinGW cleanups (diff)
downloadice-0a3d021ac4e09d373925cbdc01d52b725603bca0.tar.bz2
ice-0a3d021ac4e09d373925cbdc01d52b725603bca0.tar.xz
ice-0a3d021ac4e09d373925cbdc01d52b725603bca0.zip
Fixed #2 of ICE-5594: code style for CallbackBase class
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp4
-rw-r--r--cpp/src/Ice/ConnectionI.cpp4
-rw-r--r--cpp/src/Ice/OutgoingAsync.cpp30
-rw-r--r--cpp/src/Ice/Proxy.cpp32
-rw-r--r--cpp/src/slice2cpp/Gen.cpp26
5 files changed, 48 insertions, 48 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index 8bc80d47363..57a04cc9435 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -241,7 +241,7 @@ Ice::CommunicatorI::begin_flushBatchRequests(
}
virtual void
- __completed(const AsyncResultPtr& __result) const
+ completed(const AsyncResultPtr& __result) const
{
CommunicatorPtr __com = __result->getCommunicator();
assert(__com);
@@ -252,7 +252,7 @@ Ice::CommunicatorI::begin_flushBatchRequests(
}
catch(const Exception& ex)
{
- IceInternal::Cpp11FnCallbackNC::__exception(__result, ex);
+ IceInternal::Cpp11FnCallbackNC::exception(__result, ex);
}
}
};
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
index 01f18e6e91f..22cc069ef08 100644
--- a/cpp/src/Ice/ConnectionI.cpp
+++ b/cpp/src/Ice/ConnectionI.cpp
@@ -1002,7 +1002,7 @@ Ice::ConnectionI::begin_flushBatchRequests(
}
virtual void
- __completed(const AsyncResultPtr& __result) const
+ completed(const AsyncResultPtr& __result) const
{
ConnectionPtr __con = __result->getConnection();
assert(__con);
@@ -1013,7 +1013,7 @@ Ice::ConnectionI::begin_flushBatchRequests(
}
catch(const Exception& ex)
{
- IceInternal::Cpp11FnCallbackNC::__exception(__result, ex);
+ IceInternal::Cpp11FnCallbackNC::exception(__result, ex);
}
}
};
diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp
index 905b3196a5f..39252dbcadc 100644
--- a/cpp/src/Ice/OutgoingAsync.cpp
+++ b/cpp/src/Ice/OutgoingAsync.cpp
@@ -111,7 +111,7 @@ Ice::AsyncResult::AsyncResult(const CommunicatorPtr& communicator,
{
throw IceUtil::IllegalArgumentException(__FILE__, __LINE__);
}
- const_cast<CallbackBasePtr&>(_callback) = _callback->__verify(_cookie);
+ const_cast<CallbackBasePtr&>(_callback) = _callback->verify(_cookie);
}
Ice::AsyncResult::~AsyncResult()
@@ -216,7 +216,7 @@ Ice::AsyncResult::__invokeSent()
try
{
AsyncResultPtr self(this);
- _callback->__sent(self);
+ _callback->sent(self);
}
catch(const std::exception& ex)
{
@@ -296,7 +296,7 @@ Ice::AsyncResult::__invokeCompleted()
try
{
AsyncResultPtr self(this);
- _callback->__completed(self);
+ _callback->completed(self);
}
catch(const std::exception& ex)
{
@@ -538,7 +538,7 @@ IceInternal::OutgoingAsync::__sent()
if(_proxy->__reference()->getMode() != Reference::ModeTwoway)
{
_childObserver.detach();
- if(!_callback || !_callback->__hasSentCallback())
+ if(!_callback || !_callback->hasSentCallback())
{
_observer.detach();
}
@@ -551,7 +551,7 @@ IceInternal::OutgoingAsync::__sent()
//_os.resize(0); // Don't clear the buffer now, it's needed for collocation optimization.
}
_monitor.notifyAll();
- return !alreadySent && _callback && _callback->__hasSentCallback();
+ return !alreadySent && _callback && _callback->hasSentCallback();
}
void
@@ -873,7 +873,7 @@ IceInternal::BatchOutgoingAsync::__sent()
_timeoutRequestHandler = 0;
}
_monitor.notifyAll();
- if(!_callback || !_callback->__hasSentCallback())
+ if(!_callback || !_callback->hasSentCallback())
{
_observer.detach();
return false;
@@ -1105,7 +1105,7 @@ IceInternal::CommunicatorBatchOutgoingAsync::check(bool userThread)
_monitor.notifyAll();
}
- if(!_callback || !_callback->__hasSentCallback())
+ if(!_callback || !_callback->hasSentCallback())
{
_observer.detach();
}
@@ -1145,12 +1145,12 @@ public:
{
}
- virtual void __completed(const Ice::AsyncResultPtr&) const
+ virtual void completed(const Ice::AsyncResultPtr&) const
{
assert(false);
}
- virtual CallbackBasePtr __verify(const Ice::LocalObjectPtr&)
+ virtual CallbackBasePtr verify(const Ice::LocalObjectPtr&)
{
//
// Called by the AsyncResult constructor to verify the delegate. The dummy
@@ -1161,12 +1161,12 @@ public:
return 0;
}
- virtual void __sent(const AsyncResultPtr&) const
+ virtual void sent(const AsyncResultPtr&) const
{
assert(false);
}
- virtual bool __hasSentCallback() const
+ virtual bool hasSentCallback() const
{
assert(false);
return false;
@@ -1200,17 +1200,17 @@ Ice::newCallback(const ::IceInternal::Function<void (const AsyncResultPtr&)>& co
checkCallback(true, completed != nullptr);
}
- virtual void __completed(const AsyncResultPtr& result) const
+ virtual void completed(const AsyncResultPtr& result) const
{
_completed(result);
}
- virtual CallbackBasePtr __verify(const LocalObjectPtr&)
+ virtual CallbackBasePtr verify(const LocalObjectPtr&)
{
return this; // Nothing to do, the cookie is not type-safe.
}
- virtual void __sent(const AsyncResultPtr& result) const
+ virtual void sent(const AsyncResultPtr& result) const
{
if(_sent != nullptr)
{
@@ -1218,7 +1218,7 @@ Ice::newCallback(const ::IceInternal::Function<void (const AsyncResultPtr&)>& co
}
}
- virtual bool __hasSentCallback() const
+ virtual bool hasSentCallback() const
{
return _sent != nullptr;
}
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp
index b872b1f0477..41b46165524 100644
--- a/cpp/src/Ice/Proxy.cpp
+++ b/cpp/src/Ice/Proxy.cpp
@@ -80,13 +80,13 @@ IceInternal::Cpp11FnCallbackNC::Cpp11FnCallbackNC(const ::std::function<void (co
}
IceInternal::CallbackBasePtr
-IceInternal::Cpp11FnCallbackNC::__verify(const ::Ice::LocalObjectPtr&)
+IceInternal::Cpp11FnCallbackNC::verify(const ::Ice::LocalObjectPtr&)
{
return this;
}
void
-IceInternal::Cpp11FnCallbackNC::__sent(const ::Ice::AsyncResultPtr& result) const
+IceInternal::Cpp11FnCallbackNC::sent(const ::Ice::AsyncResultPtr& result) const
{
if(_sent != nullptr)
{
@@ -95,13 +95,13 @@ IceInternal::Cpp11FnCallbackNC::__sent(const ::Ice::AsyncResultPtr& result) cons
}
bool
-IceInternal::Cpp11FnCallbackNC::__hasSentCallback() const
+IceInternal::Cpp11FnCallbackNC::hasSentCallback() const
{
return _sent != nullptr;
}
void
-IceInternal::Cpp11FnCallbackNC::__exception(const ::Ice::AsyncResultPtr&, const ::Ice::Exception& ex) const
+IceInternal::Cpp11FnCallbackNC::exception(const ::Ice::AsyncResultPtr&, const ::Ice::Exception& ex) const
{
if(_exception != nullptr)
{
@@ -119,7 +119,7 @@ IceInternal::Cpp11FnOnewayCallbackNC::Cpp11FnOnewayCallbackNC(const ::std::funct
}
void
-IceInternal::Cpp11FnOnewayCallbackNC::__completed(const ::Ice::AsyncResultPtr& result) const
+IceInternal::Cpp11FnOnewayCallbackNC::completed(const ::Ice::AsyncResultPtr& result) const
{
try
{
@@ -127,7 +127,7 @@ IceInternal::Cpp11FnOnewayCallbackNC::__completed(const ::Ice::AsyncResultPtr& r
}
catch(const ::Ice::Exception& ex)
{
- Cpp11FnCallbackNC::__exception(result, ex);
+ Cpp11FnCallbackNC::exception(result, ex);
return;
}
if(_cb != nullptr)
@@ -252,7 +252,7 @@ IceProxy::Ice::Object::__begin_ice_isA(
CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
}
- virtual void __completed(const ::Ice::AsyncResultPtr& __result) const
+ virtual void completed(const ::Ice::AsyncResultPtr& __result) const
{
::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy());
bool __ret;
@@ -262,7 +262,7 @@ IceProxy::Ice::Object::__begin_ice_isA(
}
catch(const ::Ice::Exception& ex)
{
- Cpp11FnCallbackNC::__exception(__result, ex);
+ Cpp11FnCallbackNC::exception(__result, ex);
return;
}
if(_response != nullptr)
@@ -299,7 +299,7 @@ IceProxy::Ice::Object::__begin_ice_id(
CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
}
- virtual void __completed(const ::Ice::AsyncResultPtr& __result) const
+ virtual void completed(const ::Ice::AsyncResultPtr& __result) const
{
::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy());
::std::string __ret;
@@ -309,7 +309,7 @@ IceProxy::Ice::Object::__begin_ice_id(
}
catch(const ::Ice::Exception& ex)
{
- Cpp11FnCallbackNC::__exception(__result, ex);
+ Cpp11FnCallbackNC::exception(__result, ex);
return;
}
if(_response != nullptr)
@@ -345,7 +345,7 @@ IceProxy::Ice::Object::__begin_ice_ids(
CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
}
- virtual void __completed(const ::Ice::AsyncResultPtr& __result) const
+ virtual void completed(const ::Ice::AsyncResultPtr& __result) const
{
::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy());
::std::vector< ::std::string> __ret;
@@ -355,7 +355,7 @@ IceProxy::Ice::Object::__begin_ice_ids(
}
catch(const ::Ice::Exception& ex)
{
- Cpp11FnCallbackNC::__exception(__result, ex);
+ Cpp11FnCallbackNC::exception(__result, ex);
return;
}
if(_response != nullptr)
@@ -394,7 +394,7 @@ IceProxy::Ice::Object::__begin_ice_invoke(
CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
}
- virtual void __completed(const ::Ice::AsyncResultPtr& __result) const
+ virtual void completed(const ::Ice::AsyncResultPtr& __result) const
{
::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy());
bool __ret;
@@ -405,7 +405,7 @@ IceProxy::Ice::Object::__begin_ice_invoke(
}
catch(const ::Ice::Exception& ex)
{
- Cpp11FnCallbackNC::__exception(__result, ex);
+ Cpp11FnCallbackNC::exception(__result, ex);
return;
}
if(_response != nullptr)
@@ -446,7 +446,7 @@ IceProxy::Ice::Object::__begin_ice_invoke(
CallbackBase::checkCallback(true, _response || _exception != nullptr);
}
- virtual void __completed(const ::Ice::AsyncResultPtr& __result) const
+ virtual void completed(const ::Ice::AsyncResultPtr& __result) const
{
bool __ret;
::std::pair<const ::Ice::Byte*, const ::Ice::Byte*> p1;
@@ -456,7 +456,7 @@ IceProxy::Ice::Object::__begin_ice_invoke(
}
catch(const ::Ice::Exception& ex)
{
- Cpp11FnCallbackNC::__exception(__result, ex);
+ Cpp11FnCallbackNC::exception(__result, ex);
return;
}
if(_response != nullptr)
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 4c1dcbed7da..9342b00d0b5 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -516,7 +516,7 @@ Slice::Gen::generate(const UnitPtr& p)
//
// We need to delay generating the template after the proxy
- // definition, because __completed calls the begin_ method in the
+ // definition, because completed calls the begin_ method in the
// proxy.
//
AsyncCallbackTemplateVisitor asyncCallbackTemplateVisitor(H, C, _dllExport);
@@ -1779,7 +1779,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
// pointers would be invalid once end_ returns, we still want to allow using this
// alternate mapping with AMI response callbacks (to allow zero-copy for instance).
// For this purpose, we generate a special ___end method which is used by the
- // __completed implementation of the generated Callback_Inft_opName operation
+ // completed implementation of the generated Callback_Inft_opName operation
// delegate.
//
bool generatePrivateEnd = retS != retSEndAMI || outParamsDeclAMI != outParamsDeclEndAMI;
@@ -2267,7 +2267,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
//
// completed.
//
- C << sp << nl << "virtual void __completed(const ::Ice::AsyncResultPtr& __result) const";
+ C << sp << nl << "virtual void completed(const ::Ice::AsyncResultPtr& __result) const";
C << sb;
C << nl << clScope << clName << "Prx __proxy = " << clScope << clName
<< "Prx::uncheckedCast(__result->getProxy());";
@@ -2296,7 +2296,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
C << eb;
C << nl << "catch(const ::Ice::Exception& ex)";
C << sb;
- C << nl << "Cpp11FnCallbackNC::__exception(__result, ex);";
+ C << nl << "Cpp11FnCallbackNC::exception(__result, ex);";
C << nl << "return;";
C << eb;
C << nl << "if(_response != nullptr)";
@@ -2327,8 +2327,8 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
C << eb << ';';
- C << nl << "return begin_" << name << spar << argsAMI << "__ctx" << "new Cpp11CB(__response, __exception, __sent)"
- << epar << ';';
+ C << nl << "return begin_" << name << spar << argsAMI << "__ctx"
+ << "new Cpp11CB(__response, __exception, __sent)" << epar << ';';
C << eb;
//
@@ -4283,7 +4283,7 @@ Slice::Gen::AsyncCallbackTemplateVisitor::generateOperation(const OperationPtr&
H.inc();
if(p->returnsData())
{
- H << nl << ": " << inheritD + "(obj, cb != 0, excb, sentcb), response(cb)";
+ H << nl << ": " << inheritD + "(obj, cb != 0, excb, sentcb), _response(cb)";
}
else
{
@@ -4298,7 +4298,7 @@ Slice::Gen::AsyncCallbackTemplateVisitor::generateOperation(const OperationPtr&
//
// completed.
//
- H << sp << nl << "virtual void __completed(const ::Ice::AsyncResultPtr& __result) const";
+ H << sp << nl << "virtual void completed(const ::Ice::AsyncResultPtr& __result) const";
H << sb;
H << nl << clScope << clName << "Prx __proxy = " << clScope << clName
<< "Prx::uncheckedCast(__result->getProxy());";
@@ -4328,12 +4328,12 @@ Slice::Gen::AsyncCallbackTemplateVisitor::generateOperation(const OperationPtr&
H << nl << "catch(const ::Ice::Exception& ex)";
H << sb;
- H << nl << "" << baseD << "::__exception(__result, ex);";
+ H << nl << "" << baseD << "::exception(__result, ex);";
H << nl << "return;";
H << eb;
- H << nl << "if(response)";
+ H << nl << "if(_response)";
H << sb;
- H << nl << "(" << baseD << "::callback.get()->*response)" << spar;
+ H << nl << "(" << baseD << "::_callback.get()->*_response)" << spar;
if(ret)
{
H << "__ret";
@@ -4346,8 +4346,8 @@ Slice::Gen::AsyncCallbackTemplateVisitor::generateOperation(const OperationPtr&
H << epar << ';';
H << eb;
H << eb;
-
- H << sp << nl << "Response response;";
+ H << sp << nl << "private:";
+ H << sp << nl << "Response _response;";
}
H << eb << ';';