c39aaa1bc307d9f43ac8f8daf9ee1442ced62e11
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

1) /* Blinker
2)    Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org>
3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
4)    a blinkenarea.org project */
5) 
6) #ifndef BLINKER_OPPRINTER_H
7) #define BLINKER_OPPRINTER_H
8) 
Stefan Schuermans fix operator connection pri...

Stefan Schuermans authored 12 years ago

9) #include <set>
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

10) #include <string>
11) 
12) #include "Directory.h"
13) #include "File.h"
14) #include "Mgrs.h"
15) #include "Module.h"
16) #include "OpConn.h"
17) #include "OpConnIf.h"
18) #include "OpReqIf.h"
19) 
20) namespace Blinker {
21) 
22) /// a operator connection printer
23) class OpPrinter: public Module, public OpReqIf
24) {
Stefan Schuermans fix operator connection pri...

Stefan Schuermans authored 12 years ago

25) public:
26)   /// type for set of open operator connections
27)   typedef std::set<OpConn *> OpConns;
28) 
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

29) public:
30)   /**
31)    * @brief constructor
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

32)    * @param[in] name module name
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

33)    * @param[in] mgrs managers
34)    * @param[in] dirBase base directory
35)    */
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

36)   OpPrinter(const std::string &name, Mgrs &mgrs, const Directory &dirBase);
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

37) 
38)   /// virtual destructor
39)   virtual ~OpPrinter();
40) 
41) private:
42)   /// copy constructor disabled
43)   OpPrinter(const OpPrinter &that);
44) 
45)   /// assignment operator disabled
46)   const OpPrinter & operator=(const OpPrinter &that);
47) 
48) public:
49)   /// check for update of configuration
50)   virtual void updateConfig();
51) 
52)   /**
53)    * @brief check if accepting new operator connction is possible
54)    * @param[in] name operator interface name
55)    * @return if accepting new connection is possible
56)    */
57)   virtual bool acceptNewOpConn(const std::string &name);
58) 
59)   /**
60)    * @brief new operator connection
61)    * @param[in] name operator interface name
62)    * @param[in] pConn operator connection object
Stefan Schuermans clarified operator connecti...

Stefan Schuermans authored 12 years ago

63)    *
64)    * The new connection may not yet be used for sending inside this callback.
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

65)    */
66)   virtual void newOpConn(const std::string &name, OpConn *pConn);
67) 
Stefan Schuermans implemented play and key me...

Stefan Schuermans authored 12 years ago

68)   /**
69)    * @brief key command received on operator connection
70)    * @param[in] pConn operator connection object
71)    * @param[in] key key that was pressed
72)    */
73)   virtual void opConnRecvKey(OpConn *pConn, char key);
74) 
75)   /**
76)    * @brief play command received on operator connection
77)    * @param[in] pConn operator connection object
78)    * @param[in] sound name of sound to play
79)    */
80)   virtual void opConnRecvPlay(OpConn *pConn, const std::string &sound);
81) 
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

82)   /**
83)    * @brief operator connection is closed
84)    * @param[in] pConn operator connection object
Stefan Schuermans clarified operator connecti...

Stefan Schuermans authored 12 years ago

85)    *
86)    * The connection may not be used for sending any more in this callback.
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

87)    */
88)   virtual void opConnClose(OpConn *pConn);
Stefan Schuermans fix operator connection pri...

Stefan Schuermans authored 12 years ago

89) 
90) protected:
91)   OpConns m_opConns; ///< open operator connections