diff options
Diffstat (limited to 'src/manager/main/thread-service.h')
-rw-r--r-- | src/manager/main/thread-service.h | 67 |
1 files changed, 42 insertions, 25 deletions
diff --git a/src/manager/main/thread-service.h b/src/manager/main/thread-service.h index 209375fd..3248811e 100644 --- a/src/manager/main/thread-service.h +++ b/src/manager/main/thread-service.h @@ -30,34 +30,51 @@ namespace CKM { class ThreadService: public GenericSocketService, public ServiceThread { public: - ThreadService(); - virtual ~ThreadService(); - NONCOPYABLE(ThreadService); + ThreadService(); + virtual ~ThreadService(); + NONCOPYABLE(ThreadService); - void Event(const AcceptEvent& event) { ThreadEvent(event); } - void Event(const WriteEvent& event) { ThreadEvent(event); } - void Event(const ReadEvent& event) { ThreadEvent(event); } - void Event(const CloseEvent& event) { ThreadEvent(event); } - void Event(const SecurityEvent &event) { ThreadEvent(event); } + void Event(const AcceptEvent &event) + { + ThreadEvent(event); + } + void Event(const WriteEvent &event) + { + ThreadEvent(event); + } + void Event(const ReadEvent &event) + { + ThreadEvent(event); + } + void Event(const CloseEvent &event) + { + ThreadEvent(event); + } + void Event(const SecurityEvent &event) + { + ThreadEvent(event); + } protected: - virtual bool ProcessOne(const ConnectionID &conn, - ConnectionInfo &info, - bool allowed) = 0; - - template <typename E> - void ThreadEvent(const E& event) - { - CreateEvent([this, event]() { this->Handle(event); }); - } - - void Handle(const AcceptEvent &event); - void Handle(const WriteEvent &event); - void Handle(const ReadEvent &event); - void Handle(const CloseEvent &event); - void Handle(const SecurityEvent &event); - - ConnectionInfoMap m_connectionInfoMap; + virtual bool ProcessOne(const ConnectionID &conn, + ConnectionInfo &info, + bool allowed) = 0; + + template <typename E> + void ThreadEvent(const E &event) + { + CreateEvent([this, event]() { + this->Handle(event); + }); + } + + void Handle(const AcceptEvent &event); + void Handle(const WriteEvent &event); + void Handle(const ReadEvent &event); + void Handle(const CloseEvent &event); + void Handle(const SecurityEvent &event); + + ConnectionInfoMap m_connectionInfoMap; }; } /* namespace CKM */ |