OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4StdInProc.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2010-2016, The OpenClonk Team and contributors
5  *
6  * Distributed under the terms of the ISC license; see accompanying file
7  * "COPYING" for details.
8  *
9  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
10  * See accompanying file "TRADEMARK" for details.
11  *
12  * To redistribute this file separately, substitute the full license texts
13  * for the above references.
14  */
15 
16 #ifndef INC_C4STDINPROC
17 #define INC_C4STDINPROC
18 
19 #include "platform/StdScheduler.h"
20 
21 // A simple alertable proc
23 {
24 public:
25  C4StdInProc();
26  ~C4StdInProc();
27 
28  // StdSchedulerProc override
29  virtual bool Execute(int iTimeout, pollfd *);
30 #ifdef STDSCHEDULER_USE_EVENTS
31  virtual HANDLE GetEvent() { return GetStdHandle(STD_INPUT_HANDLE); }
32 #else
33  virtual void GetFDs(std::vector<struct pollfd> & checkfds)
34  {
35  pollfd pfd = { 0, POLLIN, 0 };
36  checkfds.push_back(pfd);
37  }
38 #endif
39 private:
40  // commands from stdin
41  StdCopyStrBuf CmdBuf;
42 };
43 
44 #endif /* INC_C4STDINPROC */
virtual bool Execute(int iTimeout, pollfd *)
Definition: C4StdInProc.cpp:66
virtual void GetFDs(std::vector< struct pollfd > &checkfds)
Definition: C4StdInProc.h:33