AttrTypeSet Class Reference

A set of AttrTypeitems. More...

#include <node.h>

Inheritance diagram for AttrTypeSet:

List CCObject SimpleCCObject List of all members.

Public Member Functions

AttrTypeSetCopySet ()
 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 ()

Detailed Description

A set of AttrTypeitems.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/95
See also:
AttrTypeItem

Definition at line 304 of file node.h.


Constructor & Destructor Documentation

AttrTypeSet::~AttrTypeSet  )  [inline]
 

Definition at line 319 of file node.h.

00319 { DeleteAll(); };


Member Function Documentation

BOOL AttrTypeSet::AddToSet List Attributes  )  [virtual]
 

Adds the Types of all attributes in the Attributes list.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Parameters:
A list of attributes (each item must be a NodeAttributePtrItem) [INPUTS]
Returns:
FALSE if we run out of memory.
See also:
AttrTypeSet::InSet

AttrTypeSet::CopySet

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 }

BOOL AttrTypeSet::AddToSet CCRuntimeClass AttrType  )  [virtual]
 

Adds AttrType to the set.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Returns:
FALSE if we run out of memory
See also:
AttrTypeSet::InSet

AttrTypeSet::CopySet

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 }

AttrTypeSet * AttrTypeSet::CopySet  ) 
 

Makes a copy of the attribute type set.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A copy of the set, or NULL if we run out of memory

Errors: -

See also:
AttrTypeSet::AddToSet

AttrTypeSet::InSet

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 }

BOOL AttrTypeSet::InSet CCRuntimeClass AttrType  ) 
 

To determine if AttrType is in the set.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/95
Parameters:
AttrType,: The type of an attribute [INPUTS]
- [OUTPUTS]
Returns:
TRUE if AttrType is in the set

Errors: -

See also:
AttrTypeSet::CopySet

AttrTypeSet::AddToSet

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 }         


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