]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/zone.h
Create a base class to handle common operations in Block, Route and Zone
[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                 void block(unsigned);
23         };
24
25         sigc::signal<void, const std::string &, const std::string &, unsigned> signal_name_changed;
26
27 private:
28         std::string group;
29         std::string qualifier;
30         unsigned number;
31
32 public:
33         Zone(Layout &);
34         ~Zone();
35
36         void set_name(const std::string &, const std::string &, unsigned);
37         const std::string &get_group() const { return group; }
38         const std::string &get_qualifier() const { return qualifier; }
39         unsigned get_number() const { return number; }
40         std::string get_name() const;
41
42         void save(std::list<Msp::DataFile::Statement> &) const;
43 };
44
45 } // namespace R2C2
46
47 #endif