SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventProcessor.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 #include <ace/Task_Ex_T.h>
10 #include "SEGSEvent.h"
11 // Independent Task, each EventProcessor when activated dequeues SEGSEvents,
12 // and dispatches them
13 class EventProcessor : public ACE_Task_Ex<ACE_MT_SYNCH,SEGSEvent>
14 {
15 typedef ACE_Task_Ex<ACE_MT_SYNCH,SEGSEvent> super;
16 
17 
18  int svc(void) final;
19 public:
20  int open(void *args = nullptr);
21  int handle_timeout(const ACE_Time_Value &current_time, const void *act /* = 0 */);
24 virtual bool per_thread_setup() { return true; }
25 virtual void dispatch(SEGSEvent *ev)=0;
26 };
Definition: SEGSEvent.h:32
Definition: EventProcessor.h:13
int handle_timeout(const ACE_Time_Value &current_time, const void *act)
Definition: EventProcessor.cpp:24
int open(void *args=nullptr)
Definition: EventProcessor.cpp:19
virtual void dispatch(SEGSEvent *ev)=0
virtual bool per_thread_setup()
Definition: EventProcessor.h:24