00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _ARRAYVIEWDATA_H_ 00012 #define _ARRAYVIEWDATA_H_ 00013 00014 #include "REAL.H" 00015 #include "BaseFab.H" 00016 #include "FArrayBox.H" 00017 #include "LayoutData.H" 00018 #include "NamespaceHeader.H" 00019 00021 00028 class ArrayViewData 00029 { 00030 public: 00031 ArrayViewData() 00032 : 00033 m_layoutdata_ptr(NULL) 00034 {} 00035 00036 ~ArrayViewData() 00037 {} 00038 00039 ArrayViewData(LayoutData<BaseFab<Real> >* a_layoutdata_ptr) 00040 : 00041 m_layoutdata_ptr(a_layoutdata_ptr) 00042 {} 00043 00044 ArrayViewData(LayoutData<FArrayBox>* a_layoutdata_ptr) 00045 : 00046 m_layoutdata_ptr((LayoutData<BaseFab<Real> >*) a_layoutdata_ptr) 00047 {} 00048 00050 BaseFab<Real>& operator[](int a_elem) 00051 { 00052 return *(m_layoutdata_ptr->m_vector[a_elem]); 00053 } 00054 00056 00059 void set(int a_elem, 00060 BaseFab<Real>* a_fab_ptr) 00061 { 00062 m_layoutdata_ptr->m_vector[a_elem] = a_fab_ptr; 00063 } 00064 00065 00066 private: 00067 LayoutData<BaseFab<Real> >* m_layoutdata_ptr; 00068 }; 00069 00070 #include "NamespaceFooter.H" 00071 #endif