]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/command.h
Forgot to add the new files
[r2c2.git] / source / libmarklin / command.h
index 4e4c9866d1a705c3d125d852b8deab045897bd76..e6123c31b625390842c09b7aa22fea64065a18dc 100644 (file)
@@ -1,26 +1,41 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2007-2008  Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
 #ifndef COMMAND_H_
 #define COMMAND_H_
 
+#include <ostream>
 #include <string>
 #include <sigc++/sigc++.h>
 #include "constants.h"
 
 namespace Marklin {
 
+class Reply;
+
 class Command
 {
+public:
+       sigc::signal<void, const Reply &> signal_done;
+
 private:
-       std::string cmd;
-       bool        sent;
+       Cmd cmd;
+       unsigned char data[128];
+       unsigned len;
+       bool sent;
 
 public:
-       sigc::signal<void, Error, const std::string &> signal_done;
+       Command(Cmd, const unsigned char *, unsigned);
 
-       Command(const std::string &);
+       void send(int);
+       bool is_sent() const { return sent; }
+       Cmd get_command() const { return cmd; }
 
-       void              set_sent(bool);
-       const std::string &get_command() const { return cmd; }
-       bool              get_sent() const     { return sent; }
+       friend std::ostream &operator<<(std::ostream &, const Command &);
 };
 
 } // namespace Marklin