diff options
Diffstat (limited to 'generator/group.h')
| -rw-r--r-- | generator/group.h | 30 |
1 files changed, 12 insertions, 18 deletions
| diff --git a/generator/group.h b/generator/group.h index 83f40c2..5486fbe 100644 --- a/generator/group.h +++ b/generator/group.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include <set> | 5 | #include <set> |
| 6 | #include <string> | 6 | #include <string> |
| 7 | #include <cassert> | 7 | #include <cassert> |
| 8 | #include "../lib/role.h" | 8 | #include "role.h" |
| 9 | 9 | ||
| 10 | namespace verbly { | 10 | namespace verbly { |
| 11 | namespace generator { | 11 | namespace generator { |
| @@ -20,13 +20,13 @@ namespace verbly { | |||
| 20 | 20 | ||
| 21 | group(); | 21 | group(); |
| 22 | 22 | ||
| 23 | // Mutators | 23 | explicit group(const group& parent); |
| 24 | 24 | ||
| 25 | void setParent(const group& parent); | 25 | // Mutators |
| 26 | 26 | ||
| 27 | void addRole(role r); | 27 | void addRole(role r); |
| 28 | 28 | ||
| 29 | void addFrame(const frame& f); | 29 | void addFrame(frame f); |
| 30 | 30 | ||
| 31 | // Accessors | 31 | // Accessors |
| 32 | 32 | ||
| @@ -35,24 +35,19 @@ namespace verbly { | |||
| 35 | return id_; | 35 | return id_; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | bool hasParent() const | 38 | const std::set<std::string>& getRoles() const |
| 39 | { | ||
| 40 | return (parent_ != nullptr); | ||
| 41 | } | ||
| 42 | |||
| 43 | const group& getParent() const | ||
| 44 | { | 39 | { |
| 45 | // Calling code should always call hasParent first | 40 | return roleNames_; |
| 46 | assert(parent_ != nullptr); | ||
| 47 | |||
| 48 | return *parent_; | ||
| 49 | } | 41 | } |
| 50 | 42 | ||
| 51 | std::set<std::string> getRoles() const; | 43 | bool hasRole(std::string name) const; |
| 52 | 44 | ||
| 53 | const role& getRole(std::string name) const; | 45 | const role& getRole(std::string name) const; |
| 54 | 46 | ||
| 55 | std::set<const frame*> getFrames() const; | 47 | const std::list<frame>& getFrames() const |
| 48 | { | ||
| 49 | return frames_; | ||
| 50 | } | ||
| 56 | 51 | ||
| 57 | private: | 52 | private: |
| 58 | 53 | ||
| @@ -60,9 +55,8 @@ namespace verbly { | |||
| 60 | 55 | ||
| 61 | const int id_; | 56 | const int id_; |
| 62 | 57 | ||
| 63 | const group* parent_ = nullptr; | ||
| 64 | std::map<std::string, role> roles_; | 58 | std::map<std::string, role> roles_; |
| 65 | std::set<const frame*> frames_; | 59 | std::list<frame> frames_; |
| 66 | 60 | ||
| 67 | // Caches | 61 | // Caches |
| 68 | 62 | ||
