source: XMLIO_V2/external/src/POCO/Foundation.save/Poco/DynamicAny.h @ 80

Last change on this file since 80 was 80, checked in by ymipsl, 14 years ago

ajout lib externe

  • Property svn:eol-style set to native
File size: 51.0 KB
Line 
1//
2// DynamicAny.h
3//
4// $Id: //poco/1.3/Foundation/include/Poco/DynamicAny.h#9 $
5//
6// Library: Foundation
7// Package: Core
8// Module:  DynamicAny
9//
10// Definition of the DynamicAny class.
11//
12// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
13// and Contributors.
14//
15// Permission is hereby granted, free of charge, to any person or organization
16// obtaining a copy of the software and accompanying documentation covered by
17// this license (the "Software") to use, reproduce, display, distribute,
18// execute, and transmit the Software, and to prepare derivative works of the
19// Software, and to permit third-parties to whom the Software is furnished to
20// do so, all subject to the following:
21//
22// The copyright notices in the Software and this entire statement, including
23// the above license grant, this restriction and the following disclaimer,
24// must be included in all copies of the Software, in whole or in part, and
25// all derivative works of the Software, unless such copies or derivative
26// works are solely in the form of machine-executable object code generated by
27// a source language processor.
28//
29// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
32// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
33// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
34// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
35// DEALINGS IN THE SOFTWARE.
36//
37
38
39#ifndef Foundation_DynamicAny_INCLUDED
40#define Foundation_DynamicAny_INCLUDED
41
42
43#include "Poco/Foundation.h"
44#include "Poco/DynamicAnyHolder.h"
45#include "Poco/Format.h"
46#include <typeinfo>
47
48
49namespace Poco {
50
51
52class Foundation_API DynamicAny
53        /// DynamicAny allows to store data of different types and to convert between these types transparently.
54        /// DynamicAny puts forth the best effort to provide intuitive and reasonable conversion semantics and prevent
55        /// unexpected data loss, particularly when performing narrowing or signedness conversions of numeric data types.
56        ///
57        /// An attempt to convert or extract from a non-initialized (empty) DynamicAny variable shall result
58        /// in an exception being thrown.
59        ///
60        /// Loss of signedness is not allowed for numeric values. This means that if an attempt is made to convert
61        /// the internal value which is a negative signed integer to an unsigned integer type storage, a RangeException is thrown.
62        /// Overflow is not allowed, so if the internal value is a larger number than the target numeric type size can accomodate,
63        /// a RangeException is thrown.
64        ///
65        /// Precision loss, such as in conversion from floating-point types to integers or from double to float on platforms
66        /// where they differ in size (provided internal actual value fits in float min/max range), is allowed.
67        ///
68        /// String truncation is allowed -- it is possible to convert between string and character when string length is
69        /// greater than 1. An empty string gets converted to the char '\0', a non-empty string is truncated to the first character.
70        ///
71        /// Boolean conversion is performed as follows:
72        ///
73        /// A string value "false" (not case sensitive), "0" or "" (empty string) can be converted to a boolean value false,
74        /// any other string not being false by the above criteria evaluates to true (e.g: "hi" -> true).
75        /// Integer 0 values are false, everything else is true.
76        /// Floating point values equal to the minimal FP representation on a given platform are false, everything else is true.
77        ///
78        /// Arithmetic operations with POD types as well as between DynamicAny's are supported, subject to following
79        /// limitations:
80        ///
81        ///     - for std::string and const char* values, only '+' and '+=' operations are supported
82        ///
83        ///     - for integral and floating point numeric values, following operations are supported:
84        ///       '+', '+=', '-', '-=', '*', '*=' , '/' and '/='
85        ///
86        ///     - for integral values, following operations are supported:
87        ///               prefix and postfix increment (++) and decement (--)
88        ///
89        ///     - for all other types, InvalidArgumentException is thrown upon attempt of an arithmetic operation
90        ///
91        /// A DynamicAny can be created from and converted to a value of any type for which a specialization of
92        /// DynamicAnyHolderImpl is available. For supported types, see DynamicAnyHolder documentation.
93{
94public:
95        DynamicAny();
96                /// Creates an empty DynamicAny.
97
98        template <typename T> 
99        DynamicAny(const T& val):
100                _pHolder(new DynamicAnyHolderImpl<T>(val))
101                /// Creates the DynamicAny from the given value.
102        {
103        }
104
105        DynamicAny(const char* pVal);
106                // Convenience constructor for const char* which gets mapped to a std::string internally, i.e. pVal is deep-copied.
107
108        DynamicAny(const DynamicAny& other);
109                /// Copy constructor.
110
111        ~DynamicAny();
112                /// Destroys the DynamicAny.
113
114        void swap(DynamicAny& other);
115                /// Swaps the content of the this DynamicAny with the other DynamicAny.
116
117        template <typename T> 
118        void convert(T& val) const
119                /// Invoke this method to perform a safe conversion.
120                ///
121                /// Example usage:
122                ///     DynamicAny any("42");
123                ///     int i;
124                ///     any.convert(i);
125                ///
126                /// Throws a RangeException if the value does not fit
127                /// into the result variable.
128                /// Throws a NotImplementedException if conversion is
129                /// not available for the given type.
130                /// Throws InvalidAccessException if DynamicAny is empty.
131        {
132                if (!_pHolder)
133                        throw InvalidAccessException("Can not convert empty value.");
134
135                _pHolder->convert(val);
136        }
137       
138        template <typename T> 
139        T convert() const
140                /// Invoke this method to perform a safe conversion.
141                ///
142                /// Example usage:
143                ///     DynamicAny any("42");
144                ///     int i = any.convert<int>();
145                ///
146                /// Throws a RangeException if the value does not fit
147                /// into the result variable.
148                /// Throws a NotImplementedException if conversion is
149                /// not available for the given type.
150                /// Throws InvalidAccessException if DynamicAny is empty.
151        {
152                if (!_pHolder)
153                        throw InvalidAccessException("Can not convert empty value.");
154
155                T result;
156                _pHolder->convert(result);
157                return result;
158        }
159       
160        template <typename T>
161        operator T () const
162                /// Safe conversion operator for implicit type
163                /// conversions. If the requested type T is same as the
164                /// type being held, the operation performed is direct
165                /// extraction, otherwise it is the conversion of the value
166                /// from type currently held to the one requested.
167                ///
168                /// Throws a RangeException if the value does not fit
169                /// into the result variable.
170                /// Throws a NotImplementedException if conversion is
171                /// not available for the given type.
172                /// Throws InvalidAccessException if DynamicAny is empty.
173        {
174                if (!_pHolder)
175                                throw InvalidAccessException("Can not convert empty value.");
176
177                if (typeid(T) == _pHolder->type())
178                        return extract<T>();
179                else
180                {
181                        T result;
182                        _pHolder->convert(result);
183                        return result;
184                }
185        }
186
187        template <typename T>
188        const T& extract() const
189                /// Returns a const reference to the actual value.
190                ///
191                /// Must be instantiated with the exact type of
192                /// the stored value, otherwise a BadCastException
193                /// is thrown.
194                /// Throws InvalidAccessException if DynamicAny is empty.
195        {
196                if (_pHolder && _pHolder->type() == typeid(T))
197                {
198                        DynamicAnyHolderImpl<T>* pHolderImpl = static_cast<DynamicAnyHolderImpl<T>*>(_pHolder);
199                        return pHolderImpl->value();
200                }
201                else if (!_pHolder)
202                        throw InvalidAccessException("Can not extract empty value.");
203                else
204                        throw BadCastException(format("Can not convert %s to %s.",
205                                _pHolder->type().name(),
206                                typeid(T).name()));
207        }
208
209        template <typename T> 
210        DynamicAny& operator = (const T& other)
211                /// Assignment operator for assigning POD to DynamicAny
212        {
213                DynamicAny tmp(other);
214                swap(tmp);
215                return *this;
216        }
217
218        bool operator ! () const;
219                /// Logical NOT operator.
220
221        DynamicAny& operator = (const DynamicAny& other);
222                /// Assignment operator specialization for DynamicAny
223
224        template <typename T>
225        const DynamicAny operator + (const T& other) const
226                /// Addition operator for adding POD to DynamicAny
227        {
228                return convert<T>() + other;
229        }
230
231        const DynamicAny operator + (const DynamicAny& other) const;
232                /// Addition operator specialization for DynamicAny
233
234        const DynamicAny operator + (const char* other) const;
235                /// Addition operator specialization for adding const char* to DynamicAny
236
237        DynamicAny& operator ++ ();
238                /// Pre-increment operator
239
240        const DynamicAny operator ++ (int);
241                /// Post-increment operator
242
243        DynamicAny& operator -- ();
244                /// Pre-decrement operator
245
246        const DynamicAny operator -- (int);
247                /// Post-decrement operator
248
249        template <typename T> 
250        DynamicAny& operator += (const T& other)
251                /// Addition assignment operator for addition/assignment of POD to DynamicAny.
252        {
253                return *this = convert<T>() + other;
254        }
255
256        DynamicAny& operator += (const DynamicAny& other);
257                /// Addition assignment operator overload for DynamicAny
258
259        DynamicAny& operator += (const char* other);
260                /// Addition assignment operator overload for const char*
261
262        template <typename T> 
263        const DynamicAny operator - (const T& other) const
264                /// Subtraction operator for subtracting POD from DynamicAny
265        {
266                return convert<T>() - other;
267        }
268
269        const DynamicAny operator - (const DynamicAny& other) const;
270                /// Subtraction operator overload for DynamicAny
271
272        template <typename T> 
273        DynamicAny& operator -= (const T& other)
274                /// Subtraction assignment operator
275        {
276                return *this = convert<T>() - other;
277        }
278
279        DynamicAny& operator -= (const DynamicAny& other);
280                /// Subtraction assignment operator overload for DynamicAny
281
282        template <typename T> 
283        const DynamicAny operator * (const T& other) const
284                /// Multiplication operator for multiplying DynamicAny with POD
285        {
286                return convert<T>() * other;
287        }
288
289        const DynamicAny operator * (const DynamicAny& other) const;
290                /// Multiplication operator overload for DynamicAny
291
292        template <typename T> 
293        DynamicAny& operator *= (const T& other)
294                /// Multiplication assignment operator
295        {
296                return *this = convert<T>() * other;
297        }
298
299        DynamicAny& operator *= (const DynamicAny& other);
300                /// Multiplication assignment operator overload for DynamicAny
301
302        template <typename T> 
303        const DynamicAny operator / (const T& other) const
304                /// Division operator for dividing DynamicAny with POD
305        {
306                return convert<T>() / other;
307        }
308
309        const DynamicAny operator / (const DynamicAny& other) const;
310                /// Division operator overload for DynamicAny
311
312        template <typename T> 
313        DynamicAny& operator /= (const T& other)
314                /// Division assignment operator
315        {
316                return *this = convert<T>() / other;
317        }
318
319        DynamicAny& operator /= (const DynamicAny& other);
320                /// Division assignment operator specialization for DynamicAny
321
322        template <typename T> 
323        bool operator == (const T& other) const
324                /// Equality operator
325        {
326                if (isEmpty()) return false;
327                return convert<T>() == other;
328        }
329
330        bool operator == (const char* other) const;
331                /// Equality operator overload for const char*
332
333        bool operator == (const DynamicAny& other) const;
334                /// Equality operator overload for DynamicAny
335
336        template <typename T> 
337        bool operator != (const T& other) const
338                /// Inequality operator
339        {
340                if (isEmpty()) return true;
341                return convert<T>() != other;
342        }
343
344        bool operator != (const DynamicAny& other) const;
345                /// Inequality operator overload for DynamicAny
346
347        bool operator != (const char* other) const;
348                /// Inequality operator overload for const char*
349
350        template <typename T> 
351        bool operator < (const T& other) const
352                /// Less than operator
353        {
354                if (isEmpty()) return false;
355                return convert<T>() < other;
356        }
357
358        bool operator < (const DynamicAny& other) const;
359                /// Less than operator overload for DynamicAny
360
361        template <typename T> 
362        bool operator <= (const T& other) const
363                /// Less than or equal operator
364        {
365                if (isEmpty()) return false;
366                return convert<T>() <= other;
367        }
368
369        bool operator <= (const DynamicAny& other) const;
370                /// Less than or equal operator overload for DynamicAny
371
372        template <typename T> 
373        bool operator > (const T& other) const
374                /// Greater than operator
375        {
376                if (isEmpty()) return false;
377                return convert<T>() > other;
378        }
379
380        bool operator > (const DynamicAny& other) const;
381                /// Greater than operator overload for DynamicAny
382
383        template <typename T> 
384        bool operator >= (const T& other) const
385                /// Greater than or equal operator
386        {
387                if (isEmpty()) return false;
388                return convert<T>() >= other;
389        }
390
391        bool operator >= (const DynamicAny& other) const;
392                /// Greater than or equal operator overload for DynamicAny
393
394        template <typename T>
395        bool operator || (const T& other) const
396                /// Logical OR operator
397        {
398                if (isEmpty()) return false;
399                return convert<bool>() || other;
400        }
401
402        bool operator || (const DynamicAny& other) const;
403                /// Logical OR operator operator overload for DynamicAny
404
405        template <typename T>
406        bool operator && (const T& other) const
407                /// Logical AND operator
408        {
409                if (isEmpty()) return false;
410                return convert<bool>() && other;
411        }
412
413        bool operator && (const DynamicAny& other) const;
414                /// Logical AND operator operator overload for DynamicAny
415
416        bool isArray() const;
417                /// Returns true if DynamicAny represents a vector
418
419        template <typename T>
420        DynamicAny& operator [] (T n)
421                /// Index operator, only use on DynamicAnys where isArray
422                /// returns true! In all other cases InvalidAccessException is thrown.
423        {
424                return holderImpl<std::vector<DynamicAny>,
425                        InvalidAccessException>("Not an array.")->operator[](n);
426        }
427
428        template <typename T>
429        const DynamicAny& operator [] (T n) const
430                /// const Index operator, only use on DynamicAnys where isArray
431                /// returns true! In all other cases InvalidAccessException is thrown.
432        {
433                return const_cast<const DynamicAny&>(holderImpl<std::vector<DynamicAny>,
434                        InvalidAccessException>("Not an array.")->operator[](n));
435        }
436
437        const std::type_info& type() const;
438                /// Returns the type information of the stored content.
439
440        void empty();
441                /// Empties DynamicAny.
442
443        bool isEmpty() const;
444                /// Returns true if empty.
445
446        bool isInteger() const;
447                /// Returns true if stored value is integer.
448
449        bool isSigned() const;
450                /// Returns true if stored value is signed.
451
452        bool isNumeric() const;
453                /// Returns true if stored value is numeric.
454                /// Returns false for numeric strings (e.g. "123" is string, not number)
455
456        bool isString() const;
457                /// Returns true if stored value is std::string.
458       
459private:
460        template <typename T>
461        T add(const DynamicAny& other) const
462        {
463                return convert<T>() + other.convert<T>();
464        }
465
466        template <typename T>
467        T subtract(const DynamicAny& other) const
468        {
469                return convert<T>() - other.convert<T>();
470        }
471       
472        template <typename T>
473        T multiply(const DynamicAny& other) const
474        {
475                return convert<T>() * other.convert<T>();
476        }
477
478        template <typename T>
479        T divide(const DynamicAny& other) const
480        {
481                return convert<T>() / other.convert<T>();
482        }
483
484        template <typename T, typename E>
485        DynamicAnyHolderImpl<T>* holderImpl(const std::string errorMessage = "") const
486        {
487                if (_pHolder && _pHolder->type() == typeid(T))
488                        return static_cast<DynamicAnyHolderImpl<T>*>(_pHolder);
489                else if (!_pHolder)
490                        throw InvalidAccessException("Can not access empty value.");
491                else
492                        throw E(errorMessage);
493        }
494
495        DynamicAnyHolder* _pHolder;
496};
497
498
499///
500/// inlines
501///
502
503
504///
505/// DynamicAny members
506///
507inline void DynamicAny::swap(DynamicAny& ptr)
508{
509        std::swap(_pHolder, ptr._pHolder);
510}
511
512
513inline const std::type_info& DynamicAny::type() const
514{
515        return _pHolder ? _pHolder->type() : typeid(void);
516}
517
518
519inline const DynamicAny DynamicAny::operator + (const char* other) const
520{
521        return convert<std::string>() + other;
522}
523
524
525inline DynamicAny& DynamicAny::operator += (const char*other)
526{
527        return *this = convert<std::string>() + other;
528}
529
530
531inline bool DynamicAny::operator ! () const
532{
533        return !convert<bool>();
534}
535
536
537inline bool DynamicAny::isEmpty() const
538{
539        return 0 == _pHolder;
540}
541
542
543inline bool DynamicAny::isArray() const
544{
545        return _pHolder ? _pHolder->isArray() : false;
546}
547
548
549inline bool DynamicAny::isInteger() const
550{
551        return _pHolder ? _pHolder->isInteger() : false;
552}
553
554
555inline bool DynamicAny::isSigned() const
556{
557        return _pHolder ? _pHolder->isSigned() : false;
558}
559
560
561inline bool DynamicAny::isNumeric() const
562{
563        return _pHolder ? _pHolder->isNumeric() : false;
564}
565
566
567inline bool DynamicAny::isString() const
568{
569        return _pHolder ? _pHolder->isString() : false;
570}
571
572
573///
574/// DynamicAny non-member functions
575///
576inline const DynamicAny operator + (const char* other, const DynamicAny& da)
577        /// Addition operator for adding DynamicAny to const char*
578{
579        std::string tmp = other;
580        return tmp + da.convert<std::string>();
581}
582
583
584inline char operator + (const char& other, const DynamicAny& da)
585        /// Addition operator for adding DynamicAny to char
586{
587        return other + da.convert<char>();
588}
589
590
591inline char operator - (const char& other, const DynamicAny& da)
592        /// Subtraction operator for subtracting DynamicAny from char
593{
594        return other - da.convert<char>();
595}
596
597
598inline char operator * (const char& other, const DynamicAny& da)
599        /// Multiplication operator for multiplying DynamicAny with char
600{
601        return other * da.convert<char>();
602}
603
604
605inline char operator / (const char& other, const DynamicAny& da)
606        /// Division operator for dividing DynamicAny with char
607{
608        return other / da.convert<char>();
609}
610
611
612inline char operator += (char& other, const DynamicAny& da)
613        /// Addition assignment operator for adding DynamicAny to char
614{
615        return other += da.convert<char>();
616}
617
618
619inline char operator -= (char& other, const DynamicAny& da)
620        /// Subtraction assignment operator for subtracting DynamicAny from char
621{
622        return other -= da.convert<char>();
623}
624
625
626inline char operator *= (char& other, const DynamicAny& da)
627        /// Multiplication assignment operator for multiplying DynamicAny with char
628{
629        return other *= da.convert<char>();
630}
631
632
633inline char operator /= (char& other, const DynamicAny& da)
634        /// Division assignment operator for dividing DynamicAny with char
635{
636        return other /= da.convert<char>();
637}
638
639
640inline bool operator == (const char& other, const DynamicAny& da)
641        /// Equality operator for comparing DynamicAny with char
642{
643        if (da.isEmpty()) return false;
644        return other == da.convert<char>();
645}
646
647
648inline bool operator != (const char& other, const DynamicAny& da)
649        /// Inequality operator for comparing DynamicAny with char
650{
651        if (da.isEmpty()) return true;
652        return other != da.convert<char>();
653}
654
655
656inline bool operator < (const char& other, const DynamicAny& da)
657        /// Less than operator for comparing DynamicAny with char
658{
659        if (da.isEmpty()) return false;
660        return other < da.convert<char>();
661}
662
663
664inline bool operator <= (const char& other, const DynamicAny& da)
665        /// Less than or equal operator for comparing DynamicAny with char
666{
667        if (da.isEmpty()) return false;
668        return other <= da.convert<char>();
669}
670
671
672inline bool operator > (const char& other, const DynamicAny& da)
673        /// Greater than operator for comparing DynamicAny with char
674{
675        if (da.isEmpty())return false;
676        return other > da.convert<char>();
677}
678
679
680inline bool operator >= (const char& other, const DynamicAny& da)
681        /// Greater than or equal operator for comparing DynamicAny with char
682{
683        if (da.isEmpty())return false;
684        return other >= da.convert<char>();
685}
686
687
688inline Poco::Int8 operator + (const Poco::Int8& other, const DynamicAny& da)
689        /// Addition operator for adding DynamicAny to Poco::Int8
690{
691        return other + da.convert<Poco::Int8>();
692}
693
694
695inline Poco::Int8 operator - (const Poco::Int8& other, const DynamicAny& da)
696        /// Subtraction operator for subtracting DynamicAny from Poco::Int8
697{
698        return other - da.convert<Poco::Int8>();
699}
700
701
702inline Poco::Int8 operator * (const Poco::Int8& other, const DynamicAny& da)
703        /// Multiplication operator for multiplying DynamicAny with Poco::Int8
704{
705        return other * da.convert<Poco::Int8>();
706}
707
708
709inline Poco::Int8 operator / (const Poco::Int8& other, const DynamicAny& da)
710        /// Division operator for dividing DynamicAny with Poco::Int8
711{
712        return other / da.convert<Poco::Int8>();
713}
714
715
716inline Poco::Int8 operator += (Poco::Int8& other, const DynamicAny& da)
717        /// Addition assignment operator for adding DynamicAny to Poco::Int8
718{
719        return other += da.convert<Poco::Int8>();
720}
721
722
723inline Poco::Int8 operator -= (Poco::Int8& other, const DynamicAny& da)
724        /// Subtraction assignment operator for subtracting DynamicAny from Poco::Int8
725{
726        return other -= da.convert<Poco::Int8>();
727}
728
729
730inline Poco::Int8 operator *= (Poco::Int8& other, const DynamicAny& da)
731        /// Multiplication assignment operator for multiplying DynamicAny with Poco::Int8
732{
733        return other *= da.convert<Poco::Int8>();
734}
735
736
737inline Poco::Int8 operator /= (Poco::Int8& other, const DynamicAny& da)
738        /// Division assignment operator for dividing DynamicAny with Poco::Int8
739{
740        return other /= da.convert<Poco::Int8>();
741}
742
743
744inline bool operator == (const Poco::Int8& other, const DynamicAny& da)
745        /// Equality operator for comparing DynamicAny with Poco::Int8
746{
747        if (da.isEmpty()) return false;
748        return other == da.convert<Poco::Int8>();
749}
750
751
752inline bool operator != (const Poco::Int8& other, const DynamicAny& da)
753        /// Inequality operator for comparing DynamicAny with Poco::Int8
754{
755        if (da.isEmpty()) return true;
756        return other != da.convert<Poco::Int8>();
757}
758
759
760inline bool operator < (const Poco::Int8& other, const DynamicAny& da)
761        /// Less than operator for comparing DynamicAny with Poco::Int8
762{
763        if (da.isEmpty()) return false;
764        return other < da.convert<Poco::Int8>();
765}
766
767
768inline bool operator <= (const Poco::Int8& other, const DynamicAny& da)
769        /// Less than or equal operator for comparing DynamicAny with Poco::Int8
770{
771        if (da.isEmpty()) return false;
772        return other <= da.convert<Poco::Int8>();
773}
774
775
776inline bool operator > (const Poco::Int8& other, const DynamicAny& da)
777        /// Greater than operator for comparing DynamicAny with Poco::Int8
778{
779        if (da.isEmpty()) return false;
780        return other > da.convert<Poco::Int8>();
781}
782
783
784inline bool operator >= (const Poco::Int8& other, const DynamicAny& da)
785        /// Greater than or equal operator for comparing DynamicAny with Poco::Int8
786{
787        if (da.isEmpty()) return false;
788        return other >= da.convert<Poco::Int8>();
789}
790
791
792inline Poco::UInt8 operator + (const Poco::UInt8& other, const DynamicAny& da)
793        /// Addition operator for adding DynamicAny to Poco::UInt8
794{
795        return other + da.convert<Poco::UInt8>();
796}
797
798
799inline Poco::UInt8 operator - (const Poco::UInt8& other, const DynamicAny& da)
800        /// Subtraction operator for subtracting DynamicAny from Poco::UInt8
801{
802        return other - da.convert<Poco::UInt8>();
803}
804
805
806inline Poco::UInt8 operator * (const Poco::UInt8& other, const DynamicAny& da)
807        /// Multiplication operator for multiplying DynamicAny with Poco::UInt8
808{
809        return other * da.convert<Poco::UInt8>();
810}
811
812
813inline Poco::UInt8 operator / (const Poco::UInt8& other, const DynamicAny& da)
814        /// Division operator for dividing DynamicAny with Poco::UInt8
815{
816        return other / da.convert<Poco::UInt8>();
817}
818
819
820inline Poco::UInt8 operator += (Poco::UInt8& other, const DynamicAny& da)
821        /// Addition assignment operator for adding DynamicAny to Poco::UInt8
822{
823        return other += da.convert<Poco::UInt8>();
824}
825
826
827inline Poco::UInt8 operator -= (Poco::UInt8& other, const DynamicAny& da)
828        /// Subtraction assignment operator for subtracting DynamicAny from Poco::UInt8
829{
830        return other -= da.convert<Poco::UInt8>();
831}
832
833
834inline Poco::UInt8 operator *= (Poco::UInt8& other, const DynamicAny& da)
835        /// Multiplication assignment operator for multiplying DynamicAny with Poco::UInt8
836{
837        return other *= da.convert<Poco::UInt8>();
838}
839
840
841inline Poco::UInt8 operator /= (Poco::UInt8& other, const DynamicAny& da)
842        /// Division assignment operator for dividing DynamicAny with Poco::UInt8
843{
844        return other /= da.convert<Poco::UInt8>();
845}
846
847
848inline bool operator == (const Poco::UInt8& other, const DynamicAny& da)
849        /// Equality operator for comparing DynamicAny with Poco::UInt8
850{
851        if (da.isEmpty()) return false;
852        return other == da.convert<Poco::UInt8>();
853}
854
855
856inline bool operator != (const Poco::UInt8& other, const DynamicAny& da)
857        /// Inequality operator for comparing DynamicAny with Poco::UInt8
858{
859        if (da.isEmpty()) return true;
860        return other != da.convert<Poco::UInt8>();
861}
862
863
864inline bool operator < (const Poco::UInt8& other, const DynamicAny& da)
865        /// Less than operator for comparing DynamicAny with Poco::UInt8
866{
867        if (da.isEmpty()) return false;
868        return other < da.convert<Poco::UInt8>();
869}
870
871
872inline bool operator <= (const Poco::UInt8& other, const DynamicAny& da)
873        /// Less than or equal operator for comparing DynamicAny with Poco::UInt8
874{
875        if (da.isEmpty()) return false;
876        return other <= da.convert<Poco::UInt8>();
877}
878
879
880inline bool operator > (const Poco::UInt8& other, const DynamicAny& da)
881        /// Greater than operator for comparing DynamicAny with Poco::UInt8
882{
883        if (da.isEmpty()) return false;
884        return other > da.convert<Poco::UInt8>();
885}
886
887
888inline bool operator >= (const Poco::UInt8& other, const DynamicAny& da)
889        /// Greater than or equal operator for comparing DynamicAny with Poco::UInt8
890{
891        if (da.isEmpty()) return false;
892        return other >= da.convert<Poco::UInt8>();
893}
894
895
896inline Poco::Int16 operator + (const Poco::Int16& other, const DynamicAny& da)
897        /// Addition operator for adding DynamicAny to Poco::Int16
898{
899        return other + da.convert<Poco::Int16>();
900}
901
902
903inline Poco::Int16 operator - (const Poco::Int16& other, const DynamicAny& da)
904        /// Subtraction operator for subtracting DynamicAny from Poco::Int16
905{
906        return other - da.convert<Poco::Int16>();
907}
908
909
910inline Poco::Int16 operator * (const Poco::Int16& other, const DynamicAny& da)
911        /// Multiplication operator for multiplying DynamicAny with Poco::Int16
912{
913        return other * da.convert<Poco::Int16>();
914}
915
916
917inline Poco::Int16 operator / (const Poco::Int16& other, const DynamicAny& da)
918        /// Division operator for dividing DynamicAny with Poco::Int16
919{
920        return other / da.convert<Poco::Int16>();
921}
922
923
924inline Poco::Int16 operator += (Poco::Int16& other, const DynamicAny& da)
925        /// Addition assignment operator for adding DynamicAny to Poco::Int16
926{
927        return other += da.convert<Poco::Int16>();
928}
929
930
931inline Poco::Int16 operator -= (Poco::Int16& other, const DynamicAny& da)
932        /// Subtraction assignment operator for subtracting DynamicAny from Poco::Int16
933{
934        return other -= da.convert<Poco::Int16>();
935}
936
937
938inline Poco::Int16 operator *= (Poco::Int16& other, const DynamicAny& da)
939        /// Multiplication assignment operator for multiplying DynamicAny with Poco::Int16
940{
941        return other *= da.convert<Poco::Int16>();
942}
943
944
945inline Poco::Int16 operator /= (Poco::Int16& other, const DynamicAny& da)
946        /// Division assignment operator for dividing DynamicAny with Poco::Int16
947{
948        return other /= da.convert<Poco::Int16>();
949}
950
951
952inline bool operator == (const Poco::Int16& other, const DynamicAny& da)
953        /// Equality operator for comparing DynamicAny with Poco::Int16
954{
955        if (da.isEmpty()) return false;
956        return other == da.convert<Poco::Int16>();
957}
958
959
960inline bool operator != (const Poco::Int16& other, const DynamicAny& da)
961        /// Inequality operator for comparing DynamicAny with Poco::Int16
962{
963        if (da.isEmpty()) return true;
964        return other != da.convert<Poco::Int16>();
965}
966
967
968inline bool operator < (const Poco::Int16& other, const DynamicAny& da)
969        /// Less than operator for comparing DynamicAny with Poco::Int16
970{
971        if (da.isEmpty()) return false;
972        return other < da.convert<Poco::Int16>();
973}
974
975
976inline bool operator <= (const Poco::Int16& other, const DynamicAny& da)
977        /// Less than or equal operator for comparing DynamicAny with Poco::Int16
978{
979        if (da.isEmpty()) return false;
980        return other <= da.convert<Poco::Int16>();
981}
982
983
984inline bool operator > (const Poco::Int16& other, const DynamicAny& da)
985        /// Greater than operator for comparing DynamicAny with Poco::Int16
986{
987        if (da.isEmpty()) return false;
988        return other > da.convert<Poco::Int16>();
989}
990
991
992inline bool operator >= (const Poco::Int16& other, const DynamicAny& da)
993        /// Greater than or equal operator for comparing DynamicAny with Poco::Int16
994{
995        if (da.isEmpty()) return false;
996        return other >= da.convert<Poco::Int16>();
997}
998
999
1000inline Poco::UInt16 operator + (const Poco::UInt16& other, const DynamicAny& da)
1001        /// Addition operator for adding DynamicAny to Poco::UInt16
1002{
1003        return other + da.convert<Poco::UInt16>();
1004}
1005
1006
1007inline Poco::UInt16 operator - (const Poco::UInt16& other, const DynamicAny& da)
1008        /// Subtraction operator for subtracting DynamicAny from Poco::UInt16
1009{
1010        return other - da.convert<Poco::UInt16>();
1011}
1012
1013
1014inline Poco::UInt16 operator * (const Poco::UInt16& other, const DynamicAny& da)
1015        /// Multiplication operator for multiplying DynamicAny with Poco::UInt16
1016{
1017        return other * da.convert<Poco::UInt16>();
1018}
1019
1020
1021inline Poco::UInt16 operator / (const Poco::UInt16& other, const DynamicAny& da)
1022        /// Division operator for dividing DynamicAny with Poco::UInt16
1023{
1024        return other / da.convert<Poco::UInt16>();
1025}
1026
1027
1028inline Poco::UInt16 operator += (Poco::UInt16& other, const DynamicAny& da)
1029        /// Addition assignment operator for adding DynamicAny to Poco::UInt16
1030{
1031        return other += da.convert<Poco::UInt16>();
1032}
1033
1034
1035inline Poco::UInt16 operator -= (Poco::UInt16& other, const DynamicAny& da)
1036        /// Subtraction assignment operator for subtracting DynamicAny from Poco::UInt16
1037{
1038        return other -= da.convert<Poco::UInt16>();
1039}
1040
1041
1042inline Poco::UInt16 operator *= (Poco::UInt16& other, const DynamicAny& da)
1043        /// Multiplication assignment operator for multiplying DynamicAny with Poco::UInt16
1044{
1045        return other *= da.convert<Poco::UInt16>();
1046}
1047
1048
1049inline Poco::UInt16 operator /= (Poco::UInt16& other, const DynamicAny& da)
1050        /// Division assignment operator for dividing DynamicAny with Poco::UInt16
1051{
1052        return other /= da.convert<Poco::UInt16>();
1053}
1054
1055
1056inline bool operator == (const Poco::UInt16& other, const DynamicAny& da)
1057        /// Equality operator for comparing DynamicAny with Poco::UInt16
1058{
1059        if (da.isEmpty()) return false;
1060        return other == da.convert<Poco::UInt16>();
1061}
1062
1063
1064inline bool operator != (const Poco::UInt16& other, const DynamicAny& da)
1065        /// Inequality operator for comparing DynamicAny with Poco::UInt16
1066{
1067        if (da.isEmpty()) return true;
1068        return other != da.convert<Poco::UInt16>();
1069}
1070
1071
1072inline bool operator < (const Poco::UInt16& other, const DynamicAny& da)
1073        /// Less than operator for comparing DynamicAny with Poco::UInt16
1074{
1075        if (da.isEmpty()) return false;
1076        return other < da.convert<Poco::UInt16>();
1077}
1078
1079
1080inline bool operator <= (const Poco::UInt16& other, const DynamicAny& da)
1081        /// Less than or equal operator for comparing DynamicAny with Poco::UInt16
1082{
1083        if (da.isEmpty()) return false;
1084        return other <= da.convert<Poco::UInt16>();
1085}
1086
1087
1088inline bool operator > (const Poco::UInt16& other, const DynamicAny& da)
1089        /// Greater than operator for comparing DynamicAny with Poco::UInt16
1090{
1091        if (da.isEmpty()) return false;
1092        return other > da.convert<Poco::UInt16>();
1093}
1094
1095
1096inline bool operator >= (const Poco::UInt16& other, const DynamicAny& da)
1097        /// Greater than or equal operator for comparing DynamicAny with Poco::UInt16
1098{
1099        if (da.isEmpty()) return false;
1100        return other >= da.convert<Poco::UInt16>();
1101}
1102
1103
1104inline Poco::Int32 operator + (const Poco::Int32& other, const DynamicAny& da)
1105        /// Addition operator for adding DynamicAny to Poco::Int32
1106{
1107        return other + da.convert<Poco::Int32>();
1108}
1109
1110
1111inline Poco::Int32 operator - (const Poco::Int32& other, const DynamicAny& da)
1112        /// Subtraction operator for subtracting DynamicAny from Poco::Int32
1113{
1114        return other - da.convert<Poco::Int32>();
1115}
1116
1117
1118inline Poco::Int32 operator * (const Poco::Int32& other, const DynamicAny& da)
1119        /// Multiplication operator for multiplying DynamicAny with Poco::Int32
1120{
1121        return other * da.convert<Poco::Int32>();
1122}
1123
1124
1125inline Poco::Int32 operator / (const Poco::Int32& other, const DynamicAny& da)
1126        /// Division operator for dividing DynamicAny with Poco::Int32
1127{
1128        return other / da.convert<Poco::Int32>();
1129}
1130
1131
1132inline Poco::Int32 operator += (Poco::Int32& other, const DynamicAny& da)
1133        /// Addition assignment operator for adding DynamicAny to Poco::Int32
1134{
1135        return other += da.convert<Poco::Int32>();
1136}
1137
1138
1139inline Poco::Int32 operator -= (Poco::Int32& other, const DynamicAny& da)
1140        /// Subtraction assignment operator for subtracting DynamicAny from Poco::Int32
1141{
1142        return other -= da.convert<Poco::Int32>();
1143}
1144
1145
1146inline Poco::Int32 operator *= (Poco::Int32& other, const DynamicAny& da)
1147        /// Multiplication assignment operator for multiplying DynamicAny with Poco::Int32
1148{
1149        return other *= da.convert<Poco::Int32>();
1150}
1151
1152
1153inline Poco::Int32 operator /= (Poco::Int32& other, const DynamicAny& da)
1154        /// Division assignment operator for dividing DynamicAny with Poco::Int32
1155{
1156        return other /= da.convert<Poco::Int32>();
1157}
1158
1159
1160inline bool operator == (const Poco::Int32& other, const DynamicAny& da)
1161        /// Equality operator for comparing DynamicAny with Poco::Int32
1162{
1163        if (da.isEmpty()) return false;
1164        return other == da.convert<Poco::Int32>();
1165}
1166
1167
1168inline bool operator != (const Poco::Int32& other, const DynamicAny& da)
1169        /// Inequality operator for comparing DynamicAny with Poco::Int32
1170{
1171        if (da.isEmpty()) return true;
1172        return other != da.convert<Poco::Int32>();
1173}
1174
1175
1176inline bool operator < (const Poco::Int32& other, const DynamicAny& da)
1177        /// Less than operator for comparing DynamicAny with Poco::Int32
1178{
1179        if (da.isEmpty()) return false;
1180        return other < da.convert<Poco::Int32>();
1181}
1182
1183
1184inline bool operator <= (const Poco::Int32& other, const DynamicAny& da)
1185        /// Less than or equal operator for comparing DynamicAny with Poco::Int32
1186{
1187        if (da.isEmpty()) return false;
1188        return other <= da.convert<Poco::Int32>();
1189}
1190
1191
1192inline bool operator > (const Poco::Int32& other, const DynamicAny& da)
1193        /// Greater than operator for comparing DynamicAny with Poco::Int32
1194{
1195        if (da.isEmpty()) return false;
1196        return other > da.convert<Poco::Int32>();
1197}
1198
1199
1200inline bool operator >= (const Poco::Int32& other, const DynamicAny& da)
1201        /// Greater than or equal operator for comparing DynamicAny with Poco::Int32
1202{
1203        if (da.isEmpty()) return false;
1204        return other >= da.convert<Poco::Int32>();
1205}
1206
1207
1208inline Poco::UInt32 operator + (const Poco::UInt32& other, const DynamicAny& da)
1209        /// Addition operator for adding DynamicAny to Poco::UInt32
1210{
1211        return other + da.convert<Poco::UInt32>();
1212}
1213
1214
1215inline Poco::UInt32 operator - (const Poco::UInt32& other, const DynamicAny& da)
1216        /// Subtraction operator for subtracting DynamicAny from Poco::UInt32
1217{
1218        return other - da.convert<Poco::UInt32>();
1219}
1220
1221
1222inline Poco::UInt32 operator * (const Poco::UInt32& other, const DynamicAny& da)
1223        /// Multiplication operator for multiplying DynamicAny with Poco::UInt32
1224{
1225        return other * da.convert<Poco::UInt32>();
1226}
1227
1228
1229inline Poco::UInt32 operator / (const Poco::UInt32& other, const DynamicAny& da)
1230        /// Division operator for dividing DynamicAny with Poco::UInt32
1231{
1232        return other / da.convert<Poco::UInt32>();
1233}
1234
1235
1236inline Poco::UInt32 operator += (Poco::UInt32& other, const DynamicAny& da)
1237        /// Addition assignment operator for adding DynamicAny to Poco::UInt32
1238{
1239        return other += da.convert<Poco::UInt32>();
1240}
1241
1242
1243inline Poco::UInt32 operator -= (Poco::UInt32& other, const DynamicAny& da)
1244        /// Subtraction assignment operator for subtracting DynamicAny from Poco::UInt32
1245{
1246        return other -= da.convert<Poco::UInt32>();
1247}
1248
1249
1250inline Poco::UInt32 operator *= (Poco::UInt32& other, const DynamicAny& da)
1251        /// Multiplication assignment operator for multiplying DynamicAny with Poco::UInt32
1252{
1253        return other *= da.convert<Poco::UInt32>();
1254}
1255
1256
1257inline Poco::UInt32 operator /= (Poco::UInt32& other, const DynamicAny& da)
1258        /// Division assignment operator for dividing DynamicAny with Poco::UInt32
1259{
1260        return other /= da.convert<Poco::UInt32>();
1261}
1262
1263
1264inline bool operator == (const Poco::UInt32& other, const DynamicAny& da)
1265        /// Equality operator for comparing DynamicAny with Poco::UInt32
1266{
1267        if (da.isEmpty()) return false;
1268        return other == da.convert<Poco::UInt32>();
1269}
1270
1271
1272inline bool operator != (const Poco::UInt32& other, const DynamicAny& da)
1273        /// Inequality operator for comparing DynamicAny with Poco::UInt32
1274{
1275        if (da.isEmpty()) return true;
1276        return other != da.convert<Poco::UInt32>();
1277}
1278
1279
1280inline bool operator < (const Poco::UInt32& other, const DynamicAny& da)
1281        /// Less than operator for comparing DynamicAny with Poco::UInt32
1282{
1283        if (da.isEmpty()) return false;
1284        return other < da.convert<Poco::UInt32>();
1285}
1286
1287
1288inline bool operator <= (const Poco::UInt32& other, const DynamicAny& da)
1289        /// Less than or equal operator for comparing DynamicAny with Poco::UInt32
1290{
1291        if (da.isEmpty()) return false;
1292        return other <= da.convert<Poco::UInt32>();
1293}
1294
1295
1296inline bool operator > (const Poco::UInt32& other, const DynamicAny& da)
1297        /// Greater than operator for comparing DynamicAny with Poco::UInt32
1298{
1299        if (da.isEmpty()) return false;
1300        return other > da.convert<Poco::UInt32>();
1301}
1302
1303
1304inline bool operator >= (const Poco::UInt32& other, const DynamicAny& da)
1305        /// Greater than or equal operator for comparing DynamicAny with Poco::UInt32
1306{
1307        if (da.isEmpty()) return false;
1308        return other >= da.convert<Poco::UInt32>();
1309}
1310
1311
1312inline Poco::Int64 operator + (const Poco::Int64& other, const DynamicAny& da)
1313        /// Addition operator for adding DynamicAny to Poco::Int64
1314{
1315        return other + da.convert<Poco::Int64>();
1316}
1317
1318
1319inline Poco::Int64 operator - (const Poco::Int64& other, const DynamicAny& da)
1320        /// Subtraction operator for subtracting DynamicAny from Poco::Int64
1321{
1322        return other - da.convert<Poco::Int64>();
1323}
1324
1325
1326inline Poco::Int64 operator * (const Poco::Int64& other, const DynamicAny& da)
1327        /// Multiplication operator for multiplying DynamicAny with Poco::Int64
1328{
1329        return other * da.convert<Poco::Int64>();
1330}
1331
1332
1333inline Poco::Int64 operator / (const Poco::Int64& other, const DynamicAny& da)
1334        /// Division operator for dividing DynamicAny with Poco::Int64
1335{
1336        return other / da.convert<Poco::Int64>();
1337}
1338
1339
1340inline Poco::Int64 operator += (Poco::Int64& other, const DynamicAny& da)
1341        /// Addition assignment operator for adding DynamicAny to Poco::Int64
1342{
1343        return other += da.convert<Poco::Int64>();
1344}
1345
1346
1347inline Poco::Int64 operator -= (Poco::Int64& other, const DynamicAny& da)
1348        /// Subtraction assignment operator for subtracting DynamicAny from Poco::Int64
1349{
1350        return other -= da.convert<Poco::Int64>();
1351}
1352
1353
1354inline Poco::Int64 operator *= (Poco::Int64& other, const DynamicAny& da)
1355        /// Multiplication assignment operator for multiplying DynamicAny with Poco::Int64
1356{
1357        return other *= da.convert<Poco::Int64>();
1358}
1359
1360
1361inline Poco::Int64 operator /= (Poco::Int64& other, const DynamicAny& da)
1362        /// Division assignment operator for dividing DynamicAny with Poco::Int64
1363{
1364        return other /= da.convert<Poco::Int64>();
1365}
1366
1367
1368inline bool operator == (const Poco::Int64& other, const DynamicAny& da)
1369        /// Equality operator for comparing DynamicAny with Poco::Int64
1370{
1371        if (da.isEmpty()) return false;
1372        return other == da.convert<Poco::Int64>();
1373}
1374
1375
1376inline bool operator != (const Poco::Int64& other, const DynamicAny& da)
1377        /// Inequality operator for comparing DynamicAny with Poco::Int64
1378{
1379        if (da.isEmpty()) return true;
1380        return other != da.convert<Poco::Int64>();
1381}
1382
1383
1384inline bool operator < (const Poco::Int64& other, const DynamicAny& da)
1385        /// Less than operator for comparing DynamicAny with Poco::Int64
1386{
1387        if (da.isEmpty()) return false;
1388        return other < da.convert<Poco::Int64>();
1389}
1390
1391
1392inline bool operator <= (const Poco::Int64& other, const DynamicAny& da)
1393        /// Less than or equal operator for comparing DynamicAny with Poco::Int64
1394{
1395        if (da.isEmpty()) return false;
1396        return other <= da.convert<Poco::Int64>();
1397}
1398
1399
1400inline bool operator > (const Poco::Int64& other, const DynamicAny& da)
1401        /// Greater than operator for comparing DynamicAny with Poco::Int64
1402{
1403        if (da.isEmpty()) return false;
1404        return other > da.convert<Poco::Int64>();
1405}
1406
1407
1408inline bool operator >= (const Poco::Int64& other, const DynamicAny& da)
1409        /// Greater than or equal operator for comparing DynamicAny with Poco::Int64
1410{
1411        if (da.isEmpty()) return false;
1412        return other >= da.convert<Poco::Int64>();
1413}
1414
1415
1416inline Poco::UInt64 operator + (const Poco::UInt64& other, const DynamicAny& da)
1417        /// Addition operator for adding DynamicAny to Poco::UInt64
1418{
1419        return other + da.convert<Poco::UInt64>();
1420}
1421
1422
1423inline Poco::UInt64 operator - (const Poco::UInt64& other, const DynamicAny& da)
1424        /// Subtraction operator for subtracting DynamicAny from Poco::UInt64
1425{
1426        return other - da.convert<Poco::UInt64>();
1427}
1428
1429
1430inline Poco::UInt64 operator * (const Poco::UInt64& other, const DynamicAny& da)
1431        /// Multiplication operator for multiplying DynamicAny with Poco::UInt64
1432{
1433        return other * da.convert<Poco::UInt64>();
1434}
1435
1436
1437inline Poco::UInt64 operator / (const Poco::UInt64& other, const DynamicAny& da)
1438        /// Division operator for dividing DynamicAny with Poco::UInt64
1439{
1440        return other / da.convert<Poco::UInt64>();
1441}
1442
1443
1444inline Poco::UInt64 operator += (Poco::UInt64& other, const DynamicAny& da)
1445        /// Addition assignment operator for adding DynamicAny to Poco::UInt64
1446{
1447        return other += da.convert<Poco::UInt64>();
1448}
1449
1450
1451inline Poco::UInt64 operator -= (Poco::UInt64& other, const DynamicAny& da)
1452        /// Subtraction assignment operator for subtracting DynamicAny from Poco::UInt64
1453{
1454        return other -= da.convert<Poco::UInt64>();
1455}
1456
1457
1458inline Poco::UInt64 operator *= (Poco::UInt64& other, const DynamicAny& da)
1459        /// Multiplication assignment operator for multiplying DynamicAny with Poco::UInt64
1460{
1461        return other *= da.convert<Poco::UInt64>();
1462}
1463
1464
1465inline Poco::UInt64 operator /= (Poco::UInt64& other, const DynamicAny& da)
1466        /// Division assignment operator for dividing DynamicAny with Poco::UInt64
1467{
1468        return other /= da.convert<Poco::UInt64>();
1469}
1470
1471
1472inline bool operator == (const Poco::UInt64& other, const DynamicAny& da)
1473        /// Equality operator for comparing DynamicAny with Poco::UInt64
1474{
1475        if (da.isEmpty()) return false;
1476        return other == da.convert<Poco::UInt64>();
1477}
1478
1479
1480inline bool operator != (const Poco::UInt64& other, const DynamicAny& da)
1481        /// Inequality operator for comparing DynamicAny with Poco::UInt64
1482{
1483        if (da.isEmpty()) return true;
1484        return other != da.convert<Poco::UInt64>();
1485}
1486
1487
1488inline bool operator < (const Poco::UInt64& other, const DynamicAny& da)
1489        /// Less than operator for comparing DynamicAny with Poco::UInt64
1490{
1491        if (da.isEmpty()) return false;
1492        return other < da.convert<Poco::UInt64>();
1493}
1494
1495
1496inline bool operator <= (const Poco::UInt64& other, const DynamicAny& da)
1497        /// Less than or equal operator for comparing DynamicAny with Poco::UInt64
1498{
1499        if (da.isEmpty()) return false;
1500        return other <= da.convert<Poco::UInt64>();
1501}
1502
1503
1504inline bool operator > (const Poco::UInt64& other, const DynamicAny& da)
1505        /// Greater than operator for comparing DynamicAny with Poco::UInt64
1506{
1507        if (da.isEmpty()) return false;
1508        return other > da.convert<Poco::UInt64>();
1509}
1510
1511
1512inline bool operator >= (const Poco::UInt64& other, const DynamicAny& da)
1513        /// Greater than or equal operator for comparing DynamicAny with Poco::UInt64
1514{
1515        if (da.isEmpty()) return false;
1516        return other >= da.convert<Poco::UInt64>();
1517}
1518
1519
1520inline float operator + (const float& other, const DynamicAny& da)
1521        /// Addition operator for adding DynamicAny to float
1522{
1523        return other + da.convert<float>();
1524}
1525
1526
1527inline float operator - (const float& other, const DynamicAny& da)
1528        /// Subtraction operator for subtracting DynamicAny from float
1529{
1530        return other - da.convert<float>();
1531}
1532
1533
1534inline float operator * (const float& other, const DynamicAny& da)
1535        /// Multiplication operator for multiplying DynamicAny with float
1536{
1537        return other * da.convert<float>();
1538}
1539
1540
1541inline float operator / (const float& other, const DynamicAny& da)
1542        /// Division operator for dividing DynamicAny with float
1543{
1544        return other / da.convert<float>();
1545}
1546
1547
1548inline float operator += (float& other, const DynamicAny& da)
1549        /// Addition assignment operator for adding DynamicAny to float
1550{
1551        return other += da.convert<float>();
1552}
1553
1554
1555inline float operator -= (float& other, const DynamicAny& da)
1556        /// Subtraction assignment operator for subtracting DynamicAny from float
1557{
1558        return other -= da.convert<float>();
1559}
1560
1561
1562inline float operator *= (float& other, const DynamicAny& da)
1563        /// Multiplication assignment operator for multiplying DynamicAny with float
1564{
1565        return other *= da.convert<float>();
1566}
1567
1568
1569inline float operator /= (float& other, const DynamicAny& da)
1570        /// Division assignment operator for dividing DynamicAny with float
1571{
1572        return other /= da.convert<float>();
1573}
1574
1575
1576inline bool operator == (const float& other, const DynamicAny& da)
1577        /// Equality operator for comparing DynamicAny with float
1578{
1579        if (da.isEmpty()) return false;
1580        return other == da.convert<float>();
1581}
1582
1583
1584inline bool operator != (const float& other, const DynamicAny& da)
1585        /// Inequality operator for comparing DynamicAny with float
1586{
1587        if (da.isEmpty()) return true;
1588        return other != da.convert<float>();
1589}
1590
1591
1592inline bool operator < (const float& other, const DynamicAny& da)
1593        /// Less than operator for comparing DynamicAny with float
1594{
1595        if (da.isEmpty()) return false;
1596        return other < da.convert<float>();
1597}
1598
1599
1600inline bool operator <= (const float& other, const DynamicAny& da)
1601        /// Less than or equal operator for comparing DynamicAny with float
1602{
1603        if (da.isEmpty()) return false;
1604        return other <= da.convert<float>();
1605}
1606
1607
1608inline bool operator > (const float& other, const DynamicAny& da)
1609        /// Greater than operator for comparing DynamicAny with float
1610{
1611        if (da.isEmpty()) return false;
1612        return other > da.convert<float>();
1613}
1614
1615
1616inline bool operator >= (const float& other, const DynamicAny& da)
1617        /// Greater than or equal operator for comparing DynamicAny with float
1618{
1619        if (da.isEmpty()) return false;
1620        return other >= da.convert<float>();
1621}
1622
1623
1624inline double operator + (const double& other, const DynamicAny& da)
1625        /// Addition operator for adding DynamicAny to double
1626{
1627        return other + da.convert<double>();
1628}
1629
1630
1631inline double operator - (const double& other, const DynamicAny& da)
1632        /// Subtraction operator for subtracting DynamicAny from double
1633{
1634        return other - da.convert<double>();
1635}
1636
1637
1638inline double operator * (const double& other, const DynamicAny& da)
1639        /// Multiplication operator for multiplying DynamicAny with double
1640{
1641        return other * da.convert<double>();
1642}
1643
1644
1645inline double operator / (const double& other, const DynamicAny& da)
1646        /// Division operator for dividing DynamicAny with double
1647{
1648        return other / da.convert<double>();
1649}
1650
1651
1652inline double operator += (double& other, const DynamicAny& da)
1653        /// Addition assignment operator for adding DynamicAny to double
1654{
1655        return other += da.convert<double>();
1656}
1657
1658
1659inline double operator -= (double& other, const DynamicAny& da)
1660        /// Subtraction assignment operator for subtracting DynamicAny from double
1661{
1662        return other -= da.convert<double>();
1663}
1664
1665
1666inline double operator *= (double& other, const DynamicAny& da)
1667        /// Multiplication assignment operator for multiplying DynamicAny with double
1668{
1669        return other *= da.convert<double>();
1670}
1671
1672
1673inline double operator /= (double& other, const DynamicAny& da)
1674        /// Division assignment operator for dividing DynamicAny with double
1675{
1676        return other /= da.convert<double>();
1677}
1678
1679
1680inline bool operator == (const double& other, const DynamicAny& da)
1681        /// Equality operator for comparing DynamicAny with double
1682{
1683        if (da.isEmpty()) return false;
1684        return other == da.convert<double>();
1685}
1686
1687
1688inline bool operator != (const double& other, const DynamicAny& da)
1689        /// Inequality operator for comparing DynamicAny with double
1690{
1691        if (da.isEmpty()) return true;
1692        return other != da.convert<double>();
1693}
1694
1695
1696inline bool operator < (const double& other, const DynamicAny& da)
1697        /// Less than operator for comparing DynamicAny with double
1698{
1699        if (da.isEmpty()) return false;
1700        return other < da.convert<double>();
1701}
1702
1703
1704inline bool operator <= (const double& other, const DynamicAny& da)
1705        /// Less than or equal operator for comparing DynamicAny with double
1706{
1707        if (da.isEmpty()) return false;
1708        return other <= da.convert<double>();
1709}
1710
1711
1712inline bool operator > (const double& other, const DynamicAny& da)
1713        /// Greater than operator for comparing DynamicAny with double
1714{
1715        if (da.isEmpty()) return false;
1716        return other > da.convert<double>();
1717}
1718
1719
1720inline bool operator >= (const double& other, const DynamicAny& da)
1721        /// Greater than or equal operator for comparing DynamicAny with double
1722{
1723        if (da.isEmpty()) return false;
1724        return other >= da.convert<double>();
1725}
1726
1727
1728inline bool operator == (const bool& other, const DynamicAny& da)
1729        /// Equality operator for comparing DynamicAny with bool
1730{
1731        if (da.isEmpty()) return false;
1732        return other == da.convert<bool>();
1733}
1734
1735
1736inline bool operator != (const bool& other, const DynamicAny& da)
1737        /// Inequality operator for comparing DynamicAny with bool
1738{
1739        if (da.isEmpty()) return true;
1740        return other != da.convert<bool>();
1741}
1742
1743
1744inline bool operator == (const std::string& other, const DynamicAny& da)
1745        /// Equality operator for comparing DynamicAny with std::string
1746{
1747        if (da.isEmpty()) return false;
1748        return other == da.convert<std::string>();
1749}
1750
1751
1752inline bool operator != (const std::string& other, const DynamicAny& da)
1753        /// Inequality operator for comparing DynamicAny with std::string
1754{
1755        if (da.isEmpty()) return true;
1756        return other != da.convert<std::string>();
1757}
1758
1759
1760inline bool operator == (const char* other, const DynamicAny& da)
1761        /// Equality operator for comparing DynamicAny with const char*
1762{
1763        if (da.isEmpty()) return false;
1764        return da.convert<std::string>() == other;
1765}
1766
1767
1768inline bool operator != (const char* other, const DynamicAny& da)
1769        /// Inequality operator for comparing DynamicAny with const char*
1770{
1771        if (da.isEmpty()) return true;
1772        return da.convert<std::string>() != other;
1773}
1774
1775
1776#ifndef POCO_LONG_IS_64_BIT
1777
1778
1779inline long operator + (const long& other, const DynamicAny& da)
1780        /// Addition operator for adding DynamicAny to long
1781{
1782        return other + da.convert<long>();
1783}
1784
1785
1786inline long operator - (const long& other, const DynamicAny& da)
1787        /// Subtraction operator for subtracting DynamicAny from long
1788{
1789        return other - da.convert<long>();
1790}
1791
1792
1793inline long operator * (const long& other, const DynamicAny& da)
1794        /// Multiplication operator for multiplying DynamicAny with long
1795{
1796        return other * da.convert<long>();
1797}
1798
1799
1800inline long operator / (const long& other, const DynamicAny& da)
1801        /// Division operator for dividing DynamicAny with long
1802{
1803        return other / da.convert<long>();
1804}
1805
1806
1807inline long operator += (long& other, const DynamicAny& da)
1808        /// Addition assignment operator for adding DynamicAny to long
1809{
1810        return other += da.convert<long>();
1811}
1812
1813
1814inline long operator -= (long& other, const DynamicAny& da)
1815        /// Subtraction assignment operator for subtracting DynamicAny from long
1816{
1817        return other -= da.convert<long>();
1818}
1819
1820
1821inline long operator *= (long& other, const DynamicAny& da)
1822        /// Multiplication assignment operator for multiplying DynamicAny with long
1823{
1824        return other *= da.convert<long>();
1825}
1826
1827
1828inline long operator /= (long& other, const DynamicAny& da)
1829        /// Division assignment operator for dividing DynamicAny with long
1830{
1831        return other /= da.convert<long>();
1832}
1833
1834
1835inline bool operator == (const long& other, const DynamicAny& da)
1836        /// Equality operator for comparing DynamicAny with long
1837{
1838        if (da.isEmpty()) return false;
1839        return other == da.convert<long>();
1840}
1841
1842
1843inline bool operator != (const long& other, const DynamicAny& da)
1844        /// Inequality operator for comparing DynamicAny with long
1845{
1846        if (da.isEmpty()) return true;
1847        return other != da.convert<long>();
1848}
1849
1850
1851inline bool operator < (const long& other, const DynamicAny& da)
1852        /// Less than operator for comparing DynamicAny with long
1853{
1854        if (da.isEmpty()) return false;
1855        return other < da.convert<long>();
1856}
1857
1858
1859inline bool operator <= (const long& other, const DynamicAny& da)
1860        /// Less than or equal operator for comparing DynamicAny with long
1861{
1862        if (da.isEmpty()) return false;
1863        return other <= da.convert<long>();
1864}
1865
1866
1867inline bool operator > (const long& other, const DynamicAny& da)
1868        /// Greater than operator for comparing DynamicAny with long
1869{
1870        if (da.isEmpty()) return false;
1871        return other > da.convert<long>();
1872}
1873
1874
1875inline bool operator >= (const long& other, const DynamicAny& da)
1876        /// Greater than or equal operator for comparing DynamicAny with long
1877{
1878        if (da.isEmpty()) return false;
1879        return other >= da.convert<long>();
1880}
1881
1882
1883#endif // POCO_LONG_IS_64_BIT
1884
1885
1886} // namespace Poco
1887
1888
1889#endif // Foundation_DynamicAny_INCLUDED
Note: See TracBrowser for help on using the repository browser.