Replaced method name `run' with `mainLoop', and `stop' and `quit'
with `exitMainLoop' in most places.
This commit is contained in:
parent
8913acac34
commit
9792d35a6b
|
@ -54,9 +54,9 @@ CClient::setAddress(const CNetworkAddress& serverAddress)
|
|||
}
|
||||
|
||||
void
|
||||
CClient::quit()
|
||||
CClient::exitMainLoop()
|
||||
{
|
||||
m_screen->stop();
|
||||
m_screen->exitMainLoop();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -133,7 +133,7 @@ CClient::open()
|
|||
}
|
||||
|
||||
void
|
||||
CClient::run()
|
||||
CClient::mainLoop()
|
||||
{
|
||||
{
|
||||
CLock lock(&m_mutex);
|
||||
|
@ -157,7 +157,7 @@ CClient::run()
|
|||
}
|
||||
|
||||
// handle events
|
||||
m_screen->run();
|
||||
m_screen->mainLoop();
|
||||
|
||||
// clean up
|
||||
deleteSession();
|
||||
|
@ -430,11 +430,11 @@ CClient::runSession(void*)
|
|||
try {
|
||||
log((CLOG_DEBUG "starting server proxy"));
|
||||
runServer();
|
||||
m_screen->stop();
|
||||
m_screen->exitMainLoop();
|
||||
log((CLOG_DEBUG "stopping server proxy"));
|
||||
}
|
||||
catch (...) {
|
||||
m_screen->stop();
|
||||
m_screen->exitMainLoop();
|
||||
log((CLOG_DEBUG "stopping server proxy"));
|
||||
throw;
|
||||
}
|
||||
|
@ -521,7 +521,7 @@ CClient::runServer()
|
|||
bool rejected = true;
|
||||
if (proxy != NULL) {
|
||||
log((CLOG_DEBUG1 "communicating with server"));
|
||||
rejected = !proxy->run();
|
||||
rejected = !proxy->mainLoop();
|
||||
}
|
||||
|
||||
// clean up
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
Turns camping on or off. When camping the client will keep
|
||||
trying to connect to the server until it succeeds. This
|
||||
is useful if the client may start before the server. Do
|
||||
not call this while in run().
|
||||
not call this while in mainLoop().
|
||||
*/
|
||||
void camp(bool on);
|
||||
|
||||
|
@ -46,11 +46,11 @@ public:
|
|||
|
||||
//! Exit event loop
|
||||
/*!
|
||||
Force run() to return. This call can return before
|
||||
run() does (i.e. asynchronously). This may only be
|
||||
Force mainLoop() to return. This call can return before
|
||||
mainLoop() does (i.e. asynchronously). This may only be
|
||||
called between a successful open() and close().
|
||||
*/
|
||||
void quit();
|
||||
void exitMainLoop();
|
||||
|
||||
//@}
|
||||
//! @name accessors
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
|
||||
// IClient overrides
|
||||
virtual bool open();
|
||||
virtual void run();
|
||||
virtual void mainLoop();
|
||||
virtual void close();
|
||||
virtual void enter(SInt32 xAbs, SInt32 yAbs,
|
||||
UInt32 seqNum, KeyModifierMask mask,
|
||||
|
|
|
@ -258,7 +258,7 @@ CMSWindowsSecondaryScreen::preDestroyWindow(HWND)
|
|||
}
|
||||
|
||||
void
|
||||
CMSWindowsSecondaryScreen::onPreRun()
|
||||
CMSWindowsSecondaryScreen::onPreMainLoop()
|
||||
{
|
||||
assert(m_window != NULL);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
protected:
|
||||
// CSecondaryScreen overrides
|
||||
virtual void onPreRun();
|
||||
virtual void onPreMainLoop();
|
||||
virtual void onPreOpen();
|
||||
virtual void onPreEnter();
|
||||
virtual void onPreLeave();
|
||||
|
|
|
@ -19,7 +19,7 @@ CSecondaryScreen::~CSecondaryScreen()
|
|||
}
|
||||
|
||||
void
|
||||
CSecondaryScreen::run()
|
||||
CSecondaryScreen::mainLoop()
|
||||
{
|
||||
// change our priority
|
||||
CThread::getCurrentThread().setPriority(-7);
|
||||
|
@ -27,20 +27,20 @@ CSecondaryScreen::run()
|
|||
// run event loop
|
||||
try {
|
||||
log((CLOG_DEBUG "entering event loop"));
|
||||
onPreRun();
|
||||
onPreMainLoop();
|
||||
getScreen()->mainLoop();
|
||||
onPostRun();
|
||||
onPostMainLoop();
|
||||
log((CLOG_DEBUG "exiting event loop"));
|
||||
}
|
||||
catch (...) {
|
||||
onPostRun();
|
||||
onPostMainLoop();
|
||||
log((CLOG_DEBUG "exiting event loop"));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CSecondaryScreen::stop()
|
||||
CSecondaryScreen::exitMainLoop()
|
||||
{
|
||||
getScreen()->exitMainLoop();
|
||||
}
|
||||
|
@ -200,13 +200,13 @@ CSecondaryScreen::getCursorPos(SInt32& x, SInt32& y) const
|
|||
}
|
||||
|
||||
void
|
||||
CSecondaryScreen::onPreRun()
|
||||
CSecondaryScreen::onPreMainLoop()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void
|
||||
CSecondaryScreen::onPostRun()
|
||||
CSecondaryScreen::onPostMainLoop()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
|
|
@ -37,17 +37,17 @@ public:
|
|||
//! Run event loop
|
||||
/*!
|
||||
Run the screen's event loop. This returns when it detects
|
||||
the application should terminate or when stop() is called.
|
||||
run() may only be called between open() and close().
|
||||
the application should terminate or when exitMainLoop() is called.
|
||||
mainLoop() may only be called between open() and close().
|
||||
*/
|
||||
void run();
|
||||
void mainLoop();
|
||||
|
||||
//! Exit event loop
|
||||
/*!
|
||||
Force run() to return. This call can return before
|
||||
run() does (i.e. asynchronously).
|
||||
Force mainLoop() to return. This call can return before
|
||||
mainLoop() does (i.e. asynchronously).
|
||||
*/
|
||||
void stop();
|
||||
void exitMainLoop();
|
||||
|
||||
//! Close screen
|
||||
/*!
|
||||
|
@ -189,19 +189,19 @@ public:
|
|||
//@}
|
||||
|
||||
protected:
|
||||
//! Pre-run() hook
|
||||
//! Pre-mainLoop() hook
|
||||
/*!
|
||||
Called on entry to run(). Override to perform platform specific
|
||||
Called on entry to mainLoop(). Override to perform platform specific
|
||||
operations. Default does nothing. May throw.
|
||||
*/
|
||||
virtual void onPreRun();
|
||||
virtual void onPreMainLoop();
|
||||
|
||||
//! Post-run() hook
|
||||
//! Post-mainLoop() hook
|
||||
/*!
|
||||
Called on exit from run(). Override to perform platform specific
|
||||
Called on exit from mainLoop(). Override to perform platform specific
|
||||
operations. Default does nothing. May \b not throw.
|
||||
*/
|
||||
virtual void onPostRun();
|
||||
virtual void onPostMainLoop();
|
||||
|
||||
//! Pre-open() hook
|
||||
/*!
|
||||
|
|
|
@ -33,7 +33,7 @@ CServerProxy::~CServerProxy()
|
|||
}
|
||||
|
||||
bool
|
||||
CServerProxy::run()
|
||||
CServerProxy::mainLoop()
|
||||
{
|
||||
bool failedToConnect = false;
|
||||
try {
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
|
||||
(cancellation point)
|
||||
*/
|
||||
bool run();
|
||||
bool mainLoop();
|
||||
|
||||
//@}
|
||||
//! @name accessors
|
||||
|
|
|
@ -184,7 +184,7 @@ CXWindowsSecondaryScreen::getJumpZoneSize() const
|
|||
}
|
||||
|
||||
void
|
||||
CXWindowsSecondaryScreen::onPreRun()
|
||||
CXWindowsSecondaryScreen::onPreMainLoop()
|
||||
{
|
||||
assert(m_window != None);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
protected:
|
||||
// CSecondaryScreen overrides
|
||||
virtual void onPreRun();
|
||||
virtual void onPreMainLoop();
|
||||
virtual void onPreOpen();
|
||||
virtual void onPostOpen();
|
||||
virtual void onPreEnter();
|
||||
|
|
|
@ -95,7 +95,7 @@ realMain(CMutex* mutex)
|
|||
mutex->unlock();
|
||||
}
|
||||
locked = false;
|
||||
s_client->run();
|
||||
s_client->mainLoop();
|
||||
locked = true;
|
||||
if (mutex != NULL) {
|
||||
mutex->lock();
|
||||
|
@ -470,7 +470,7 @@ static
|
|||
void
|
||||
daemonStop(void)
|
||||
{
|
||||
s_client->quit();
|
||||
s_client->exitMainLoop();
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
// IClient overrides
|
||||
virtual bool open() = 0;
|
||||
virtual void run() = 0;
|
||||
virtual void mainLoop() = 0;
|
||||
virtual void close() = 0;
|
||||
virtual void enter(SInt32 xAbs, SInt32 yAbs,
|
||||
UInt32 seqNum, KeyModifierMask mask,
|
||||
|
|
|
@ -60,7 +60,7 @@ CClientProxy1_0::open()
|
|||
}
|
||||
|
||||
void
|
||||
CClientProxy1_0::run()
|
||||
CClientProxy1_0::mainLoop()
|
||||
{
|
||||
// handle messages until the client hangs up or stops sending heartbeats
|
||||
CStopwatch heartTimer;
|
||||
|
|
|
@ -15,7 +15,7 @@ public:
|
|||
|
||||
// IClient overrides
|
||||
virtual bool open();
|
||||
virtual void run();
|
||||
virtual void mainLoop();
|
||||
virtual void close();
|
||||
virtual void enter(SInt32 xAbs, SInt32 yAbs,
|
||||
UInt32 seqNum, KeyModifierMask mask,
|
||||
|
|
|
@ -384,9 +384,9 @@ CMSWindowsPrimaryScreen::preDestroyWindow(HWND)
|
|||
}
|
||||
|
||||
void
|
||||
CMSWindowsPrimaryScreen::onPreRun()
|
||||
CMSWindowsPrimaryScreen::onPreMainLoop()
|
||||
{
|
||||
// must call run() from same thread as open()
|
||||
// must call mainLoop() from same thread as open()
|
||||
assert(m_threadID == GetCurrentThreadId());
|
||||
assert(m_window != NULL);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
|
||||
protected:
|
||||
// CPrimaryScreen overrides
|
||||
virtual void onPreRun();
|
||||
virtual void onPreMainLoop();
|
||||
virtual void onPreOpen();
|
||||
virtual void onPostOpen();
|
||||
virtual void onPostClose();
|
||||
|
|
|
@ -40,9 +40,9 @@ CPrimaryClient::~CPrimaryClient()
|
|||
}
|
||||
|
||||
void
|
||||
CPrimaryClient::stop()
|
||||
CPrimaryClient::exitMainLoop()
|
||||
{
|
||||
m_screen->stop();
|
||||
m_screen->exitMainLoop();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -122,9 +122,9 @@ CPrimaryClient::open()
|
|||
}
|
||||
|
||||
void
|
||||
CPrimaryClient::run()
|
||||
CPrimaryClient::mainLoop()
|
||||
{
|
||||
m_screen->run();
|
||||
m_screen->mainLoop();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -29,11 +29,11 @@ public:
|
|||
|
||||
//! Exit event loop
|
||||
/*!
|
||||
Force run() to return. This call can return before
|
||||
run() does (i.e. asynchronously). This may only be
|
||||
Force mainLoop() to return. This call can return before
|
||||
mainLoop() does (i.e. asynchronously). This may only be
|
||||
called between a successful open() and close().
|
||||
*/
|
||||
void stop();
|
||||
void exitMainLoop();
|
||||
|
||||
//! Update configuration
|
||||
/*!
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
|
||||
// IClient overrides
|
||||
virtual bool open();
|
||||
virtual void run();
|
||||
virtual void mainLoop();
|
||||
virtual void close();
|
||||
virtual void enter(SInt32 xAbs, SInt32 yAbs,
|
||||
UInt32 seqNum, KeyModifierMask mask,
|
||||
|
|
|
@ -23,7 +23,7 @@ CPrimaryScreen::~CPrimaryScreen()
|
|||
}
|
||||
|
||||
void
|
||||
CPrimaryScreen::run()
|
||||
CPrimaryScreen::mainLoop()
|
||||
{
|
||||
// change our priority
|
||||
CThread::getCurrentThread().setPriority(-3);
|
||||
|
@ -31,20 +31,20 @@ CPrimaryScreen::run()
|
|||
// run event loop
|
||||
try {
|
||||
log((CLOG_DEBUG "entering event loop"));
|
||||
onPreRun();
|
||||
onPreMainLoop();
|
||||
getScreen()->mainLoop();
|
||||
onPostRun();
|
||||
onPostMainLoop();
|
||||
log((CLOG_DEBUG "exiting event loop"));
|
||||
}
|
||||
catch (...) {
|
||||
onPostRun();
|
||||
onPostMainLoop();
|
||||
log((CLOG_DEBUG "exiting event loop"));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPrimaryScreen::stop()
|
||||
CPrimaryScreen::exitMainLoop()
|
||||
{
|
||||
getScreen()->exitMainLoop();
|
||||
}
|
||||
|
@ -198,13 +198,13 @@ CPrimaryScreen::getClipboard(ClipboardID id,
|
|||
}
|
||||
|
||||
void
|
||||
CPrimaryScreen::onPreRun()
|
||||
CPrimaryScreen::onPreMainLoop()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void
|
||||
CPrimaryScreen::onPostRun()
|
||||
CPrimaryScreen::onPostMainLoop()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
|
|
@ -37,17 +37,17 @@ public:
|
|||
//! Run event loop
|
||||
/*!
|
||||
Run the screen's event loop. This returns when it detects
|
||||
the application should terminate or when stop() is called.
|
||||
run() may only be called between open() and close().
|
||||
the application should terminate or when exitMainLoop() is called.
|
||||
mainLoop() may only be called between open() and close().
|
||||
*/
|
||||
void run();
|
||||
void mainLoop();
|
||||
|
||||
//! Exit event loop
|
||||
/*!
|
||||
Force run() to return. This call can return before
|
||||
run() does (i.e. asynchronously).
|
||||
Force mainLoop() to return. This call can return before
|
||||
mainLoop() does (i.e. asynchronously).
|
||||
*/
|
||||
void stop();
|
||||
void exitMainLoop();
|
||||
|
||||
//! Close screen
|
||||
/*!
|
||||
|
@ -152,19 +152,19 @@ public:
|
|||
//@}
|
||||
|
||||
protected:
|
||||
//! Pre-run() hook
|
||||
//! Pre-mainLoop() hook
|
||||
/*!
|
||||
Called on entry to run(). Override to perform platform specific
|
||||
Called on entry to mainLoop(). Override to perform platform specific
|
||||
operations. Default does nothing. May throw.
|
||||
*/
|
||||
virtual void onPreRun();
|
||||
virtual void onPreMainLoop();
|
||||
|
||||
//! Post-run() hook
|
||||
//! Post-mainLoop() hook
|
||||
/*!
|
||||
Called on exit from run(). Override to perform platform specific
|
||||
Called on exit from mainLoop(). Override to perform platform specific
|
||||
operations. Default does nothing. May \b not throw.
|
||||
*/
|
||||
virtual void onPostRun();
|
||||
virtual void onPostMainLoop();
|
||||
|
||||
//! Pre-open() hook
|
||||
/*!
|
||||
|
|
|
@ -70,7 +70,7 @@ CServer::open()
|
|||
}
|
||||
|
||||
void
|
||||
CServer::run()
|
||||
CServer::mainLoop()
|
||||
{
|
||||
// check preconditions
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ CServer::run()
|
|||
}
|
||||
|
||||
// handle events
|
||||
m_primaryClient->run();
|
||||
m_primaryClient->mainLoop();
|
||||
|
||||
// clean up
|
||||
log((CLOG_NOTE "stopping server"));
|
||||
|
@ -137,9 +137,9 @@ CServer::run()
|
|||
}
|
||||
|
||||
void
|
||||
CServer::quit()
|
||||
CServer::exitMainLoop()
|
||||
{
|
||||
m_primaryClient->stop();
|
||||
m_primaryClient->exitMainLoop();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1167,7 +1167,7 @@ CServer::acceptClients(void*)
|
|||
catch (XBase& e) {
|
||||
log((CLOG_ERR "cannot listen for clients: %s", e.what()));
|
||||
delete listen;
|
||||
quit();
|
||||
exitMainLoop();
|
||||
}
|
||||
catch (...) {
|
||||
delete listen;
|
||||
|
@ -1238,7 +1238,7 @@ CServer::runClient(void* vsocket)
|
|||
// handle client messages
|
||||
try {
|
||||
log((CLOG_NOTE "client \"%s\" has connected", proxy->getName().c_str()));
|
||||
proxy->run();
|
||||
proxy->mainLoop();
|
||||
}
|
||||
catch (XBadClient&) {
|
||||
// client not behaving
|
||||
|
@ -1252,7 +1252,7 @@ CServer::runClient(void* vsocket)
|
|||
// FIXME -- could print network address if socket had suitable method
|
||||
}
|
||||
catch (...) {
|
||||
// run() was probably cancelled
|
||||
// mainLoop() was probably cancelled
|
||||
removeConnection(proxy->getName());
|
||||
delete socket;
|
||||
throw;
|
||||
|
@ -1463,7 +1463,7 @@ CServer::acceptHTTPClients(void*)
|
|||
log((CLOG_ERR "cannot listen for HTTP clients: %s", e.what()));
|
||||
delete listen;
|
||||
// FIXME -- quit?
|
||||
quit();
|
||||
exitMainLoop();
|
||||
}
|
||||
catch (...) {
|
||||
delete listen;
|
||||
|
|
|
@ -44,20 +44,20 @@ public:
|
|||
|
||||
//! Server main loop
|
||||
/*!
|
||||
Run server's event loop and return when quit() is called.
|
||||
Run server's event loop and return when exitMainLoop() is called.
|
||||
This must be called between a successful open() and close().
|
||||
|
||||
(cancellation point)
|
||||
*/
|
||||
void run();
|
||||
void mainLoop();
|
||||
|
||||
//! Exit event loop
|
||||
/*!
|
||||
Force run() to return. This call can return before
|
||||
run() does (i.e. asynchronously). This may only be
|
||||
Force mainLoop() to return. This call can return before
|
||||
mainLoop() does (i.e. asynchronously). This may only be
|
||||
called between a successful open() and close().
|
||||
*/
|
||||
void quit();
|
||||
void exitMainLoop();
|
||||
|
||||
//! Close server
|
||||
/*!
|
||||
|
|
|
@ -332,7 +332,7 @@ CXWindowsPrimaryScreen::getJumpZoneSize() const
|
|||
}
|
||||
|
||||
void
|
||||
CXWindowsPrimaryScreen::onPreRun()
|
||||
CXWindowsPrimaryScreen::onPreMainLoop()
|
||||
{
|
||||
assert(m_window != None);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
|
||||
protected:
|
||||
// CPrimaryScreen overrides
|
||||
virtual void onPreRun();
|
||||
virtual void onPreMainLoop();
|
||||
virtual void onPreOpen();
|
||||
virtual void onPostOpen();
|
||||
virtual void onPreEnter();
|
||||
|
|
|
@ -125,7 +125,7 @@ realMain(CMutex* mutex)
|
|||
mutex->unlock();
|
||||
}
|
||||
locked = false;
|
||||
s_server->run();
|
||||
s_server->mainLoop();
|
||||
locked = true;
|
||||
if (mutex != NULL) {
|
||||
mutex->lock();
|
||||
|
@ -568,7 +568,7 @@ static
|
|||
void
|
||||
daemonStop(void)
|
||||
{
|
||||
s_server->quit();
|
||||
s_server->exitMainLoop();
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
(cancellation point)
|
||||
*/
|
||||
virtual void run() = 0;
|
||||
virtual void mainLoop() = 0;
|
||||
|
||||
//! Close client
|
||||
/*!
|
||||
|
|
Loading…
Reference in New Issue