b6b2996b76e1b0f0e403b4be40430a445bc0873c
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

1) /* Blinker
Stefan Schuermans update copyright years

Stefan Schuermans authored 10 years ago

2)    Copyright 2011-2014 Stefan Schuermans <stefan@blinkenarea.org>
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

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"
Stefan Schuermans OpPrinter: play sound on co...

Stefan Schuermans authored 12 years ago

19) #include "TimeCallee.h"
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

20) 
21) namespace Blinker {
22) 
23) /// a operator connection printer
Stefan Schuermans OpPrinter: play sound on co...

Stefan Schuermans authored 12 years ago

24) class OpPrinter: public Module, public OpReqIf, public TimeCallee
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

25) {
Stefan Schuermans fix operator connection pri...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

38) 
39)   /// virtual destructor
40)   virtual ~OpPrinter();
41) 
42) private:
43)   /// copy constructor disabled
44)   OpPrinter(const OpPrinter &that);
45) 
46)   /// assignment operator disabled
47)   const OpPrinter & operator=(const OpPrinter &that);
48) 
49) public:
50)   /// check for update of configuration
51)   virtual void updateConfig();
52) 
Stefan Schuermans OpPrinter: play sound on co...

Stefan Schuermans authored 12 years ago

53)   /// callback when requested time reached
54)   virtual void timeCall();
55) 
Stefan Schuermans implement operator connecti...

Stefan Schuermans authored 12 years ago

56)   /**
57)    * @brief check if accepting new operator connction is possible
58)    * @param[in] name operator interface name
59)    * @return if accepting new connection is possible
60)    */
61)   virtual bool acceptNewOpConn(const std::string &name);
62) 
63)   /**
64)    * @brief new operator connection
65)    * @param[in] name operator interface name
66)    * @param[in] pConn operator connection object
Stefan Schuermans clarified operator connecti...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

86)   /**
87)    * @brief operator connection is closed
88)    * @param[in] pConn operator connection object
Stefan Schuermans clarified operator connecti...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

93) 
94) protected:
Stefan Schuermans OpPrinter: play sound on co...

Stefan Schuermans authored 12 years ago

95)   OpConns m_opConns;  ///< open operator connections
96)   OpConns m_sendPlay; ///< connections to send play request on