00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1994, 1996, 2002, 2005-2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef AEGIS_AER_VALUE_ENUM_H 00021 #define AEGIS_AER_VALUE_ENUM_H 00022 00023 #include <common/nstring.h> 00024 #include <libaegis/aer/value.h> 00025 00026 00031 class rpt_value_enumeration: 00032 public rpt_value 00033 { 00034 public: 00038 virtual ~rpt_value_enumeration(); 00039 00040 private: 00045 rpt_value_enumeration(int ival, const nstring &sval); 00046 00047 public: 00052 static rpt_value::pointer create(int ival, const nstring &sval); 00053 00058 static rpt_value::pointer create(int ival, const char *sval); 00059 00063 int query() const; 00064 00065 protected: 00066 // See base class for documentation. 00067 rpt_value::pointer integerize_or_null() const; 00068 00069 // See base class for documentation. 00070 const char *name() const; 00071 00072 // See base class for documentation. 00073 rpt_value::pointer stringize_or_null() const; 00074 00075 // See base class for documentation. 00076 rpt_value::pointer arithmetic_or_null() const; 00077 00078 // See base class for documentation. 00079 rpt_value::pointer booleanize_or_null() const; 00080 00081 // See base class for documentation. 00082 rpt_value::pointer realize_or_null() const; 00083 00084 private: 00089 int ival; 00090 00095 nstring sval; 00096 00100 rpt_value_enumeration(); 00101 00105 rpt_value_enumeration(const rpt_value_enumeration &); 00106 00110 rpt_value_enumeration &operator=(const rpt_value_enumeration &); 00111 }; 00112 00113 #endif // AEGIS_AER_VALUE_ENUM_H