PlayaGeneralizedIndex.hpp

00001 /* @HEADER@ */
00002 //   
00003  /* @HEADER@ */
00004 
00005 #ifndef PLAYA_GENERALIZED_INDEX_HPP
00006 #define PLAYA_GENERALIZED_INDEX_HPP
00007 
00008 #include "PlayaDefs.hpp"
00009 #include <deque>
00010 
00011 namespace Playa
00012 {
00013 
00026 class GeneralizedIndex
00027 {
00028 public:
00030   GeneralizedIndex() : blockIndex_(), localIndex_(-1){}
00031 
00033   void pushBlockIndex(int b) {blockIndex_.push_back(b);}
00034 
00036   void popBlockIndex() {blockIndex_.pop_back();}
00037 
00039   int readBlockIndex() const {return blockIndex_.back();}
00040 
00042   void setLocalIndex(int i) {localIndex_=i;}
00043 
00045   int readLocalIndex() const {return localIndex_;}
00046 
00048   int depth() const {return blockIndex_.size();}
00049 
00051   const std::deque<int>& blockIndex() const {return blockIndex_;}
00052   
00053   
00054 private:
00055   std::deque<int> blockIndex_;
00056   int localIndex_;
00057 };
00058 
00059 }
00060 
00061 #endif

doxygen