Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MEDMEM_ARRAYINTERFACE_HXX
00024 #define MEDMEM_ARRAYINTERFACE_HXX
00025
00026 #include "MEDMEM_nArray.hxx"
00027 #include "MEDMEM_InterlacingTraits.hxx"
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 namespace MEDMEM {
00039
00040 template < class ARRAY_ELEMENT_TYPE,
00041 class INTERLACE_TAG,
00042 class GAUSS_TAG,
00043 class CHECKING_POLICY=IndexCheckPolicy>
00044
00045 class MEDMEM_EXPORT MEDMEM_ArrayInterface {
00046
00047 public:
00048
00049
00050
00051
00052 typedef ARRAY_ELEMENT_TYPE ElementType;
00053 typedef INTERLACE_TAG Interlacing;
00054 typedef GAUSS_TAG GaussPresence;
00055 typedef typename MEDMEM_InterlacingTraits<Interlacing,GaussPresence>::Type InterlacingPolicy;
00056 typedef CHECKING_POLICY CheckingPolicy;
00057 typedef MEDMEM_Array<ElementType,InterlacingPolicy,CheckingPolicy> Array;
00058
00059 static inline int getNbGauss(int i, const Array & array) {
00060 return array.getNbGauss(i);
00061 };
00062
00063 static inline ElementType * getPtr( Array & array) {
00064 return array.getPtr();
00065 };
00066
00067 static inline void setPtr( ElementType * arrayptr, Array & array,
00068 bool shallowCopy=false,
00069 bool ownershipOfValues=false ) {
00070 array.setPtr(arrayptr,shallowCopy,ownershipOfValues);
00071 };
00072
00073 static inline const ElementType * getRow(int i, const Array & array ) {
00074 return array.getRow(i);
00075 }
00076
00077 static inline void setRow(int i, const ElementType & value, const Array & array ) {
00078 return array.setRow(i,value);
00079 }
00080
00081 static inline const ElementType * getColumn(int j, const Array & array ) {
00082 return array.getColumn(j);
00083 }
00084
00085 static inline void setColumn(int j, const ElementType & value, const Array & array ) {
00086 return array.setColumn(j,value);
00087 }
00088
00089 static inline const ElementType & getIJ(int i, int j, const Array & array) {
00090 return array.getIJ(i,j);
00091 }
00092
00093 static inline const ElementType & getIJK(int i, int j, int k, const Array & array) {
00094 return array.getIJK(i,j,k);
00095 }
00096
00097 static inline void setIJ(int i, int j, const ElementType & value, Array & array) {
00098 array.setIJ(i,j,value);
00099 }
00100
00101 static inline void setIJK(int i, int j, int k, const ElementType & value, Array & array) {
00102 array.setIJK(i,j,k,value);
00103 }
00104
00105 };
00106
00107 }
00108 #endif