From: Mikko Rasa Date: Thu, 9 Apr 2015 07:01:40 +0000 (+0300) Subject: Make Client hold a non-const reference to the Catalogue X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7b4155fa0581d7c5fe198e4fb1dea61fa0846eec;p=r2c2.git Make Client hold a non-const reference to the Catalogue Since the entire catalogue is no longer loaded at once, it needs to be non-const so things can be loaded on the fly. --- diff --git a/source/network/client.cpp b/source/network/client.cpp index 41cd28e..ec8e408 100644 --- a/source/network/client.cpp +++ b/source/network/client.cpp @@ -6,7 +6,7 @@ using namespace Msp; namespace R2C2 { -Client::Client(const Catalogue &c): +Client::Client(Catalogue &c): catalogue(c), socket(0), comm(0), diff --git a/source/network/client.h b/source/network/client.h index a8f043e..02931e5 100644 --- a/source/network/client.h +++ b/source/network/client.h @@ -28,7 +28,7 @@ public: sigc::signal signal_error; private: - const Catalogue &catalogue; + Catalogue &catalogue; Protocol proto; Msp::Net::StreamSocket *socket; Msp::Net::Communicator *comm; @@ -39,7 +39,7 @@ private: std::map trains; public: - Client(const Catalogue &); + Client(Catalogue &); ~Client(); void use_event_dispatcher(Msp::IO::EventDispatcher &); @@ -49,7 +49,7 @@ public: void send(const P &pkt) { if(comm) comm->send(pkt); } - const Catalogue &get_catalogue() const { return catalogue; } + Catalogue &get_catalogue() const { return catalogue; } const std::list &get_routes() const { return routes; } void set_power(bool); void set_halt(bool);