LRT13  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
AsyncPrinter.h
1 #ifndef ASYNC_PRINTER_H_
2 #define ASYNC_PRINTER_H_
3 
4 #include <WPILib.h>
5 #include <queue>
6 #include <string>
7 
8 #include "../Process/AsyncProcess.h"
9 
15 class AsyncPrinter : public AsyncProcess
16 {
17 public:
18  static AsyncPrinter* Instance();
19  static void Finalize();
20 
21  static int Printf(const char* msg, ...);
22  static int Println(const char* msg, ...);
23  static void DbgPrint(const char* msg, ...);
24 
25  AsyncPrinter();
26  ~AsyncPrinter();
27 
28  static const UINT32 kMaxQueueSize = 4096;
29  static const UINT32 kMaxPrintsPerCycle = 50;
30 
31 protected:
32  INT32 Tick();
33 
34 private:
35  static AsyncPrinter* _instance;
36 
37  SEM_ID m_queueSem;
38 
39  queue<string> _messageQueue;
40 };
41 
42 #endif