1 /******************************************************************************
3 * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software Foundation *
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ******************************************************************************/
20 #include "base/value.hpp"
21 #include "base/array.hpp"
22 #include "base/dictionary.hpp"
23 #include "base/datetime.hpp"
24 #include "base/convert.hpp"
25 #include "base/utility.hpp"
26 #include "base/objectlock.hpp"
27 #include <boost/lexical_cast.hpp>
29 using namespace icinga;
31 Value::operator double() const
33 const double *value = boost::get<double>(&m_Value);
38 const bool *fvalue = boost::get<bool>(&m_Value);
47 return boost::lexical_cast<double>(m_Value);
48 } catch (const std::exception&) {
49 std::ostringstream msgbuf;
50 msgbuf << "Can't convert '" << *this << "' to a floating point number.";
51 BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
55 Value::operator String() const
63 return Convert::ToString(boost::get<double>(m_Value));
65 if (boost::get<bool>(m_Value))
70 return boost::get<String>(m_Value);
72 object = boost::get<Object::Ptr>(m_Value).get();
73 return object->ToString();
75 BOOST_THROW_EXCEPTION(std::runtime_error("Unknown value type."));
79 std::ostream& icinga::operator<<(std::ostream& stream, const Value& value)
81 if (value.IsBoolean())
82 stream << static_cast<int>(value);
84 stream << static_cast<String>(value);
89 std::istream& icinga::operator>>(std::istream& stream, Value& value)
97 bool Value::operator==(bool rhs) const
99 return *this == Value(rhs);
102 bool Value::operator!=(bool rhs) const
104 return !(*this == rhs);
107 bool Value::operator==(int rhs) const
109 return *this == Value(rhs);
112 bool Value::operator!=(int rhs) const
114 return !(*this == rhs);
117 bool Value::operator==(double rhs) const
119 return *this == Value(rhs);
122 bool Value::operator!=(double rhs) const
124 return !(*this == rhs);
127 bool Value::operator==(const char *rhs) const
129 return static_cast<String>(*this) == rhs;
132 bool Value::operator!=(const char *rhs) const
134 return !(*this == rhs);
137 bool Value::operator==(const String& rhs) const
139 return static_cast<String>(*this) == rhs;
142 bool Value::operator!=(const String& rhs) const
144 return !(*this == rhs);
147 bool Value::operator==(const Value& rhs) const
149 if (IsNumber() && rhs.IsNumber())
150 return Get<double>() == rhs.Get<double>();
151 else if ((IsBoolean() || IsNumber()) && (rhs.IsBoolean() || rhs.IsNumber()) && !(IsEmpty() && rhs.IsEmpty()))
152 return static_cast<double>(*this) == static_cast<double>(rhs);
154 if (IsString() && rhs.IsString())
155 return Get<String>() == rhs.Get<String>();
156 else if ((IsString() || IsEmpty()) && (rhs.IsString() || rhs.IsEmpty()) && !(IsEmpty() && rhs.IsEmpty()))
157 return static_cast<String>(*this) == static_cast<String>(rhs);
159 if (IsEmpty() != rhs.IsEmpty())
165 if (IsObject() != rhs.IsObject())
169 if (IsObjectType<DateTime>() && rhs.IsObjectType<DateTime>()) {
170 DateTime::Ptr dt1 = *this;
171 DateTime::Ptr dt2 = rhs;
173 return dt1->GetValue() == dt2->GetValue();
176 if (IsObjectType<Array>() && rhs.IsObjectType<Array>()) {
177 Array::Ptr arr1 = *this;
178 Array::Ptr arr2 = rhs;
183 if (arr1->GetLength() != arr2->GetLength())
186 for (Array::SizeType i = 0; i < arr1->GetLength(); i++) {
187 if (arr1->Get(i) != arr2->Get(i))
194 return Get<Object::Ptr>() == rhs.Get<Object::Ptr>();
200 bool Value::operator!=(const Value& rhs) const
202 return !(*this == rhs);
205 Value icinga::operator+(const Value& lhs, const char *rhs)
207 return lhs + Value(rhs);
210 Value icinga::operator+(const char *lhs, const Value& rhs)
212 return Value(lhs) + rhs;
215 Value icinga::operator+(const Value& lhs, const String& rhs)
217 return lhs + Value(rhs);
220 Value icinga::operator+(const String& lhs, const Value& rhs)
222 return Value(lhs) + rhs;
225 Value icinga::operator+(const Value& lhs, const Value& rhs)
227 if ((lhs.IsEmpty() || lhs.IsNumber()) && !lhs.IsString() && (rhs.IsEmpty() || rhs.IsNumber()) && !rhs.IsString() && !(lhs.IsEmpty() && rhs.IsEmpty()))
228 return static_cast<double>(lhs) + static_cast<double>(rhs);
229 if ((lhs.IsString() || lhs.IsEmpty() || lhs.IsNumber()) && (rhs.IsString() || rhs.IsEmpty() || rhs.IsNumber()) && (!(lhs.IsEmpty() && rhs.IsEmpty()) || lhs.IsString() || rhs.IsString()))
230 return static_cast<String>(lhs) + static_cast<String>(rhs);
231 else if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
232 return static_cast<double>(lhs) + static_cast<double>(rhs);
233 else if (lhs.IsObjectType<DateTime>() && rhs.IsNumber())
234 return new DateTime(Convert::ToDateTimeValue(lhs) + rhs);
235 else if ((lhs.IsObjectType<Array>() || lhs.IsEmpty()) && (rhs.IsObjectType<Array>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) {
236 Array::Ptr result = new Array();
238 static_cast<Array::Ptr>(lhs)->CopyTo(result);
240 static_cast<Array::Ptr>(rhs)->CopyTo(result);
242 } else if ((lhs.IsObjectType<Dictionary>() || lhs.IsEmpty()) && (rhs.IsObjectType<Dictionary>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) {
243 Dictionary::Ptr result = new Dictionary();
245 static_cast<Dictionary::Ptr>(lhs)->CopyTo(result);
247 static_cast<Dictionary::Ptr>(rhs)->CopyTo(result);
250 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator + cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
254 Value icinga::operator+(const Value& lhs, double rhs)
256 return lhs + Value(rhs);
259 Value icinga::operator+(double lhs, const Value& rhs)
261 return Value(lhs) + rhs;
264 Value icinga::operator+(const Value& lhs, int rhs)
266 return lhs + Value(rhs);
269 Value icinga::operator+(int lhs, const Value& rhs)
271 return Value(lhs) + rhs;
274 Value icinga::operator-(const Value& lhs, const Value& rhs)
276 if ((lhs.IsNumber() || lhs.IsEmpty()) && !lhs.IsString() && (rhs.IsNumber() || rhs.IsEmpty()) && !rhs.IsString() && !(lhs.IsEmpty() && rhs.IsEmpty()))
277 return static_cast<double>(lhs) - static_cast<double>(rhs);
278 else if (lhs.IsObjectType<DateTime>() && rhs.IsNumber())
279 return new DateTime(Convert::ToDateTimeValue(lhs) - rhs);
280 else if (lhs.IsObjectType<DateTime>() && rhs.IsObjectType<DateTime>())
281 return Convert::ToDateTimeValue(lhs) - Convert::ToDateTimeValue(rhs);
282 else if ((lhs.IsObjectType<DateTime>() || lhs.IsEmpty()) && (rhs.IsObjectType<DateTime>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
283 return new DateTime(Convert::ToDateTimeValue(lhs) - Convert::ToDateTimeValue(rhs));
284 else if ((lhs.IsObjectType<Array>() || lhs.IsEmpty()) && (rhs.IsObjectType<Array>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) {
289 Array::Ptr left = lhs;
290 Array::Ptr right = rhs;
292 ObjectLock olock(left);
293 for (const Value& lv : left) {
295 ObjectLock xlock(right);
296 for (const Value& rv : right) {
306 result.push_back(lv);
309 return new Array(std::move(result));
311 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator - cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
314 Value icinga::operator-(const Value& lhs, double rhs)
316 return lhs - Value(rhs);
319 Value icinga::operator-(double lhs, const Value& rhs)
321 return Value(lhs) - rhs;
324 Value icinga::operator-(const Value& lhs, int rhs)
326 return lhs - Value(rhs);
329 Value icinga::operator-(int lhs, const Value& rhs)
331 return Value(lhs) - rhs;
334 Value icinga::operator*(const Value& lhs, const Value& rhs)
336 if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
337 return static_cast<double>(lhs) * static_cast<double>(rhs);
339 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator * cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
342 Value icinga::operator*(const Value& lhs, double rhs)
344 return lhs * Value(rhs);
347 Value icinga::operator*(double lhs, const Value& rhs)
349 return Value(lhs) * rhs;
352 Value icinga::operator*(const Value& lhs, int rhs)
354 return lhs * Value(rhs);
357 Value icinga::operator*(int lhs, const Value& rhs)
359 return Value(lhs) * rhs;
362 Value icinga::operator/(const Value& lhs, const Value& rhs)
365 BOOST_THROW_EXCEPTION(std::invalid_argument("Right-hand side argument for operator / is Empty."));
366 else if ((lhs.IsEmpty() || lhs.IsNumber()) && rhs.IsNumber()) {
367 if (static_cast<double>(rhs) == 0)
368 BOOST_THROW_EXCEPTION(std::invalid_argument("Right-hand side argument for operator / is 0."));
370 return static_cast<double>(lhs) / static_cast<double>(rhs);
372 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator / cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
375 Value icinga::operator/(const Value& lhs, double rhs)
377 return lhs / Value(rhs);
380 Value icinga::operator/(double lhs, const Value& rhs)
382 return Value(lhs) / rhs;
385 Value icinga::operator/(const Value& lhs, int rhs)
387 return lhs / Value(rhs);
390 Value icinga::operator/(int lhs, const Value& rhs)
392 return Value(lhs) / rhs;
395 Value icinga::operator%(const Value& lhs, const Value& rhs)
398 BOOST_THROW_EXCEPTION(std::invalid_argument("Right-hand side argument for operator % is Empty."));
399 else if ((rhs.IsNumber() || lhs.IsNumber()) && rhs.IsNumber()) {
400 if (static_cast<double>(rhs) == 0)
401 BOOST_THROW_EXCEPTION(std::invalid_argument("Right-hand side argument for operator % is 0."));
403 return static_cast<int>(lhs) % static_cast<int>(rhs);
405 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator % cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
408 Value icinga::operator%(const Value& lhs, double rhs)
410 return lhs % Value(rhs);
413 Value icinga::operator%(double lhs, const Value& rhs)
415 return Value(lhs) % rhs;
418 Value icinga::operator%(const Value& lhs, int rhs)
420 return lhs % Value(rhs);
423 Value icinga::operator%(int lhs, const Value& rhs)
425 return Value(lhs) % rhs;
428 Value icinga::operator^(const Value& lhs, const Value& rhs)
430 if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
431 return static_cast<int>(lhs) ^ static_cast<int>(rhs);
433 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator & cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
436 Value icinga::operator^(const Value& lhs, double rhs)
438 return lhs ^ Value(rhs);
441 Value icinga::operator^(double lhs, const Value& rhs)
443 return Value(lhs) ^ rhs;
446 Value icinga::operator^(const Value& lhs, int rhs)
448 return lhs ^ Value(rhs);
451 Value icinga::operator^(int lhs, const Value& rhs)
453 return Value(lhs) ^ rhs;
456 Value icinga::operator&(const Value& lhs, const Value& rhs)
458 if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
459 return static_cast<int>(lhs) & static_cast<int>(rhs);
461 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator & cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
464 Value icinga::operator&(const Value& lhs, double rhs)
466 return lhs & Value(rhs);
469 Value icinga::operator&(double lhs, const Value& rhs)
471 return Value(lhs) & rhs;
474 Value icinga::operator&(const Value& lhs, int rhs)
476 return lhs & Value(rhs);
479 Value icinga::operator&(int lhs, const Value& rhs)
481 return Value(lhs) & rhs;
484 Value icinga::operator|(const Value& lhs, const Value& rhs)
486 if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
487 return static_cast<int>(lhs) | static_cast<int>(rhs);
489 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator | cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
492 Value icinga::operator|(const Value& lhs, double rhs)
494 return lhs | Value(rhs);
497 Value icinga::operator|(double lhs, const Value& rhs)
499 return Value(lhs) | rhs;
502 Value icinga::operator|(const Value& lhs, int rhs)
504 return lhs | Value(rhs);
507 Value icinga::operator|(int lhs, const Value& rhs)
509 return Value(lhs) | rhs;
512 Value icinga::operator<<(const Value& lhs, const Value& rhs)
514 if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
515 return static_cast<int>(lhs) << static_cast<int>(rhs);
517 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator << cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
520 Value icinga::operator<<(const Value& lhs, double rhs)
522 return lhs << Value(rhs);
525 Value icinga::operator<<(double lhs, const Value& rhs)
527 return Value(lhs) << rhs;
530 Value icinga::operator<<(const Value& lhs, int rhs)
532 return lhs << Value(rhs);
535 Value icinga::operator<<(int lhs, const Value& rhs)
537 return Value(lhs) << rhs;
540 Value icinga::operator>>(const Value& lhs, const Value& rhs)
542 if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
543 return static_cast<int>(lhs) >> static_cast<int>(rhs);
545 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator >> cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
548 Value icinga::operator>>(const Value& lhs, double rhs)
550 return lhs >> Value(rhs);
553 Value icinga::operator>>(double lhs, const Value& rhs)
555 return Value(lhs) >> rhs;
558 Value icinga::operator>>(const Value& lhs, int rhs)
560 return lhs >> Value(rhs);
563 Value icinga::operator>>(int lhs, const Value& rhs)
565 return Value(lhs) >> rhs;
568 bool icinga::operator<(const Value& lhs, const Value& rhs)
570 if (lhs.IsString() && rhs.IsString())
571 return static_cast<String>(lhs) < static_cast<String>(rhs);
572 else if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
573 return static_cast<double>(lhs) < static_cast<double>(rhs);
574 else if ((lhs.IsObjectType<DateTime>() || lhs.IsEmpty()) && (rhs.IsObjectType<DateTime>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
575 return Convert::ToDateTimeValue(lhs) < Convert::ToDateTimeValue(rhs);
576 else if (lhs.IsObjectType<Array>() && rhs.IsObjectType<Array>()) {
577 Array::Ptr larr = lhs;
578 Array::Ptr rarr = rhs;
580 ObjectLock llock(larr);
581 ObjectLock rlock(rarr);
583 Array::SizeType llen = larr->GetLength();
584 Array::SizeType rlen = rarr->GetLength();
586 for (Array::SizeType i = 0; i < std::max(llen, rlen); i++) {
587 Value lval = (i >= llen) ? Empty : larr->Get(i);
588 Value rval = (i >= rlen) ? Empty : rarr->Get(i);
592 else if (lval > rval)
598 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator < cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
601 bool icinga::operator<(const Value& lhs, double rhs)
603 return lhs < Value(rhs);
606 bool icinga::operator<(double lhs, const Value& rhs)
608 return Value(lhs) < rhs;
611 bool icinga::operator<(const Value& lhs, int rhs)
613 return lhs < Value(rhs);
616 bool icinga::operator<(int lhs, const Value& rhs)
618 return Value(lhs) < rhs;
621 bool icinga::operator>(const Value& lhs, const Value& rhs)
623 if (lhs.IsString() && rhs.IsString())
624 return static_cast<String>(lhs) > static_cast<String>(rhs);
625 else if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
626 return static_cast<double>(lhs) > static_cast<double>(rhs);
627 else if ((lhs.IsObjectType<DateTime>() || lhs.IsEmpty()) && (rhs.IsObjectType<DateTime>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
628 return Convert::ToDateTimeValue(lhs) > Convert::ToDateTimeValue(rhs);
629 else if (lhs.IsObjectType<Array>() && rhs.IsObjectType<Array>()) {
630 Array::Ptr larr = lhs;
631 Array::Ptr rarr = rhs;
633 ObjectLock llock(larr);
634 ObjectLock rlock(rarr);
636 Array::SizeType llen = larr->GetLength();
637 Array::SizeType rlen = rarr->GetLength();
639 for (Array::SizeType i = 0; i < std::max(llen, rlen); i++) {
640 Value lval = (i >= llen) ? Empty : larr->Get(i);
641 Value rval = (i >= rlen) ? Empty : rarr->Get(i);
645 else if (lval < rval)
651 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator > cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
654 bool icinga::operator>(const Value& lhs, double rhs)
656 return lhs > Value(rhs);
659 bool icinga::operator>(double lhs, const Value& rhs)
661 return Value(lhs) > rhs;
664 bool icinga::operator>(const Value& lhs, int rhs)
666 return lhs > Value(rhs);
669 bool icinga::operator>(int lhs, const Value& rhs)
671 return Value(lhs) > rhs;
674 bool icinga::operator<=(const Value& lhs, const Value& rhs)
676 if (lhs.IsString() && rhs.IsString())
677 return static_cast<String>(lhs) <= static_cast<String>(rhs);
678 else if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
679 return static_cast<double>(lhs) <= static_cast<double>(rhs);
680 else if ((lhs.IsObjectType<DateTime>() || lhs.IsEmpty()) && (rhs.IsObjectType<DateTime>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
681 return Convert::ToDateTimeValue(lhs) <= Convert::ToDateTimeValue(rhs);
683 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator <= cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
686 bool icinga::operator<=(const Value& lhs, double rhs)
688 return lhs <= Value(rhs);
691 bool icinga::operator<=(double lhs, const Value& rhs)
693 return Value(lhs) <= rhs;
696 bool icinga::operator<=(const Value& lhs, int rhs)
698 return lhs <= Value(rhs);
701 bool icinga::operator<=(int lhs, const Value& rhs)
703 return Value(lhs) <= rhs;
706 bool icinga::operator>=(const Value& lhs, const Value& rhs)
708 if (lhs.IsString() && rhs.IsString())
709 return static_cast<String>(lhs) >= static_cast<String>(rhs);
710 else if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
711 return static_cast<double>(lhs) >= static_cast<double>(rhs);
712 else if ((lhs.IsObjectType<DateTime>() || lhs.IsEmpty()) && (rhs.IsObjectType<DateTime>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
713 return Convert::ToDateTimeValue(lhs) >= Convert::ToDateTimeValue(rhs);
715 BOOST_THROW_EXCEPTION(std::invalid_argument("Operator >= cannot be applied to values of type '" + lhs.GetTypeName() + "' and '" + rhs.GetTypeName() + "'"));
718 bool icinga::operator>=(const Value& lhs, double rhs)
720 return lhs >= Value(rhs);
723 bool icinga::operator>=(double lhs, const Value& rhs)
725 return Value(lhs) >= rhs;
728 bool icinga::operator>=(const Value& lhs, int rhs)
730 return lhs >= Value(rhs);
733 bool icinga::operator>=(int lhs, const Value& rhs)
735 return Value(lhs) >= rhs;