X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fzone.h;h=fc44d4f205de91ad88bc3b7458310f2a39287996;hb=1c15570729bbce44f0518373ca5bf8bf41cfa3b3;hp=9ff1ba6282d4d1b08e730a06066c75747b70743e;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/libr2c2/zone.h b/source/libr2c2/zone.h index 9ff1ba6..fc44d4f 100644 --- a/source/libr2c2/zone.h +++ b/source/libr2c2/zone.h @@ -4,13 +4,14 @@ #include #include #include +#include "trackchain.h" namespace R2C2 { class Layout; class Track; -class Zone +class Zone: public TrackChain { public: class Loader: public Msp::DataFile::ObjectLoader @@ -18,38 +19,41 @@ public: public: Loader(Zone &); private: + virtual void finish(); void block(unsigned); + void direction_hint(unsigned, Direction); }; - typedef std::set TrackSet; - - sigc::signal signal_name_changed; - private: - Layout &layout; std::string group; std::string qualifier; unsigned number; - TrackSet tracks; + int up_end; public: Zone(Layout &); ~Zone(); + virtual void set_name(const std::string &); void set_name(const std::string &, const std::string &, unsigned); +private: + void update_name(); +public: const std::string &get_group() const { return group; } const std::string &get_qualifier() const { return qualifier; } unsigned get_number() const { return number; } - std::string get_name() const; - void add_track(Track &); - bool add_tracks(const TrackSet &); - const TrackSet &get_tracks() const { return tracks; } - bool has_track(Track &) const; + void set_direction_towards(Track &, Direction); + void clear_direction(); + virtual TrackIter iter_for(Track &, Direction) const; +private: + TrackIter next_iter(const TrackIter &) const; +public: + using TrackChain::get_end; + TrackIter get_end(Direction) const; void save(std::list &) const; -private: - bool is_valid(Track &) const; + virtual Msp::DataFile::Statement save_reference() const; }; } // namespace R2C2