00001
00005 #ifndef DIVINE_DATA_HH
00006 #define DIVINE_DATA_HH
00007
00008 #ifndef DOXYGEN_PROCESSING
00009 #include "common/types.hh"
00010
00011 namespace divine {
00012 #endif // DOXYGEN_PROCESSING
00013
00014 const ushort_int_t DATA_TYPE_UNKNOWN=MAX_USHORT_INT;
00015 const ushort_int_t DATA_TYPE_SBYTE=0;
00016 const ushort_int_t DATA_TYPE_UBYTE=1;
00017 const ushort_int_t DATA_TYPE_BYTE =1;
00018 const ushort_int_t DATA_TYPE_SSHORT_INT=2;
00019 const ushort_int_t DATA_TYPE_USHORT_INT=3;
00020 const ushort_int_t DATA_TYPE_SLONG_INT=4;
00021 const ushort_int_t DATA_TYPE_ULONG_INT=5;
00022 const ushort_int_t DATA_TYPE_SIZE_INT=6;
00023
00025 class data_t
00026 {
00027 private:
00028 byte_t * mem;
00029 size_int_t size;
00030 size_int_t data_type;
00031
00032 public:
00033 data_t() { mem=new byte_t[4]; size=4; data_type = DATA_TYPE_SLONG_INT; }
00034 ~data_t() { delete [] mem; }
00035 template <class T> void assign(const T & value)
00036 {
00037 if (size!=sizeof(T)) { delete [] mem; mem = new byte_t[sizeof(T)]; }
00038 memcpy(mem,&value,sizeof(T));
00039 }
00040 };
00041
00042 #ifndef DOXYGEN_PROCESSING
00043 }
00044 #include "common/undeb.hh"
00045
00046 #endif //DOXYGEN_PROCESSING
00047
00048 #endif
00049
00050