11 #include <gnumber.hpp>
12 #include <gwrapper.hpp>
94 virtual bool isBoolExpr()
const {
return false;}
95 virtual bool isNumExpr()
const {
return false;}
96 virtual bool isTextExpr()
const {
return false;}
97 GExpr* toExpr()
override {
return this;}
107 GPropType& type()
const override {
return Type();}
112 std::vector<T>& vect_;
114 VectArg(std::vector<T>& v) : vect_(v) {}
115 auto operator[](GNumPropRef index) {
116 return GPropRef(*
new GVectorWrapper<T>(index.prop_, vect_));
123 std::vector<T>& vect_;
126 auto operator[](GNumPropRef index) {
127 return GNumPropRef(*
new GNumVectorWrapper<T>(index.prop_, vect_));
132 Equal, NotEqual, Greater, GreaterEqual, Less, LessEqual,
133 And, Or, Not, Identity, Add, Substract, Multiply, Divide,
134 StrStart, StrContain, StrRegex
138 friend class GExprWrapper;
147 void bindImpl(
class GExprWrapper&);
148 void linkImpl(
class GExprTrigger&,
class GBoolExpr&,
bool trigger_or_guard);
157 template <class T, std::enable_if_t<std::is_arithmetic<T>::value,
int> = 0>
158 inline GExpr::NumVectArg<T> operator~(std::vector<T>& vect) {
159 return GExpr::NumVectArg<T>(vect);
162 template <class T, std::enable_if_t<std::is_compound<T>::value,
int> = 0>
163 inline GExpr::VectArg<T> operator~(std::vector<T>& vect) {
164 return GExpr::VectArg<T>(vect);
170 GBoolExpr& operator!(GExprBool
const& a);
174 GBoolExpr& operator&&(GExprBool
const& a, GExprBool
const& b);
175 GBoolExpr& operator&&(GExprBool
const& a, std::function<
bool()>
const& fun);
178 GBoolExpr& operator||(GExprBool
const& a, GExprBool
const& b);
179 GBoolExpr& operator||(GExprBool
const& a, std::function<
bool()>
const& fun);
181 GBoolExpr& operator==(GExprBool
const& a, GExprBool
const& b);
182 GBoolExpr& operator!=(GExprBool
const& a, GExprBool
const& b);
184 GBoolExpr& operator==(GExprNumber
const& a, GExprNumber
const& b);
185 GBoolExpr& operator!=(GExprNumber
const& a, GExprNumber
const& b);
186 GBoolExpr& operator> (GExprNumber
const& a, GExprNumber
const& b);
187 GBoolExpr& operator>=(GExprNumber
const& a, GExprNumber
const& b);
188 GBoolExpr& operator< (GExprNumber
const& a, GExprNumber
const& b);
189 GBoolExpr& operator<=(GExprNumber
const& a, GExprNumber
const& b);
191 GNumExpr& operator+(GExprNumber
const& a, GExprNumber
const& b);
192 GNumExpr& operator-(GExprNumber
const& a, GExprNumber
const& b);
193 GNumExpr& operator*(GExprNumber
const& a, GExprNumber
const& b);
194 GNumExpr& operator/(GExprNumber
const& a, GExprNumber
const& b);
197 GBoolExpr& operator==(GExprText
const& a, GExprText
const& b);
200 GBoolExpr& operator^=(GExprText
const& a, GExprText
const& begin);
203 GBoolExpr& operator*=(GExprText
const& a, GExprText
const& substr);
206 GBoolExpr& operator%=(GExprText
const& s, GExprText
const& regex);
208 GBoolExpr& operator!=(GExprText
const& a, GExprText
const& b);
209 GBoolExpr& operator> (GExprText
const& a, GExprText
const& b);
210 GBoolExpr& operator>=(GExprText
const& a, GExprText
const& b);
211 GBoolExpr& operator< (GExprText
const& a, GExprText
const& b);
212 GBoolExpr& operator<=(GExprText
const& a, GExprText
const& b);
214 GTextExpr& operator+(GExprText
const& a, GExprText
const& b);
215 GTextExpr& operator+(GExprText
const& a, GExprNumber
const& b);
216 GTextExpr& operator+(GExprNumber
const& a, GExprText
const& b);
224 enum Type {TBool, TNum, TText};
228 bool isBoolExpr()
const override {
return true;}
229 bool isNumber()
const override {
return true;}
230 GBoolExpr* toBoolExpr()
override {
return this;}
236 void linkWithTrigger(
class GExprTrigger&);
249 bool isTextExpr()
const override {
return true;}
250 bool isString()
const override {
return true;}
265 bool isNumExpr()
const override {
return true;}
266 bool isNumber()
const override {
return true;}