CMXFutureUpdater Class Reference

#include <cmxexdc.h>

Inheritance diagram for CMXFutureUpdater:

CCObject SimpleCCObject CMXFutureIndex CMXFutureLength CMXFutureNumber List of all members.

Public Member Functions

 CMXFutureUpdater ()
 constructor
 ~CMXFutureUpdater ()
 destructor
BOOL Init (CMXExportDC *pDC, INT32 RelativePos, UINT32 DataSize)
 initialises a updater object
virtual BOOL Write (CMXExportDC *pDC)=0

Protected Member Functions

BOOL WriteValue (CMXExportDC *pDC, INT32 Value)
 writes a value to the file
virtual void Reset (void)

Private Member Functions

 CC_DECLARE_DYNAMIC (CMXFutureUpdater)

Private Attributes

INT32 AbsPosition
UINT32 DataSize

Detailed Description

Definition at line 138 of file cmxexdc.h.


Constructor & Destructor Documentation

CMXFutureUpdater::CMXFutureUpdater  ) 
 

constructor

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/06/96
Parameters:
none [INPUTS]
Returns:
none
See also:

Definition at line 156 of file cmxexdc.cpp.

00157 {
00158     AbsPosition = -1;
00159     DataSize = 0;
00160 }

CMXFutureUpdater::~CMXFutureUpdater  ) 
 

destructor

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/06/96
Parameters:
none [INPUTS]
Returns:
none
See also:

Definition at line 176 of file cmxexdc.cpp.

00177 {
00178     if(AbsPosition >= 0)
00179         TRACEUSER( "Ben", _T("AWWOOOOGA! CMXFutureUpdated deleted, but not written\n\n"));
00180 }


Member Function Documentation

CMXFutureUpdater::CC_DECLARE_DYNAMIC CMXFutureUpdater   )  [private]
 

BOOL CMXFutureUpdater::Init CMXExportDC pDC,
INT32  RelativePos,
UINT32  tDataSize
 

initialises a updater object

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/06/96
Parameters:
export dc, relative position (+ve = forwards in file), size of data [INPUTS]
Returns:
none
See also:

Definition at line 196 of file cmxexdc.cpp.

00197 {
00198     ERROR2IF(AbsPosition >= 0, FALSE, "Updater already initialised");
00199     ERROR2IF(pDC == 0, FALSE, "No pDC, chaps");
00200     ERROR2IF(DataSize < 0 || DataSize > 4, FALSE, "Bit of a data size problem really");
00201 
00202     INT32 CurrentPos = pDC->GetFilePosition();
00203     ERROR2IF(CurrentPos < 0, FALSE, "Whoops -- negative file position here");
00204     AbsPosition = CurrentPos + RelativePos;
00205     ERROR2IF(AbsPosition < 0, FALSE, "Serious Bummer -- expected to update a position before the start of the file");
00206     DataSize = tDataSize;
00207 
00208     return TRUE;
00209 }

virtual void CMXFutureUpdater::Reset void   )  [inline, protected, virtual]
 

Reimplemented in CMXFutureLength.

Definition at line 149 of file cmxexdc.h.

00149 {};

virtual BOOL CMXFutureUpdater::Write CMXExportDC pDC  )  [pure virtual]
 

Implemented in CMXFutureLength, CMXFutureNumber, and CMXFutureIndex.

BOOL CMXFutureUpdater::WriteValue CMXExportDC pDC,
INT32  Value
[protected]
 

writes a value to the file

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/06/96
Parameters:
export dc, value [INPUTS]
Returns:
none
See also:

Definition at line 224 of file cmxexdc.cpp.

00225 {
00226     ERROR2IF(pDC == 0, FALSE, "No pDC, chaps");
00227 
00228     // write the number
00229     if(!pDC->WriteNumber(AbsPosition, DataSize, Value))
00230         return FALSE;
00231 
00232     // reset everything for the next run, should we want one.
00233     AbsPosition = -1;
00234     DataSize = 0;
00235     Reset();            // get the derivedness to reset itself too.
00236 
00237     return TRUE;
00238 }


Member Data Documentation

INT32 CMXFutureUpdater::AbsPosition [private]
 

Definition at line 149 of file cmxexdc.h.

UINT32 CMXFutureUpdater::DataSize [private]
 

Definition at line 152 of file cmxexdc.h.


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