CXaraFileMapTagToHandler Class Reference

This class implements a fast way of looking the handler that handles a given tag. More...

#include <cxfmap.h>

Inheritance diagram for CXaraFileMapTagToHandler:

CCObject SimpleCCObject List of all members.

Public Member Functions

 CXaraFileMapTagToHandler ()
 The default constructor.
virtual ~CXaraFileMapTagToHandler ()
 The destructor.
void Add (UINT32 Tag, CXaraFileRecordHandler *pHandler)
 Adds a map entry, associating the tag with the handler.
CXaraFileRecordHandlerLookUp (UINT32 Tag)
 Returns the handler associated with the given tag.

Private Member Functions

 CC_DECLARE_DYNAMIC (CXaraFileMapTagToHandler)

Private Attributes

CMapLongToPtrpMap

Detailed Description

This class implements a fast way of looking the handler that handles a given tag.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/8/96 Base Class: -
It uses the MFC class CMapPtrToPtr to do the tricky bits.

See also:
CMapPtrToPtr

Definition at line 117 of file cxfmap.h.


Constructor & Destructor Documentation

CXaraFileMapTagToHandler::CXaraFileMapTagToHandler  ) 
 

The default constructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/8/96
See also:
-

Definition at line 122 of file cxfmap.cpp.

00123 {
00124     pMap = NULL;
00125 }

CXaraFileMapTagToHandler::~CXaraFileMapTagToHandler  )  [virtual]
 

The destructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/8/96
See also:
-

Definition at line 138 of file cxfmap.cpp.

00139 {
00140     if (pMap != NULL)
00141         delete pMap;
00142 }


Member Function Documentation

void CXaraFileMapTagToHandler::Add UINT32  Tag,
CXaraFileRecordHandler pHandler
 

Adds a map entry, associating the tag with the handler.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/8/96 Imputs: Tag = the tag that the given handler handles pHandler = ptr to a record handler
Returns:
-
See also:
-

Definition at line 159 of file cxfmap.cpp.

00160 {
00161     if (pHandler == NULL)
00162         return;
00163 
00164     if (pMap == NULL)
00165         pMap = new CMapLongToPtr;
00166 
00167     if (pMap != NULL)
00168         (*pMap)[INT32(Tag)] = (void *)pHandler;
00169 }

CXaraFileMapTagToHandler::CC_DECLARE_DYNAMIC CXaraFileMapTagToHandler   )  [private]
 

CXaraFileRecordHandler * CXaraFileMapTagToHandler::LookUp UINT32  Tag  ) 
 

Returns the handler associated with the given tag.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/8/96 Imputs: Tag = the tag
Returns:
ptr to the handler for the given tag, or NULL if one can't be found
See also:
-

Definition at line 184 of file cxfmap.cpp.

00185 {
00186     CXaraFileRecordHandler* pHandler = NULL;
00187 
00188     if (pMap != NULL)
00189     {
00190         CMapLongToPtr::iterator iter = pMap->find( INT32(Tag) );
00191         if( iter == pMap->end() )
00192             return NULL;
00193 
00194         pHandler = (CXaraFileRecordHandler *)iter->second;
00195     }
00196 
00197     return pHandler;
00198 }


Member Data Documentation

CMapLongToPtr* CXaraFileMapTagToHandler::pMap [private]
 

Definition at line 131 of file cxfmap.h.


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