libdap
Updated for version 3.17.0
|
00001 00002 // -*- mode: c++; c-basic-offset:4 -*- 00003 00004 // This file is part of libdap, A C++ implementation of the OPeNDAP Data 00005 // Access Protocol. 00006 00007 // Copyright (c) 2002,2003 OPeNDAP, Inc. 00008 // Author: James Gallagher <jgallagher@opendap.org> 00009 // 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Lesser General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2.1 of the License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00023 // 00024 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. 00025 00026 // (c) COPYRIGHT URI/MIT 1998-1999 00027 // Please read the full copyright statement in the file COPYRIGHT_URI. 00028 // 00029 // Authors: 00030 // jhrg,jimg James Gallagher <jgallagher@gso.uri.edu> 00031 00032 #ifndef _rvalue_h 00033 #define _rvalue_h 00034 00035 #include <dods-datatypes.h> 00036 00037 namespace libdap 00038 { 00039 00046 class rvalue 00047 { 00048 private: 00049 BaseType *d_value; 00050 btp_func d_func; // pointer to a function returning BaseType * 00051 std::vector<rvalue *> *d_args; // arguments to the function 00052 00053 public: 00054 typedef std::vector<rvalue *>::iterator Args_iter ; 00055 typedef std::vector<rvalue *>::const_iterator Args_citer ; 00056 00057 rvalue(BaseType *bt); 00058 rvalue(btp_func f, std::vector<rvalue *> *a); 00059 rvalue(); 00060 00061 virtual ~rvalue(); 00062 std::string value_name(); 00063 00064 BaseType *bvalue(DDS &dds); 00065 }; 00066 00067 // This type def must come after the class definition above. It is used in 00068 // the Clause and DDS classes. 00069 typedef std::vector<rvalue *> rvalue_list; 00070 typedef std::vector<rvalue *>::const_iterator rvalue_list_citer ; 00071 typedef std::vector<rvalue *>::iterator rvalue_list_iter ; 00072 00073 typedef std::vector<dods_byte> *byte_arg_list; 00074 typedef std::vector<dods_int16> *int16_arg_list; 00075 typedef std::vector<dods_uint16> *uint16_arg_list; 00076 typedef std::vector<dods_int32> *int32_arg_list; 00077 typedef std::vector<dods_uint32> *uint32_arg_list; 00078 typedef std::vector<dods_float32> *float32_arg_list; 00079 typedef std::vector<dods_float64> *float64_arg_list; 00080 00081 rvalue_list *make_rvalue_list(rvalue *rv); 00082 rvalue_list *append_rvalue_list(rvalue_list *rvals, rvalue *rv); 00083 00084 BaseType **build_btp_args(rvalue_list *args, DDS &dds); 00085 00086 } // namespace libdap 00087 #endif // _rvalue_h