00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _OPENCITY_ANY_H_
00023 #define _OPENCITY_ANY_H_ 1
00024
00025 #include <string>
00026
00027 typedef enum {
00028 ANY_INT=0,
00029 ANY_UINT,
00030 ANY_DOUBLE,
00031 ANY_STRING
00032 } Any_t;
00033
00034
00035
00039 class Any
00040 {
00041 public:
00042 explicit Any(int value);
00043 explicit Any(unsigned int value);
00044 explicit Any(double value);
00045 explicit Any(const std::string& value);
00046
00047 Any_t getType() const;
00048 int getInt() const;
00049 unsigned int getUInt() const;
00050 double getDouble() const;
00051 const std::string& getString() const;
00052
00053 friend std::ostream& operator<<(std::ostream& os, const Any& any);
00054
00055 private:
00056 Any_t m_type;
00057 int m_int_value;
00058 unsigned int m_uint_value;
00059 double m_double_value;
00060 std::string m_string_value;
00061 };
00062
00063 #endif
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094