00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <iostream.h>
00017 #include "camtype.h"
00018
00019 #ifndef __NO_COMPLEX__
00020 #define __NO_COMPLEX__
00021 #endif
00022 #ifndef __NO_COMPLEX__
00023 #include<complex.h>
00024 #endif
00025
00026 #ifndef __CAMDATAHANDLER__
00027 #define __CAMDATAHANDLER__
00028
00029 #include "mvaimpexp.h"
00030
00031 class __IMPEXP__ CAMdataHandler
00032 {
00033
00034 public :
00035
00036 int dataType;
00037 void* dataPointer;
00038 long dataSize;
00039 int temporaryFlag;
00040 int referenceCount;
00041
00042 public :
00043
00044
00045
00046
00047 CAMdataHandler();
00048 CAMdataHandler( const CAMdataHandler& A);
00049 CAMdataHandler(long size, int dType);
00050
00051
00052
00053 ~CAMdataHandler();
00054
00055
00056
00057 CAMdataHandler& operator = ( const CAMdataHandler& A);
00058
00059
00060
00061 __IMPEXP__ friend ostream& operator <<(ostream& out_stream, const CAMdataHandler& A);
00062
00063
00064
00065 void initialize();
00066 void initialize(const CAMdataHandler& H);
00067 void initialize(long size, int dType);
00068 void allocateData(long size, int dType);
00069 void copyData(long size, void* dataP);
00070 void destroyData();
00071 void setTypeFlag(int dType);
00072 int getDataType() const {return dataType;};
00073 long getDataSize() const {return dataSize;};
00074 void setDataSize(long size){dataSize = size;};
00075 void setTemporaryFlag(){temporaryFlag = 1;};
00076 int getTemporaryFlag()const{return temporaryFlag;};
00077 void incrementReferenceCount();
00078 void decrementReferenceCount(){referenceCount--;};
00079 int getReferenceCount() const {return referenceCount;};
00080 void setReferenceCount(int refValue){referenceCount = refValue;};
00081 static void referenceCountError();
00082
00083
00084
00085 void* getDataPointer() const {return dataPointer;};
00086 void setDataPointer(int* i){dataPointer = i;};
00087 void setDataPointer(long* l){dataPointer = l;};
00088 void setDataPointer(float* f){dataPointer = f;};
00089 void setDataPointer(double* d){dataPointer = d;};
00090 void getDataValue(long index, int& i) const {i = *((int*)(dataPointer) + index);};
00091 void getDataValue(long index, long& l) const {l = *((long*)(dataPointer) + index);};
00092 void getDataValue(long index, float& f) const {f = *((float*)(dataPointer) + index);};
00093 void getDataValue(long index, double& d) const {d = *((double*)(dataPointer) + index);};
00094 #ifndef __NO_COMPLEX__
00095 void setDataPointer(complex* c){dataPointer = c;};
00096 void getDataValue(long index, complex& c) const {c = *((complex*)(dataPointer) + index);}
00097 #endif
00098
00099 };
00100
00101 #endif
00102
00103
00104
00105
00106
00107
00108
00109