Open Lighting Architecture  0.9.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Client.h
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15  *
16  * client.h
17  * Header file for the client class
18  * Copyright (C) 2005 Simon Newton
19  */
20 
21 #ifndef OLAD_CLIENT_H_
22 #define OLAD_CLIENT_H_
23 
24 #include <map>
25 #include "common/rpc/RpcController.h"
26 #include "ola/base/Macro.h"
27 #include "olad/DmxSource.h"
28 
29 namespace ola {
30 namespace proto {
31 class OlaClientService_Stub;
32 class Ack;
33 }
34 }
35 
36 namespace ola {
37 
38 class Client {
39  public :
40  explicit Client(ola::proto::OlaClientService_Stub *client_stub)
41  : m_client_stub(client_stub) {}
42  virtual ~Client();
43  virtual bool SendDMX(unsigned int universe_id, uint8_t priority,
44  const DmxBuffer &buffer);
45 
46  void SendDMXCallback(ola::rpc::RpcController *controller,
47  ola::proto::Ack *ack);
48  void DMXReceived(unsigned int universe, const DmxSource &source);
49  const DmxSource SourceData(unsigned int universe) const;
50  class ola::proto::OlaClientService_Stub *Stub() const {
51  return m_client_stub;
52  }
53 
54  private:
55  class ola::proto::OlaClientService_Stub *m_client_stub;
56  std::map<unsigned int, DmxSource> m_data_map;
57 
59 };
60 } // namespace ola
61 #endif // OLAD_CLIENT_H_