Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

any.h

00001 /***************************************************************************
00002                             any.h  -  description
00003                             -------------------
00004     begin                : nov 29th 2005
00005     copyright            : (C) 2005 by Duong-Khang NGUYEN
00006     email                : neoneurone @ users sourceforge net
00007     author               : Victor STINNER
00008 
00009     $Id: any.h 32 2006-08-06 18:59:25Z neoneurone $
00010  ***************************************************************************/
00011 
00012 /***************************************************************************
00013  *                                                                         *
00014  *   This program is free software; you can redistribute it and/or modify  *
00015  *   it under the terms of the GNU General Public License as published by  *
00016  *   the Free Software Foundation; either version 2 of the License, or     *
00017  *   any later version.                                                    *
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 

Generated on Sat Nov 11 10:21:09 2006 for OpenCity by  doxygen 1.4.2