00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SELDON_FILE_ALLOCATOR_HXX
00021
00022 namespace Seldon
00023 {
00024
00025
00027
00029
00030
00031 template <class T>
00032 class MallocAlloc
00033 {
00034 public:
00035 typedef T value_type;
00036 typedef T* pointer;
00037 typedef const T* const_pointer;
00038 typedef T& reference;
00039 typedef const T& const_reference;
00040
00041 public:
00042
00043 pointer allocate(int num, void* h = 0);
00044 void deallocate(pointer data, int num, void* h = 0);
00045 void* reallocate(pointer data, int num, void* h = 0);
00046 void memoryset(pointer data, char c, size_t num);
00047 void memorycpy(pointer datat, pointer datas, size_t num);
00048 };
00049
00050
00052
00054
00055
00056 template <class T>
00057 class CallocAlloc
00058 {
00059 public:
00060 typedef T value_type;
00061 typedef T* pointer;
00062 typedef const T* const_pointer;
00063 typedef T& reference;
00064 typedef const T& const_reference;
00065
00066 public:
00067
00068 pointer allocate(int num, void* h = 0);
00069 void deallocate(pointer data, int num, void* h = 0);
00070 void* reallocate(pointer data, int num, void* h = 0);
00071 void memoryset(pointer data, char c, size_t num);
00072 void memorycpy(pointer datat, pointer datas, size_t num);
00073 };
00074
00075
00077
00079
00080
00081 template <class T>
00082 class NewAlloc
00083 {
00084 public:
00085 typedef T value_type;
00086 typedef T* pointer;
00087 typedef const T* const_pointer;
00088 typedef T& reference;
00089 typedef const T& const_reference;
00090
00091 public:
00092
00093 pointer allocate(int num, void* h = 0);
00094 void deallocate(pointer data, int num, void* h = 0);
00095 void* reallocate(pointer data, int num, void* h = 0);
00096 void memoryset(pointer data, char c, size_t num);
00097 void memorycpy(pointer datat, pointer datas, size_t num);
00098 };
00099
00100
00102
00104
00105
00106 template <class T>
00107 class MallocObject
00108 {
00109 public:
00110 typedef T value_type;
00111 typedef T* pointer;
00112 typedef const T* const_pointer;
00113 typedef T& reference;
00114 typedef const T& const_reference;
00115
00116 public:
00117
00118 pointer allocate(int num, void* h = 0);
00119 void deallocate(pointer data, int num, void* h = 0);
00120 void* reallocate(pointer data, int num, void* h = 0);
00121 void memoryset(pointer data, char c, size_t num);
00122 void memorycpy(pointer datat, pointer datas, size_t num);
00123 };
00124
00125
00127
00129
00130
00131 template <class T>
00132 class NaNAlloc
00133 {
00134 public:
00135 typedef T value_type;
00136 typedef T* pointer;
00137 typedef const T* const_pointer;
00138 typedef T& reference;
00139 typedef const T& const_reference;
00140
00141 public:
00142
00143 pointer allocate(int num, void* h = 0);
00144 void deallocate(pointer data, int num, void* h = 0);
00145 void* reallocate(pointer data, int num, void* h = 0);
00146 void memoryset(pointer data, char c, size_t num);
00147 void memorycpy(pointer datat, pointer datas, size_t num);
00148 };
00149
00150
00151 }
00152
00153 #define SELDON_FILE_ALLOCATOR_HXX
00154 #endif