00001
00002
00003 #ifndef __SPIN_DBIO_H_
00004 #define __SPIN_DBIO_H_
00005
00006
00007 class SpinDbIOBase {
00008 public:
00009 SpinDbIOBase (int nmemb=0 ,int sz=1);
00010 virtual ~SpinDbIOBase();
00011 virtual int read (FILE *f) = 0;
00012 virtual int write(FILE *f) = 0;
00013 virtual char* setComment(char *c) { comment = c; return comment; };
00014 virtual char* getComment() { return comment; };
00015 void setData(char *ptr) { bytePtr = ptr; };
00016 void resetData(int sz=0) { memset(bytePtr,0x00,(sz>0) ? sz : bytes); };
00017 char *getData() { return (bytePtr); };
00018 int *getIndices(){ return (indexArr); };
00019 int getBytes() { return (bytes) ; };
00020 int getSize() { return (nElem); };
00021
00022
00023 protected:
00024 char *bytePtr;
00025 int bytes;
00026 int nElem;
00027 int *indexArr;
00028 char *comment;
00029 };
00030
00031
00032
00033 struct spinDbV124;
00034 class SpinDbV124IO : public SpinDbIOBase {
00035 public:
00036 SpinDbV124IO (int n);
00037 int read (FILE *f);
00038 int write(FILE *f);
00039 protected:
00040 spinDbV124 *data (int i=0);
00041 };
00042
00043
00044
00045 struct spinDbStar;
00046 class SpinDbStarIO : public SpinDbIOBase {
00047 public:
00048 SpinDbStarIO (int n);
00049 int read (FILE *f);
00050 int write(FILE *f);
00051 protected:
00052 spinDbStar *data (int i=0);
00053 };
00054
00055
00056
00057
00058 struct spinDbBXmask;
00059 class SpinDbBXmaskIO : public SpinDbIOBase {
00060 public:
00061 SpinDbBXmaskIO (int n);
00062 int read (FILE *f);
00063 int write(FILE *f);
00064 protected:
00065 spinDbBXmask *data (int i=0);
00066 };
00067
00068
00069 #endif
00070
00071
00072
00073
00074
00075