summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2012-04-03 19:38:13 -0700
committerPixel <pixel@nobis-crew.org>2012-04-03 19:38:13 -0700
commit8755eda4db1e738453d751ef20e24beec27d1820 (patch)
treeb5ba8f85e96a8c14c2e2142525a3644706d4b2d8
parenta252ec77684c43666923e5e49f57c48c10a9865d (diff)
Making a few classes anonymous.
-rw-r--r--src/LuaTask.cc4
-rw-r--r--src/Socket.cc8
-rw-r--r--src/TaskMan.cc4
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<Balau::TaskMan> defaultTaskMan(50);
static Balau::LocalTmpl<Balau::TaskMan> localTaskMan;