SnapShotItem Class Reference

Defines what is saved during a current attribute snap shot. More...

#include <filters.h>

Inheritance diagram for SnapShotItem:

ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 SnapShotItem ()
 Construct a SnapShotItem to record a list of current attributes.
 ~SnapShotItem ()
 Destroy a SnapShotItem - removes all allocated arrays.
INT32 Initialise (AttributeEntry *CurrAttrs)
 This function grabs a snap shot of the described attributes list.

Private Member Functions

 CC_DECLARE_MEMDUMP (SnapShotItem)

Private Attributes

NodeAttribute ** SnapShotAttrs
AttributeEntrySnapShotAttrsStack

Friends

class SnapShotList

Detailed Description

Defines what is saved during a current attribute snap shot.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/95

Definition at line 325 of file filters.h.


Constructor & Destructor Documentation

SnapShotItem::SnapShotItem  ) 
 

Construct a SnapShotItem to record a list of current attributes.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
- [INPUTS]
Returns:
-

Definition at line 5475 of file filters.cpp.

05476 {
05477     SnapShotAttrs = NULL;
05478     SnapShotAttrsStack = NULL;
05479 }

SnapShotItem::~SnapShotItem  ) 
 

Destroy a SnapShotItem - removes all allocated arrays.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
- [INPUTS]
Returns:
-

Definition at line 5494 of file filters.cpp.

05495 {
05496     if (SnapShotAttrs!=NULL)
05497     {
05498         INT32 i, NumAttrs = AttributeManager::GetNumAttributes();
05499         for (i=0; i<NumAttrs; i++)
05500         {
05501             if (SnapShotAttrs[i] != NULL)
05502             {
05503                 delete SnapShotAttrs[i];
05504                 SnapShotAttrs[i]=NULL;
05505             }
05506         }
05507         CCFree(SnapShotAttrs);
05508         SnapShotAttrs=NULL;
05509     }
05510 
05511     if (SnapShotAttrsStack!=NULL)
05512     {
05513         CCFree(SnapShotAttrsStack);
05514         SnapShotAttrsStack=NULL;
05515     }
05516 }


Member Function Documentation

SnapShotItem::CC_DECLARE_MEMDUMP SnapShotItem   )  [private]
 

BOOL SnapShotItem::Initialise AttributeEntry CurrAttrs  ) 
 

This function grabs a snap shot of the described attributes list.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
CurrAttrs = a pointer to a list of attributeentry items. There [INPUTS] as usual should be AttributeManager::NumAttributes() of them
Returns:
TRUE if able to initialise this snapshot item FALSE if not

Definition at line 5533 of file filters.cpp.

05534 {
05535     INT32 i, NumAttrs = AttributeManager::GetNumAttributes();
05536 
05537     SnapShotAttrs = (NodeAttribute**)CCMalloc(NumAttrs*sizeof(NodeAttribute*));
05538     if (SnapShotAttrs==NULL)
05539         return FALSE;
05540 
05541     SnapShotAttrsStack = (AttributeEntry*)CCMalloc(NumAttrs*sizeof(AttributeEntry));
05542     if (SnapShotAttrsStack==NULL)
05543     {
05544         CCFree(SnapShotAttrs);
05545         SnapShotAttrs=NULL;
05546         return FALSE;
05547     }
05548 
05549     // store the temp values
05550     for (i=0; i<NumAttrs; i++)
05551     {
05552         // of course the following MakeNode may fail, but it just sets
05553         // the SnapShotAttrs ptr to NULL which we MUST check (and do) later on
05554         SnapShotAttrs[i] = (CurrAttrs[i].pAttr)->MakeNode();
05555     
05556         SnapShotAttrsStack[i].pAttr  = NULL;
05557         SnapShotAttrsStack[i].Temp   = FALSE;
05558         SnapShotAttrsStack[i].Ignore = TRUE;
05559     }
05560 
05561     return TRUE;
05562 }


Friends And Related Function Documentation

friend class SnapShotList [friend]
 

Definition at line 329 of file filters.h.


Member Data Documentation

NodeAttribute** SnapShotItem::SnapShotAttrs [private]
 

Definition at line 339 of file filters.h.

AttributeEntry* SnapShotItem::SnapShotAttrsStack [private]
 

Definition at line 340 of file filters.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:01:19 2007 for Camelot by  doxygen 1.4.4