00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef _RTXCPPBASETYPE_H_
00029 #define _RTXCPPBASETYPE_H_
00030
00031 #include "rtxsrc/rtxCppContext.h"
00032
00039 class EXTERNRTX OSBaseType {
00040 protected:
00041 OSBOOL mbOwnMemory;
00042 public:
00043 OSBaseType() : mbOwnMemory(FALSE) {}
00044 virtual ~OSBaseType() {}
00045
00053 inline void setOwnMemory (OSBOOL bvalue=TRUE) { mbOwnMemory=bvalue; }
00054 #ifdef FASTMM
00055 void* operator new (size_t size, OSCTXT* pctxt) {
00056 return rtxMemAlloc (pctxt, size);
00057 }
00058 void operator delete (void* ptr, OSCTXT* pctxt) {
00059 rtxMemFreePtr (pctxt, ptr);
00060 }
00061 void operator delete (void* ptr) {}
00062 void destruct (OSCTXT* pctxt) {
00063 this->~OSBaseType(); rtxMemFreePtr (pctxt, this);
00064 }
00065 #define OSNEW(pctxt,type) (pctxt)new type
00066 #else
00067 #define OSNEW(pctxt,type) new type
00068 #endif
00069 } ;
00070
00071 #endif