00001 #ifndef __GEMFIRE_SELECTRESULTSITERATOR_H__ 00002 #define __GEMFIRE_SELECTRESULTSITERATOR_H__ 00003 /*========================================================================= 00004 * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved. 00005 * This product is protected by U.S. and international copyright 00006 * and intellectual property laws. Pivotal products are covered by 00007 * more patents listed at http://www.pivotal.io/patents. 00008 *======================================================================== 00009 */ 00010 00015 #include "gfcpp_globals.hpp" 00016 #include "gf_types.hpp" 00017 #include "ExceptionTypes.hpp" 00018 #include "Serializable.hpp" 00019 00020 #include "SelectResults.hpp" 00021 #include "CacheableBuiltins.hpp" 00022 00023 namespace gemfire 00024 { 00025 00026 class ResultSetImpl; 00027 class StructSetImpl; 00028 00034 class CPPCACHE_EXPORT SelectResultsIterator : public SharedBase 00035 { 00036 public: 00037 00043 bool hasNext() const; 00044 00050 const SerializablePtr next(); 00051 00057 bool moveNext(); 00058 00064 const SerializablePtr current() const; 00065 00069 void reset(); 00070 00071 private: 00072 00076 SelectResultsIterator(const CacheableVectorPtr& vectorSR, SelectResultsPtr srp); 00077 00078 CacheableVectorPtr m_vectorSR; 00079 int32_t m_nextIndex; 00080 // this is to ensure that a reference of SelectResults is kept alive 00081 // if an iterator object is present 00082 SelectResultsPtr m_srp; 00083 00084 friend class ResultSetImpl; 00085 friend class StructSetImpl; 00086 }; 00087 00088 } //namespace gemfire 00089 00090 #endif //ifndef __GEMFIRE_SELECTRESULTSITERATOR_H__