Cat
ServerDim.h
Go to the documentation of this file.
1 // $Id: serverDim.h,v 1.4 2007/02/05 14:59:04 fmachefe Exp $
2 #ifndef INC_SERVERDIM_H
3 #define INC_SERVERDIM_H 1
4 
5 // Include files
6 
7 #ifdef _NETWORK_
8 #include <dis.hxx>
9 #endif
10 
11 #include <iostream>
12 #ifndef WIN32
13 #include <unistd.h>
14 #endif
15 
16 class Application;
17 
25 #ifdef _NETWORK_
26 class serverErrorHandler : public DimErrorHandler{
27  void errorHandler(int severity, int code, char *msg);
28 
29 public:
30  serverErrorHandler();
31 };
32 
33 class ExitHandler : public DimExitHandler {
34  void exitHandler(int code);
35 
36 public:
37  ExitHandler();
38 };
39 
40 class CmndServ :
41  public DimCommand ,
42  public DimThread
43 {
44 public :
45  CmndServ( Application* );
46 protected:
47  void commandHandler();
48  void threadHandler();
49 
50 private:
51  std::string m_command;
52  Application *m_application;
53 };
54 
55 class CtrlServ :
56  public DimCommand
57 // ,
58 // public DimThread
59 {
60 public :
61  CtrlServ( Application* );
62 protected:
63  void commandHandler();
64  // void threadHandler();
65 
66 private:
67  std::string m_command;
68  Application *m_application;
69 };
70 
71 class Timer : public DimTimer {
72 public:
73  Timer( int , DimService*) ;
74  void timerHandler() ;
75 
80  void setDelay (int delay) {
81  msgSvc( INFO , "" , "Delay set to "+
82  itos( delay ) +
83  "s" );
84  m_delay = delay;
85  }
86 
91  int delay () {
92  return m_delay;
93  }
94 
95 private:
96  int m_delay;
97  DimService* m_srv;
98 };
99 
100 #endif
101 
102 #endif // INC_SERVERDIM_H
std::string itos(int)
Definition: Tools.cpp:46