#include <filters.h>
Inheritance diagram for AttrRecordItem:
Public Member Functions | |
AttrRecordItem () | |
Constructor - initalises member variables. | |
~AttrRecordItem () | |
Destructor - deletes any claimed memory. | |
BOOL | Initialise (AttributeEntry *CurrAttrs) |
Copies the current AttributeValues in the AttributeEntry array so the current state can be restored at a later date. | |
BOOL | Restore (AttributeEntry *CurrAttrs) |
Copies the stored attribute state back into the current attribute array. | |
Protected Attributes | |
AttributeEntry * | RecordedAttrs |
Private Member Functions | |
CC_DECLARE_MEMDUMP (AttrRecordItem) | |
Friends | |
class | AttrRecordList |
Definition at line 384 of file filters.h.
|
Constructor - initalises member variables.
Definition at line 6673 of file filters.cpp. 06674 { 06675 RecordedAttrs = NULL; 06676 }
|
|
Destructor - deletes any claimed memory.
Definition at line 6686 of file filters.cpp. 06687 { 06688 // Free the AttributeEntry array 06689 if (RecordedAttrs != NULL) 06690 CCFree(RecordedAttrs); 06691 }
|
|
|
|
Copies the current AttributeValues in the AttributeEntry array so the current state can be restored at a later date.
Definition at line 6705 of file filters.cpp. 06706 { 06707 const INT32 NumAttrs = AttributeManager::GetNumAttributes(); 06708 06709 // Claim memory for copy of AttributeEntry array 06710 RecordedAttrs = (AttributeEntry*)CCMalloc(NumAttrs*sizeof(AttributeEntry)); 06711 if (RecordedAttrs==NULL) 06712 return FALSE; 06713 06714 // store the temp values 06715 for (INT32 i=0; i<NumAttrs; i++) 06716 { 06717 // Get the runtime class info on this object and create another object of that type 06718 CCRuntimeClass *pCCRuntimeClass = pCurrAttrs[i].pAttr->GetRuntimeClass(); 06719 AttributeValue *pNewAttr = (AttributeValue *) pCCRuntimeClass->CreateObject(); 06720 if (pNewAttr == NULL) 06721 return FALSE; 06722 06723 // Object created ok - get the object to copy its contents across. 06724 pNewAttr->SimpleCopy(pCurrAttrs[i].pAttr); 06725 RecordedAttrs[i].pAttr = pNewAttr; 06726 } 06727 06728 return TRUE; 06729 }
|
|
Copies the stored attribute state back into the current attribute array.
Definition at line 6742 of file filters.cpp. 06743 { 06744 const INT32 NumAttrs = AttributeManager::GetNumAttributes(); 06745 06746 for (INT32 i=0; i<NumAttrs; i++) 06747 { 06748 if (RecordedAttrs[i].pAttr != NULL) 06749 { 06750 pCurrAttrs[i].pAttr->SimpleCopy(RecordedAttrs[i].pAttr); 06751 delete RecordedAttrs[i].pAttr; 06752 RecordedAttrs[i].pAttr = NULL; 06753 } 06754 } 06755 06756 return TRUE; 06757 }
|
|
|
|
|