00001 #ifndef _CTBcarray_HXX 00002 #define _CTBcarray_HXX 1 00003 00008 /*----------------------------------------------------------------------------*/ 00009 /* C Tool Box: Designed and implemented by: */ 00010 /* Walter F.J. Mueller Gesellschaft fuer Schwerionenforschung (GSI) */ 00011 /* Planckstrasse 1, D-64291 Darmstadt, Germany */ 00012 /* Email: W.F.J.Mueller@gsi.de */ 00013 /* WWW: http://www-kp3.gsi.de/www/kp3/people/mueller.html */ 00014 /*------------------------------------------+---------------------------------*/ 00015 00016 #include "CTBvectorDsc.hxx" 00017 00018 template <class T, CTBint DIM> 00019 class CTBcarray { 00020 public: 00021 00022 CTBcarray(); 00023 explicit CTBcarray(T rhs); 00024 00025 CTBcarray(const CTBcarray<T,DIM>& rhs); 00026 00027 T& operator[](CTBint i_ind); 00028 const T& operator[](CTBint i_ind) const; 00029 00030 T& operator()(CTBint i_ind); 00031 const T& operator()(CTBint i_ind) const; 00032 00033 operator T*(); 00034 operator const T*() const; 00035 00036 operator CTBvectorDsc<T>(); 00037 operator CTBvectorCDsc<T>() const; 00038 00039 bool operator==(T rhs); 00040 bool operator==(const CTBcarray<T,DIM>& rhs); 00041 00042 CTBcarray<T,DIM>& operator=(T rhs); 00043 CTBcarray<T,DIM>& operator=(const CTBcarray<T,DIM>& rhs); 00044 00045 protected: 00046 00047 T m_data[DIM]; 00048 }; 00049 00050 template <class T, CTBint DIM> 00051 ostream& operator<<(ostream& os, const CTBcarray<T,DIM>& obj); 00052 00053 // implementation is all inline !! 00054 #include "CTBcarray.icc" 00055 00056 #endif