HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CMD_EvtMonitoringReader.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  * This class lets you read a line with a UT_CmdLineReader while
8  * waiting for events from FS_EventGenerators.
9  */
10 
11 #ifndef __CMD_EvtMonitoringReader_h__
12 #define __CMD_EvtMonitoringReader_h__
13 
14 #include "CMD_API.h"
15 
16 #include <UT/UT_SysClone.h>
17 #include <UT/UT_ValArray.h>
18 
19 class UT_CmdLineReader;
20 class UT_WorkBuffer;
21 class FS_EventGenerator;
22 class cmd_PollingEvtGeneratorWrapper;
23 
25 {
26 public:
27 
28  // The singleton instance of this class will only be created if the
29  // static inst() method is called. When the instance is created,
30  // it will register itself as the place where all generators should
31  // be installed.
32  static CMD_EvtMonitoringReader& inst();
33 
34  // Read a line of input using the command line reader into the buffer,
35  // processing any events generated by installed event generators.
36  // Returns true if a line of input was read.
37  enum GetlineResult { SUCCESS, FAILED, INTERRUPTED };
38  GetlineResult getline(UT_CmdLineReader &cmdline_reader, UT_WorkBuffer &buf);
39 
40 private:
41  static int installGeneratorCallback(FS_EventGenerator *generator, int mode);
42  static void pollEventGeneratorsCallback(bool /*drain_queue*/);
43 
44  int installGenerator(FS_EventGenerator &gen, int mode);
45  void pollEventGenerators();
46 
48 
50 };
51 
52 #endif
53 
GA_API const UT_StringHolder gen
GLenum mode
Definition: glcorearb.h:98
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
#define CMD_API
Definition: CMD_API.h:10