SimObjectIDSortedVector.h

Go to the documentation of this file.
00001 #ifndef SimObjectIDSortedVector_H_
00002 #define SimObjectIDSortedVector_H_
00003 
00004 #include "SimObject.h"
00005 
00006 
00007 class SimObjectIDSortedVector
00008 {
00009 public:
00010 
00011         typedef vector<unsigned>::const_iterator const_iterator;
00012         
00013         typedef vector<unsigned>::iterator iterator;
00014         
00015         SimObjectIDSortedVector(const SimObject::ID::Vector &v, const nodeid_t localnode, bool sorted = true);
00016         
00017         SimObjectIDSortedVector(const vector<SimObject::ID::Packed> &v, const nodeid_t localnode, bool sorted = true);
00018         
00019         virtual ~SimObjectIDSortedVector();
00020         
00021         const_iterator beginBlock();
00022         
00023         const_iterator endBlock();
00024         
00025         nodeid_t nextBlock();
00026         
00027         bool hasNextBlock();
00028         
00029         void startBlockIteration();
00030         
00031         void startBlockIterationFromLocal();
00032         
00033         const_iterator localIDsBegin();
00034         
00035         const_iterator localIDsEnd();
00036         
00037         const_iterator begin()
00038         {
00039                 return index_vec.begin();
00040         }
00041 
00042         const_iterator end()
00043         {
00044                 return index_vec.end(); 
00045         }
00046          
00047         
00048 protected:
00049         void init(const vector<SimObject::ID::Packed> *v, nodeid_t localnode, bool sorted);
00050 
00051         vector<unsigned> index_vec;
00052         
00053         vector<SimObject::ID::Packed> const * vec; 
00054         
00055         const_iterator begin_it;
00056         const_iterator end_it;
00057         
00058         iterator localids_begin_it;
00059         const_iterator localids_end_it;         
00060 };
00061 
00062 #endif /*SimObjectIDSortedVector_H_*/

Generated on Wed Jul 9 16:34:38 2008 for PCSIM by  doxygen 1.5.5