00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1994, 1996, 2002-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_H 00021 #define AEGIS_AER_VALUE_H 00022 00023 #include <common/ac/shared_ptr.h> 00024 #include <common/ac/stddef.h> 00025 00026 00031 class rpt_value 00032 { 00033 public: 00034 typedef aegis_shared_ptr<rpt_value> pointer; 00035 00039 virtual ~rpt_value(); 00040 00041 protected: 00045 rpt_value(); 00046 00047 public: 00058 static rpt_value::pointer integerize(const rpt_value::pointer &vp); 00059 00070 static rpt_value::pointer realize(const rpt_value::pointer &vp); 00071 00082 static rpt_value::pointer arithmetic(const rpt_value::pointer &vp); 00083 00094 static rpt_value::pointer undefer(const rpt_value::pointer &vp); 00095 00106 static rpt_value::pointer stringize(const rpt_value::pointer &vp); 00107 00118 static rpt_value::pointer booleanize(const rpt_value::pointer &vp); 00119 00123 virtual const char *name() const = 0; 00124 00134 virtual bool is_an_error() const; 00135 00145 virtual bool is_a_struct() const; 00146 00156 virtual rpt_value::pointer lookup(const rpt_value::pointer &rhs, 00157 bool lvalue) const; 00158 00163 virtual rpt_value::pointer keys() const; 00164 00169 virtual rpt_value::pointer count() const; 00170 00176 virtual const char *type_of() const; 00177 00178 protected: 00185 virtual rpt_value::pointer integerize_or_null() const; 00186 00193 virtual rpt_value::pointer realize_or_null() const; 00194 00202 virtual rpt_value::pointer arithmetic_or_null() const; 00203 00210 virtual rpt_value::pointer undefer_or_null() const; 00211 00218 virtual rpt_value::pointer stringize_or_null() const; 00219 00226 virtual rpt_value::pointer booleanize_or_null() const; 00227 00228 private: 00232 rpt_value(const rpt_value &); 00233 00237 rpt_value &operator=(const rpt_value &); 00238 }; 00239 00240 #endif // AEGIS_AER_VALUE_H