summary refs log tree commit diff stats
path: root/lib/selrestr.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/selrestr.h')
-rw-r--r--lib/selrestr.h56
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/selrestr.h b/lib/selrestr.h index 9f82e3e..a7cde0a 100644 --- a/lib/selrestr.h +++ b/lib/selrestr.h
@@ -6,7 +6,7 @@
6#include "../vendor/json/json.hpp" 6#include "../vendor/json/json.hpp"
7 7
8namespace verbly { 8namespace verbly {
9 9
10 class selrestr { 10 class selrestr {
11 public: 11 public:
12 enum class type { 12 enum class type {
@@ -14,63 +14,63 @@ namespace verbly {
14 singleton, 14 singleton,
15 group 15 group
16 }; 16 };
17 17
18 // Construct from json 18 // Construct from json
19 19
20 explicit selrestr(nlohmann::json json); 20 explicit selrestr(nlohmann::json json);
21 21
22 // Copy and move constructors 22 // Copy and move constructors
23 23
24 selrestr(const selrestr& other); 24 selrestr(const selrestr& other);
25 selrestr(selrestr&& other); 25 selrestr(selrestr&& other);
26 26
27 // Assignment 27 // Assignment
28 28
29 selrestr& operator=(selrestr other); 29 selrestr& operator=(selrestr other);
30 30
31 // Swap 31 // Swap
32 32
33 friend void swap(selrestr& first, selrestr& second); 33 friend void swap(selrestr& first, selrestr& second);
34 34
35 // Destructor 35 // Destructor
36 36
37 ~selrestr(); 37 ~selrestr();
38 38
39 // Generic accessors 39 // Generic accessors
40 40
41 type getType() const 41 type getType() const
42 { 42 {
43 return type_; 43 return type_;
44 } 44 }
45 45
46 // Empty 46 // Empty
47 47
48 selrestr(); 48 selrestr();
49 49
50 // Singleton 50 // Singleton
51 51
52 selrestr(std::string restriction, bool pos); 52 selrestr(std::string restriction, bool pos);
53 53
54 std::string getRestriction() const; 54 std::string getRestriction() const;
55 55
56 bool getPos() const; 56 bool getPos() const;
57 57
58 // Group 58 // Group
59 59
60 selrestr(std::list<selrestr> children, bool orlogic); 60 selrestr(std::list<selrestr> children, bool orlogic);
61 61
62 std::list<selrestr> getChildren() const; 62 std::list<selrestr> getChildren() const;
63 63
64 std::list<selrestr>::const_iterator begin() const; 64 std::list<selrestr>::const_iterator begin() const;
65 65
66 std::list<selrestr>::const_iterator end() const; 66 std::list<selrestr>::const_iterator end() const;
67 67
68 bool getOrlogic() const; 68 bool getOrlogic() const;
69 69
70 // Helpers 70 // Helpers
71 71
72 nlohmann::json toJson() const; 72 nlohmann::json toJson() const;
73 73
74 private: 74 private:
75 union { 75 union {
76 struct { 76 struct {