#define LIBR2C2_CATALOGUE_H_
#include <map>
-#include <msp/datafile/loader.h>
+#include <msp/datafile/objectloader.h>
#include "articlenumber.h"
#include "layout.h"
#include "profile.h"
namespace R2C2 {
+class SignalType;
class TrackType;
class VehicleType;
class Catalogue
{
public:
- class Loader: public Msp::DataFile::BasicLoader<Catalogue>
+ class Loader: public Msp::DataFile::ObjectLoader<Catalogue>
{
public:
Loader(Catalogue &);
void layout();
void rail_profile();
void scale(float, float);
- void track(unsigned);
+ void signal(ArticleNumber);
void track(ArticleNumber);
- void vehicle(unsigned);
void vehicle(ArticleNumber);
};
typedef std::map<ArticleNumber, TrackType *> TrackMap;
typedef std::map<ArticleNumber, VehicleType *> VehicleMap;
+ typedef std::map<ArticleNumber, SignalType *> SignalMap;
sigc::signal<void, const TrackType &> signal_track_added;
sigc::signal<void, const VehicleType &> signal_vehicle_added;
+ sigc::signal<void, const SignalType &> signal_signal_added;
private:
float scale;
float gauge;
Profile rail_profile;
Profile ballast_profile;
- Profile path_profile;
std::string track_technique;
TrackMap tracks;
VehicleMap vehicles;
+ SignalMap signals;
Layout layout;
public:
float get_rail_elevation() const;
const Profile &get_rail_profile() const { return rail_profile; }
const Profile &get_ballast_profile() const { return ballast_profile; }
- const Profile &get_path_profile() const { return path_profile; }
const std::string &get_track_technique() const { return track_technique; }
void add_track(TrackType &);
const VehicleType &get_vehicle(const ArticleNumber &) const;
const VehicleMap &get_vehicles() const { return vehicles; }
+ void add_signal(SignalType &);
+ const SignalType &get_signal(const ArticleNumber &) const;
+ const SignalMap &get_signals() const { return signals; }
+
Layout &get_layout() { return layout; }
};