00001 00002 00003 00004 00005 /*********************************************************************** 00006 Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by 00007 MySQL AB, and (c) 2004-2007 by Educational Technology Resources, Inc. 00008 Others may also hold copyrights on code in this file. See the CREDITS 00009 file in the top directory of the distribution for details. 00010 00011 This file is part of MySQL++. 00012 00013 MySQL++ is free software; you can redistribute it and/or modify it 00014 under the terms of the GNU Lesser General Public License as published 00015 by the Free Software Foundation; either version 2.1 of the License, or 00016 (at your option) any later version. 00017 00018 MySQL++ is distributed in the hope that it will be useful, but WITHOUT 00019 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00020 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00021 License for more details. 00022 00023 You should have received a copy of the GNU Lesser General Public 00024 License along with MySQL++; if not, write to the Free Software 00025 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00026 USA 00027 ***********************************************************************/ 00028 00029 #ifndef MYSQLPP_FIELDS_H 00030 #define MYSQLPP_FIELDS_H 00031 00032 #include "resiter.h" 00033 00034 namespace mysqlpp { 00035 00036 #if !defined(DOXYGEN_IGNORE) 00037 // Make Doxygen ignore this 00038 class MYSQLPP_EXPORT ResUse; 00039 #endif 00040 00043 00044 class MYSQLPP_EXPORT Fields : public const_subscript_container<Fields, Field> 00045 { 00046 public: 00048 Fields() { } 00049 00051 Fields(ResUse* r) : 00052 res_(r) 00053 { 00054 } 00055 00057 const Field& at(Fields::size_type i) const; 00058 00060 const Field& at(int i) const 00061 { 00062 return at(static_cast<size_type>(i)); 00063 } 00064 00065 size_type size() const; 00066 00067 private: 00068 mutable ResUse* res_; 00069 }; 00070 00071 } // end namespace mysqlpp 00072 00073 #endif