#include <msp/time/timestamp.h>
#include "geometry.h"
#include "sensor.h"
+#include "clock.h"
namespace R2C2 {
class ArticleNumber;
+class BeamGate;
class Block;
class Catalogue;
class Driver;
public:
class Loader: public Msp::DataFile::ObjectLoader<Layout>
{
- private:
- bool new_tracks;
-
public:
Loader(Layout &);
private:
+ void beamgate();
+ void clock();
void route();
- void route(const std::string &);
void signal(ArticleNumber);
- void track(unsigned);
+ void terrain(ArticleNumber);
void track(ArticleNumber);
- void train(unsigned, unsigned, const std::string &);
void train(ArticleNumber, unsigned, const std::string &);
void turnout(unsigned, unsigned);
void zone();
private:
Catalogue &catalogue;
Driver *driver;
+ Clock clock;
std::string base;
Storage<Object> objects;
Storage<TrackChain> track_chains;
Storage<Sensor> sensors;
std::map<unsigned, Train *> trains;
Msp::Time::TimeStamp last_tick;
- unsigned next_turnout_id;
+ unsigned next_turnout_addr;
public:
Layout(Catalogue &, Driver * = 0);
Catalogue &get_catalogue() const { return catalogue; }
bool has_driver() const { return driver; }
Driver &get_driver() const;
+ Clock &get_clock() { return clock; }
const std::string &get_base() const { return base; }
void add(Object &);
void add(TrackChain &);
void add(Block &);
void add(Sensor &);
+ void add(BeamGate &);
template<typename T>
const std::set<T *> &get_all() const;
void remove(Track &);
void remove(TrackChain &);
void remove(Sensor &);
+ void remove(BeamGate &);
- unsigned allocate_turnout_id();
+ unsigned allocate_turnout_address();
Block &get_block(unsigned) const;
void create_blocks();