X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnetwork%2Fclient.h;h=a8f043e575e0fde9996adaec7f314a3a8983488d;hb=528c4f8760ac54fb2d1f3002248ecf6774956030;hp=2ab8722f1eb8f24dca84c2e223904b30295ee327;hpb=9ddcd066e37e4c72685817c042c30897786ece05;p=r2c2.git diff --git a/source/network/client.h b/source/network/client.h index 2ab8722..a8f043e 100644 --- a/source/network/client.h +++ b/source/network/client.h @@ -1,23 +1,18 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2009 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - -#ifndef MARKLINNET_CLIENT_H_ -#define MARKLINNET_CLIENT_H_ +#ifndef R2C2_NET_CLIENT_H_ +#define R2C2_NET_CLIENT_H_ #include #include -#include "libmarklin/catalogue.h" +#include "libr2c2/catalogue.h" #include "packets.h" #include "protocol.h" #include "train.h" -namespace Marklin { +namespace R2C2 { -class Client: public Msp::Net::PacketReceiver, +class Client: Msp::Net::PacketReceiver, + Msp::Net::PacketReceiver, + Msp::Net::PacketReceiver, Msp::Net::PacketReceiver, Msp::Net::PacketReceiver, Msp::Net::PacketReceiver, @@ -26,6 +21,9 @@ class Client: public Msp::Net::PacketReceiver, Msp::Net::PacketReceiver { public: + sigc::signal signal_power_changed; + sigc::signal signal_halt_changed; + sigc::signal signal_emergency; sigc::signal signal_train_added; sigc::signal signal_error; @@ -35,6 +33,8 @@ private: Msp::Net::StreamSocket *socket; Msp::Net::Communicator *comm; Msp::IO::EventDispatcher *event_disp; + bool power; + bool halt; std::list routes; std::map trains; @@ -51,10 +51,14 @@ public: const Catalogue &get_catalogue() const { return catalogue; } const std::list &get_routes() const { return routes; } + void set_power(bool); + void set_halt(bool); NetTrain &get_train(unsigned) const; const std::map &get_trains() const { return trains; } private: + virtual void receive(const DriverStatePacket &); + virtual void receive(const EmergencyPacket &); virtual void receive(const TrainInfoPacket &); virtual void receive(const TrainControlPacket &); virtual void receive(const TrainFunctionPacket &); @@ -64,6 +68,6 @@ private: virtual void receive(const ErrorPacket &); }; -} // namespace Marklin +} // namespace R2C2 #endif