00001 #ifndef GLITERATORSTORAGESTL_H_ 00002 #define GLITERATORSTORAGESTL_H_ 00003 00004 #include <stdlib.h> 00005 00006 #include "GLIterators.h" 00007 00011 template <class TStlContainer, class TStlIterator, class TOrganism> 00012 class GLIteratorStorageStl : public GLBidirectionalIterator<TOrganism> 00013 { 00014 public: 00019 GLIteratorStorageStl(TStlContainer& container); 00023 virtual ~GLIteratorStorageStl() {} 00024 00030 GLBidirectionalIterator<TOrganism>& operator++(); 00031 00037 GLBidirectionalIterator<TOrganism>& operator--(); 00038 00043 virtual TOrganism& getElement(); 00044 00049 virtual const TOrganism& getElement() const; 00050 00055 virtual bool isBegin() const 00056 { return m_it == m_container.begin(); } 00057 00064 virtual bool isEnd() const 00065 { return m_it == m_container.end(); } 00066 00071 virtual bool isNull() const 00072 { return (*m_it) == NULL; } 00073 private: 00074 TStlContainer &m_container; //reference to container with organisms. 00075 TStlIterator m_it; //main iterator 00076 00077 }; 00078 00079 #endif /* GLITERATORSTORAGE_H_ */