00001 #ifndef FDO_ISCROLLABLEFEATUREREADER_H_ 00002 #define FDO_ISCROLLABLEFEATUREREADER_H_ 00003 // 00004 00005 // 00006 // Copyright (C) 2004-2006 Autodesk, Inc. 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of version 2.1 of the GNU Lesser 00010 // General Public License as published by the Free Software Foundation. 00011 // 00012 // This library is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with this library; if not, write to the Free Software 00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 // 00021 00022 #ifdef _WIN32 00023 #pragma once 00024 #endif 00025 00026 #include <FdoStd.h> 00027 #include <Fdo/Commands/PropertyValueCollection.h> 00028 #include <Fdo/Commands/Feature/IReader.h> 00029 00030 /// \brief 00031 /// The FdoIScrollableFeatureReader interface provides a read-only iterator 00032 /// for reading feature data. Reading can be done in forward, reverse 00033 /// or random order. A reference to an FdoIScrollableFeatureReader is returned 00034 /// from the ExtendedSelect command. Because the initial position of the 00035 /// FdoIScrollableFeatureReader is prior to the first item, you must call one of the 00036 /// Read functions to begin accessing any data. 00037 class FdoIScrollableFeatureReader : public FdoIFeatureReader 00038 { 00039 public: 00040 00041 /// \brief 00042 /// Returns the number of records of the query result. 00043 /// 00044 /// \return 00045 /// Returns number of records. 00046 virtual FdoInt32 Count() = 0; 00047 00048 /// \brief 00049 /// Positions the reader at the first record of the query result. 00050 /// 00051 /// \return 00052 /// Returns true if a record is found or false if the result is empty. 00053 virtual FdoBoolean ReadFirst() = 0; 00054 00055 /// \brief 00056 /// Position the reader at the last record of the query result. 00057 /// 00058 /// \return 00059 /// Returns true if a record is found or false if the result is empty. 00060 virtual FdoBoolean ReadLast() = 0; 00061 00062 /// \brief 00063 /// Advances the reader to the previous item. 00064 /// 00065 /// \remarks 00066 /// The default position of the reader is prior to the first item. 00067 /// Therefore you must call ReadFirst or ReadLast to 00068 /// begin accessing any data. 00069 /// 00070 /// \return 00071 /// Returns true if a record is found or false if reading is complete. 00072 virtual FdoBoolean ReadPrevious() = 0; 00073 00074 /// \brief 00075 /// Provides the ad-hoc access to the query result. 00076 /// 00077 /// \remarks 00078 /// It positions the position of the reader at a given record 00079 /// defined by the key. If the record is not found, 00080 /// then the reader position is unset and false value is returned. 00081 /// Once the reader’s position becames unset, 00082 /// the caller needs to call ReadFirst, ReadLast or ReadAt to re-position 00083 /// the reader at a valid location. 00084 /// 00085 /// \param key 00086 /// The key that identifies a record. 00087 /// 00088 /// \return 00089 /// Returns true if a record is found or false otherwise. 00090 virtual FdoBoolean ReadAt(FdoPropertyValueCollection* key) = 0; 00091 00092 /// \brief 00093 /// Provides an ad-hoc access to the query result. 00094 /// 00095 /// \remarks 00096 /// The recordindex is the one-based nth item in the query result. 00097 /// If successful, this method will position the reader at the feature identified by the recordindex. 00098 /// 00099 /// \param recordindex 00100 /// The index of the row. 00101 /// 00102 /// \return 00103 /// Returns true if a record is found or false otherwise. 00104 virtual FdoBoolean ReadAtIndex( unsigned int recordindex ) = 0; 00105 00106 /// \brief 00107 /// Given a key of a feature, IndexOf will return the one based index or the record number of the feature within 00108 /// the returned query result. 00109 /// \remarks 00110 /// If the record is not found, then zero is retuned. 00111 /// This is the mirror function of the ReadAtIndex function. 00112 /// This method does not affect the reader position. 00113 /// ReadAtIndex need to be called to move the reader to the returned index. 00114 /// 00115 /// \param key 00116 /// The key that identifies a record. 00117 /// 00118 /// \return 00119 /// Returns true if a record is found or false otherwise. 00120 virtual unsigned int IndexOf(FdoPropertyValueCollection* key) = 0; 00121 }; 00122 #endif 00123 00124