]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/zone.h
Further improve lead route generation
[r2c2.git] / source / libr2c2 / zone.h
1 #ifndef LIBR2C2_ZONE_H_
2 #define LIBR2C2_ZONE_H_
3
4 #include <set>
5 #include <string>
6 #include <msp/datafile/objectloader.h>
7 #include "trackchain.h"
8
9 namespace R2C2 {
10
11 class Layout;
12 class Track;
13
14 class Zone: public TrackChain
15 {
16 public:
17         class Loader: public Msp::DataFile::ObjectLoader<Zone>
18         {
19         public:
20                 Loader(Zone &);
21         private:
22                 virtual void finish();
23                 void block(unsigned);
24         };
25
26 private:
27         std::string group;
28         std::string qualifier;
29         unsigned number;
30
31 public:
32         Zone(Layout &);
33         ~Zone();
34
35         virtual void set_name(const std::string &);
36         void set_name(const std::string &, const std::string &, unsigned);
37 private:
38         void update_name();
39 public:
40         const std::string &get_group() const { return group; }
41         const std::string &get_qualifier() const { return qualifier; }
42         unsigned get_number() const { return number; }
43
44         void save(std::list<Msp::DataFile::Statement> &) const;
45         virtual Msp::DataFile::Statement save_reference() const;
46 };
47
48 } // namespace R2C2
49
50 #endif