CachedObject Class Reference

All objects that we want to add to the ObjectCache must be derived from a CachedObject base class. More...

#include <cache.h>

Inheritance diagram for CachedObject:

CCObject SimpleCCObject List of all members.

Public Member Functions

 CachedObject ()
 default constructor for CachedObject We get the size object: sizeof(this). It's used by the delete algorithms. Note:
 CachedObject (INT32 size)
 constructor for CachedObject. It's used mainly in debug build when I explicitly set the size of the object rather than using sizeof(). Note:
 CachedObject (BOOL immortal, UINT32 size)
 constructor for CachedObject.It's used mainly in debug build when I explicitly set the size of the object rather than using sizeof(). It also useful if I need to specify whether the objwect is immortal or not. The second parameter is optionnal. (e.g. CachedObject *pDummyObject = new CachedObject(TRUE); or: CachedObject *pDummyObject = new CachedObject(TRUE, 100); Note:
virtual ~CachedObject ()
 destructor for CachedObject Note:
BOOL StoreHandle (WORD Handle)
 store the CachedObject Handle generated by the add() function Note:
virtual UINT32 GetSize ()
virtual UINT32 GetChanceOfSurvival ()
BOOL IsImmortal ()

Protected Member Functions

virtual BOOL SetSize (UINT32 size)
 modify the size of the object Note:

Private Member Functions

 CC_DECLARE_DYNCREATE (CachedObject)

Private Attributes

UINT32 m_Size
BOOL m_Immortal
WORD m_hObj

Detailed Description

All objects that we want to add to the ObjectCache must be derived from a CachedObject base class.

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/01/97

Definition at line 121 of file cache.h.


Constructor & Destructor Documentation

CachedObject::CachedObject  ) 
 

default constructor for CachedObject We get the size object: sizeof(this). It's used by the delete algorithms. Note:

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/01/97
See also:

Definition at line 130 of file cache.cpp.

00131 {
00132     m_Size = sizeof(this);
00133     m_Immortal = FALSE;
00134     m_hObj = 0;
00135 }

CachedObject::CachedObject INT32  size  ) 
 

constructor for CachedObject. It's used mainly in debug build when I explicitly set the size of the object rather than using sizeof(). Note:

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/01/97
See also:

Definition at line 150 of file cache.cpp.

00151 {
00152     m_Size = size;
00153     m_Immortal = FALSE;
00154     m_hObj = 0;
00155 }

CachedObject::CachedObject BOOL  immortal,
UINT32  size
 

constructor for CachedObject.It's used mainly in debug build when I explicitly set the size of the object rather than using sizeof(). It also useful if I need to specify whether the objwect is immortal or not. The second parameter is optionnal. (e.g. CachedObject *pDummyObject = new CachedObject(TRUE); or: CachedObject *pDummyObject = new CachedObject(TRUE, 100); Note:

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/01/97
See also:

Definition at line 173 of file cache.cpp.

00174 {
00175     m_Size = size;
00176     m_Immortal = immortal;
00177     m_hObj = 0;
00178 }

CachedObject::~CachedObject  )  [virtual]
 

destructor for CachedObject Note:

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/01/97
See also:

Definition at line 191 of file cache.cpp.

00192 {
00193 }


Member Function Documentation

CachedObject::CC_DECLARE_DYNCREATE CachedObject   )  [private]
 

virtual UINT32 CachedObject::GetChanceOfSurvival  )  [inline, virtual]
 

Definition at line 134 of file cache.h.

00134 { return (GetSize()); }

virtual UINT32 CachedObject::GetSize  )  [inline, virtual]
 

Definition at line 133 of file cache.h.

00133 { return m_Size; }

BOOL CachedObject::IsImmortal  )  [inline]
 

Definition at line 136 of file cache.h.

00136 { return m_Immortal; }

BOOL CachedObject::SetSize UINT32  NewSize  )  [protected, virtual]
 

modify the size of the object Note:

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/02/97
See also:

Definition at line 228 of file cache.cpp.

00229 {
00230     m_Size = NewSize;
00231     return TRUE;
00232 }

BOOL CachedObject::StoreHandle WORD  Handle  ) 
 

store the CachedObject Handle generated by the add() function Note:

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/01/97
Parameters:
Handle,: the object handle [INPUTS] Return: TRUE
See also:

Definition at line 209 of file cache.cpp.

00210 {
00211     m_hObj = Handle;
00212 
00213     return TRUE;
00214 }


Member Data Documentation

WORD CachedObject::m_hObj [private]
 

Definition at line 144 of file cache.h.

BOOL CachedObject::m_Immortal [private]
 

Definition at line 143 of file cache.h.

UINT32 CachedObject::m_Size [private]
 

Definition at line 142 of file cache.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:51:43 2007 for Camelot by  doxygen 1.4.4