Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

cBufferItem.cpp

Go to the documentation of this file.
00001 /******************************************************************************/
00002 /*                                                                            */
00003 /* POLiTe - Persistent Object Library Test                                    */
00004 /*                                        Ph.D. Thesis by Mgr. Michal Kopecky */
00005 /*                                                                            */
00006 /* Charles University Prague                                                  */
00007 /*                                                                            */
00008 /******************************************************************************/
00009 /*                                                                            */
00010 /* File name: ...                                                             */
00011 /* Module: ......                                                             */
00012 /*                                                                            */
00013 /******************************************************************************/
00014 
00015 // Standard Header(s)
00016 #include <malloc.h>
00017 
00018 // Common POLiTe Header(s)
00019 #include <lDefs.h>
00020 #include <lTypes.h>
00021 #include <lTrace.h>
00022 
00023 // Own Header
00024 #include <cBufferItem.h>
00025 
00026 // Other POLiTe Header(s)
00027 #include <cRefBase.h>
00028 
00029 BufferItem::BufferItem()
00030 //Creates a new BufferItem
00031 {
00032         #ifdef C_BUFFERITEM_TRACE
00033                 logmsg("BufferItem::BufferItem() invoked");
00034         #endif
00035         _MemoryPointer = NULL;
00036         _RefBase = NULL;
00037         _Next = NULL;
00038 };
00039 
00040 BufferItem::BufferItem(
00041         const class RefBase &DbPtr,
00042         const class Object *const MemPtr
00043         )
00044 //Creates a new BufferItem with all
00045 {
00046         #ifdef C_BUFFERITEM_TRACE
00047                 logmsg("BufferItem::BufferItem(...) invoked ");
00048         #endif
00049         Set(DbPtr,MemPtr);
00050         #ifdef C_BUFFERITEM_TRACE
00051                 logmsg("BufferItem::BufferItem(...) finished ");
00052         #endif
00053 };
00054 
00055 BufferItem::~BufferItem()
00056 //BufferItem object destructor
00057 {
00058   #ifdef C_BUFFERITEM_TRACE
00059          logmsg("BufferItem::~BufferItem() invoked and finished");
00060          #endif
00061   if (_RefBase != NULL)
00062          delete((RefBase *)_RefBase);
00063   };
00064 
00065 bool BufferItem::Set(const RefBase &DbPtr, const Object *MemPtr)
00066 //
00067 {
00068   #ifdef C_BUFFERITEM_TRACE
00069          logmsg("BufferItem::Set() invoked");
00070          #endif
00071   _MemoryPointer = MemPtr;
00072   _RefBase = new RefBase(DbPtr);
00073   _Next = NULL;
00074   #ifdef C_BUFFERITEM_TRACE
00075          logmsg("BufferItem::Set() finished");
00076          #endif
00077   return(true);
00078   };
00079 
00080 RefBase &BufferItem::GetRefBase() const
00081 //
00082 {
00083         #ifdef C_BUFFERITEM_TRACE
00084                 logmsg("BufferItem::GetRefBase() invoked and finish");
00085         #endif
00086         return (*(RefBase *)_RefBase);
00087 };
00088 
00089 Object *BufferItem::GetMemoryPointer() const
00090 //
00091 {
00092         #ifdef C_BUFFERITEM_TRACE
00093                 logmsg("BufferItem::GetMemoryPointer() invoked and finished");
00094         #endif
00095         return (Object *)_MemoryPointer;
00096 };

Generated on Sun Jul 14 20:51:13 2002 for POLiTe by doxygen1.2.16