#include <node.h>
Inheritance diagram for AttrTypeSet:
Public Member Functions | |
AttrTypeSet * | CopySet () |
Makes a copy of the attribute type set. | |
virtual BOOL | AddToSet (CCRuntimeClass *AttrType) |
Adds AttrType to the set. | |
virtual BOOL | AddToSet (List &AttributeList) |
Adds the Types of all attributes in the Attributes list. | |
BOOL | InSet (CCRuntimeClass *AttrType) |
To determine if AttrType is in the set. | |
~AttrTypeSet () |
Definition at line 304 of file node.h.
|
Definition at line 319 of file node.h. 00319 { DeleteAll(); };
|
|
Adds the Types of all attributes in the Attributes list.
Definition at line 6427 of file node.cpp. 06428 { 06429 NodeAttributePtrItem* pAttrItem = (NodeAttributePtrItem*)(Attributes.GetHead()); 06430 NodeAttribute* pAttr; 06431 while (pAttrItem) 06432 { 06433 pAttr = pAttrItem->NodeAttribPtr; 06434 ERROR3IF(!pAttr, "Should be an attribute"); 06435 if (!AddToSet(pAttr->GetAttributeType())) 06436 { 06437 return FALSE; 06438 } 06439 pAttrItem = (NodeAttributePtrItem*)(Attributes.GetNext(pAttrItem)); 06440 } 06441 return TRUE; 06442 }
|
|
Adds AttrType to the set.
Definition at line 6386 of file node.cpp. 06387 { 06388 ERROR3IF(AttrType == NULL, "AddToSet: AttrType is NULL"); 06389 // Determine if the AttrType is already in the set 06390 AttrTypeItem* pAttrType = (AttrTypeItem*) GetHead(); 06391 while (pAttrType != NULL) 06392 { 06393 if (pAttrType->AttributeType == AttrType) 06394 { 06395 return TRUE; // Already in set so return 06396 } 06397 pAttrType = (AttrTypeItem*) GetNext(pAttrType); 06398 } 06399 06400 // The attribute type is not in the set so let's add it 06401 pAttrType = new AttrTypeItem; 06402 if (!pAttrType) 06403 return FALSE; // out of memory (error has been set) 06404 06405 pAttrType->AttributeType = AttrType; 06406 06407 AddHead(pAttrType); // Add attribute to the head of the list 06408 06409 return TRUE; 06410 }
|
|
Makes a copy of the attribute type set.
Definition at line 6460 of file node.cpp. 06461 { 06462 AttrTypeSet* pSetCopy; 06463 pSetCopy = new AttrTypeSet; 06464 if (!pSetCopy) 06465 return NULL; // Out of memory 06466 06467 // Copy each item in turn 06468 AttrTypeItem* pItemCopy; 06469 AttrTypeItem* pCurrent = (AttrTypeItem*)GetHead(); 06470 while (pCurrent) 06471 { 06472 pItemCopy = new AttrTypeItem; 06473 if (!pItemCopy) 06474 { 06475 // Tidyup 06476 pSetCopy->DeleteAll(); 06477 delete pSetCopy; 06478 return NULL; 06479 } 06480 pItemCopy->AttributeType = pCurrent->AttributeType; 06481 pSetCopy->AddTail(pItemCopy); 06482 pCurrent = (AttrTypeItem*)GetNext(pCurrent); 06483 } 06484 return pSetCopy; 06485 }
|
|
To determine if AttrType is in the set.
Definition at line 6502 of file node.cpp. 06503 { 06504 AttrTypeItem* pCurrent = (AttrTypeItem*)GetHead(); 06505 while (pCurrent) 06506 { 06507 if (pCurrent->AttributeType == AttrType) 06508 return TRUE; 06509 pCurrent = (AttrTypeItem*)GetNext(pCurrent); 06510 } 06511 return FALSE; 06512 }
|