From 8755eda4db1e738453d751ef20e24beec27d1820 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 3 Apr 2012 19:38:13 -0700 Subject: Making a few classes anonymous. --- src/LuaTask.cc | 4 ++++ src/Socket.cc | 8 ++++---- src/TaskMan.cc | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/LuaTask.cc b/src/LuaTask.cc index e1c722d..2641682 100644 --- a/src/LuaTask.cc +++ b/src/LuaTask.cc @@ -3,10 +3,14 @@ #include "TaskMan.h" #include "Printer.h" +namespace { + class LuaTaskStopper : public Balau::LuaExecCell { virtual void run(Balau::Lua &) { } }; +}; + Balau::LuaExecCell::LuaExecCell() : m_detached(false) { Printer::elog(E_TASK, "LuaExecCell created at %p", this); } diff --git a/src/Socket.cc b/src/Socket.cc index 1c3778a..18989af 100644 --- a/src/Socket.cc +++ b/src/Socket.cc @@ -172,9 +172,8 @@ static const char * inet_ntop(int af, const void * src, char * dst, socklen_t si #endif -#if 0 -// TODO: use getaddrinfo_a, if available. -#else +namespace { + class ResolverThread : public Balau::GlobalThread { public: ResolverThread() : GlobalThread(8), m_stopping(false) { } @@ -186,6 +185,8 @@ class ResolverThread : public Balau::GlobalThread { volatile bool m_stopping; }; +}; + void ResolverThread::threadExit() { m_stopping = true; DNSRequest req; @@ -228,7 +229,6 @@ static DNSRequest resolveName(const char * name, const char * service = NULL, st return req; } -#endif Balau::Socket::Socket() throw (GeneralException) : m_fd(socket(AF_INET6, SOCK_STREAM, 0)), m_connected(false), m_connecting(false), m_listening(false) { m_name = "Socket(unconnected)"; diff --git a/src/TaskMan.cc b/src/TaskMan.cc index cb2c567..463cb0a 100644 --- a/src/TaskMan.cc +++ b/src/TaskMan.cc @@ -3,6 +3,8 @@ #include "Main.h" #include "Local.h" +namespace { + class Stopper : public Balau::Task { public: Stopper(int code) : m_code(code) { } @@ -20,6 +22,8 @@ const char * Stopper::getName() const { return "Stopper"; } +}; + static Balau::DefaultTmpl defaultTaskMan(50); static Balau::LocalTmpl localTaskMan; -- cgit v1.2.3