Proto
Proto_DataIndex.H
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 #ifndef _Proto_DataIndex_
11 #define _Proto_DataIndex_
12 #include <vector>
13 #include "Proto.H"
14 #include "Proto_DBLInternals.H"
15 namespace Proto
16 {
17  class DataIndex
18  {
19  protected:
20 
21  shared_ptr<DBLInternals > m_dblInternals;
22  int m_currentInt;
23 
24  public:
25 
26  DataIndex(){};
27  inline DataIndex(const shared_ptr<DBLInternals> a_dblInternals, int a_index)
28  {
29  m_dblInternals = a_dblInternals;
30  m_currentInt = a_index;
31  };
32  inline void defineEndIndex(const shared_ptr<DBLInternals> a_dblInternals, int a_end)
33  {
34  m_dblInternals = a_dblInternals;
35  m_currentInt = a_end;
36  }
37  ~DataIndex(){};
38  inline int intIndex() const { return m_currentInt; };
39 
40  inline bool operator==(const DataIndex& a_di) const
41  {return (m_dblInternals == a_di.m_dblInternals) && (m_currentInt == a_di.m_currentInt);};
42 
43  inline bool operator!=(const DataIndex& a_di) const
44  {return !(*this==a_di);};
45 
46  inline operator int() const { return m_currentInt; };
47  };
48  inline std::ostream& operator<<(std::ostream& os, const DataIndex& a_di)
49  {
50  return os << "index " << a_di.intIndex() << " " ;
51  }
52 }
53 #endif
std::ostream & operator<<(std::ostream &a_os, const Box &a_box)
OStream Operator.
Definition: Proto_Box.H:850
Definition: Proto_Box.H:11
Definition: Proto_DataIndex.H:17