CBitmapCacheKey Class Reference

#include <bitmapcachekey.h>

List of all members.

Public Member Functions

 CBitmapCacheKey ()
 CBitmapCacheKey (LPVOID pNewOwner, double dNewPixelWidth, UINT32 nNewOption=0)
 CBitmapCacheKey (const CBitmapCacheKey &key)
virtual ~CBitmapCacheKey ()
BOOL IsValid () const
UINT32 Hash () const
void SetOwner (LPVOID pNewOwner)
double GetPixelWidth () const
bool operator== (const CBitmapCacheKey &key) const

Private Attributes

LPVOID pOwner
double dPixelWidth
UINT32 nOption

Friends

class CBitmapCache


Detailed Description

Definition at line 105 of file bitmapcachekey.h.


Constructor & Destructor Documentation

CBitmapCacheKey::CBitmapCacheKey  ) 
 

Definition at line 110 of file bitmapcachekey.cpp.

00111 {
00112     memset(&pOwner, 0, sizeof(CBitmapCacheKey)-((LPBYTE)&pOwner-(LPBYTE)this));
00113     pOwner = NULL;
00114     dPixelWidth = 0;
00115     nOption = 0;
00116 }

CBitmapCacheKey::CBitmapCacheKey LPVOID  pNewOwner,
double  dNewPixelWidth,
UINT32  nNewOption = 0
 

Definition at line 118 of file bitmapcachekey.cpp.

00119 {
00120     memset(&pOwner, 0, sizeof(CBitmapCacheKey)-((LPBYTE)&pOwner-(LPBYTE)this));
00121     pOwner = pNewOwner;
00122     dPixelWidth = dNewPixelWidth;
00123     nOption = nNewOption;
00124 }

CBitmapCacheKey::CBitmapCacheKey const CBitmapCacheKey key  ) 
 

Definition at line 128 of file bitmapcachekey.cpp.

00129 {
00130     memset(&pOwner, 0, sizeof(CBitmapCacheKey)-((LPBYTE)&pOwner-(LPBYTE)this));
00131     pOwner = key.pOwner;
00132     dPixelWidth = key.dPixelWidth;
00133     nOption = key.nOption;
00134 }

CBitmapCacheKey::~CBitmapCacheKey  )  [virtual]
 

Definition at line 136 of file bitmapcachekey.cpp.

00137 {
00138 
00139 }


Member Function Documentation

double CBitmapCacheKey::GetPixelWidth  )  const [inline]
 

Definition at line 120 of file bitmapcachekey.h.

00120 {return dPixelWidth;}

UINT32 CBitmapCacheKey::Hash  )  const
 

Definition at line 205 of file bitmapcachekey.cpp.

00206 {
00207     UINT32 nHash = 0;
00208     //LPBYTE pThis = (LPBYTE)this;
00209     LPBYTE pThis = (LPBYTE)&pOwner;
00210     // Can't use sizeof class because that includes alignment bytes which contain random values
00211     //const INT32 bytesize = sizeof(CBitmapCacheKey);
00212     const size_t bytesize = sizeof(CBitmapCacheKey)-((LPBYTE)&pOwner-(LPBYTE)this);
00213 
00214     for(unsigned i=0; i<bytesize; i++)
00215     {
00216         nHash = (nHash<<5)+nHash + *pThis++;
00217     }
00218 
00219     return nHash;
00220 }

BOOL CBitmapCacheKey::IsValid  )  const
 

Definition at line 183 of file bitmapcachekey.cpp.

00184 {
00185     return (pOwner!=NULL && dPixelWidth!=0);
00186 }

bool CBitmapCacheKey::operator== const CBitmapCacheKey key  )  const
 

Definition at line 158 of file bitmapcachekey.cpp.

00159 {
00160     return (pOwner == key.pOwner &&
00161             dPixelWidth == key.dPixelWidth &&
00162             nOption == key.nOption
00163             );
00164 }

void CBitmapCacheKey::SetOwner LPVOID  pNewOwner  )  [inline]
 

Definition at line 119 of file bitmapcachekey.h.

00119 {pOwner = pNewOwner;}


Friends And Related Function Documentation

friend class CBitmapCache [friend]
 

Definition at line 107 of file bitmapcachekey.h.


Member Data Documentation

double CBitmapCacheKey::dPixelWidth [private]
 

Definition at line 127 of file bitmapcachekey.h.

UINT32 CBitmapCacheKey::nOption [private]
 

Definition at line 128 of file bitmapcachekey.h.

LPVOID CBitmapCacheKey::pOwner [private]
 

Definition at line 126 of file bitmapcachekey.h.


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