]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/command.h
Forgot to add the new files
[r2c2.git] / source / libmarklin / command.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2007-2008  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef COMMAND_H_
9 #define COMMAND_H_
10
11 #include <ostream>
12 #include <string>
13 #include <sigc++/sigc++.h>
14 #include "constants.h"
15
16 namespace Marklin {
17
18 class Reply;
19
20 class Command
21 {
22 public:
23         sigc::signal<void, const Reply &> signal_done;
24
25 private:
26         Cmd cmd;
27         unsigned char data[128];
28         unsigned len;
29         bool sent;
30
31 public:
32         Command(Cmd, const unsigned char *, unsigned);
33
34         void send(int);
35         bool is_sent() const { return sent; }
36         Cmd get_command() const { return cmd; }
37
38         friend std::ostream &operator<<(std::ostream &, const Command &);
39 };
40
41 } // namespace Marklin
42
43 #endif