#include <attraggl.h>
Inheritance diagram for CommonAttrMultiSet:
Public Member Functions | |
virtual | ~CommonAttrMultiSet () |
The MultiCommonAttrItems in the set need to be deleted when the set is destroyed. This destructor ensures they are. | |
void | ClearResults () |
This function initialises the CommonAttrMultiSet ready for finding common attributes Each MultiCommonAttrItem in the set has its Status set to ATTR_NONE and its pAttr set to NULL. You will probably never need to call this function as Range::FindCommonAttributes makes a call to it prior to looking for common attributes. | |
virtual BOOL | AddTypeToSet (AttributeIdentifier AttrType, NodeAttribute *const pAttr) |
Call this function to build up a subset of attribute types to find common attribute values for. It creates an MultiCommonAttrItem and adds it to the set. | |
MultiCommonAttrItem * | FindAttrItem (AttributeIdentifier AttrType) |
To find an item in the CommonAttrMultiSet. | |
MultiCommonAttrItem * | FindFirst () const |
MultiCommonAttrItem * | FindNext (const MultiCommonAttrItem *const pPrevious) const |
Private Attributes | |
List | m_CommonAttrList |
Definition at line 517 of file attraggl.h.
|
The MultiCommonAttrItems in the set need to be deleted when the set is destroyed. This destructor ensures they are.
Definition at line 565 of file attraggl.cpp. 00566 { 00567 m_CommonAttrList.DeleteAll(); 00568 }
|
|
Call this function to build up a subset of attribute types to find common attribute values for. It creates an MultiCommonAttrItem and adds it to the set.
Definition at line 586 of file attraggl.cpp. 00588 { 00589 ENSURE_NOT_NULL(pAttr); 00590 ERROR3IF(FindAttrItem(AttrType), "Trying to add a duplicate item to a CommonAttrMultiSet"); 00591 00592 BOOL Ok = TRUE; 00593 00594 MultiCommonAttrItem* pCommonAttrItem = new MultiCommonAttrItem(AttrType, pAttr); 00595 if (pCommonAttrItem == NULL) 00596 { 00597 // Oh no we've run out of memory 00598 Ok = FALSE; 00599 } 00600 if (Ok) 00601 { 00602 try 00603 { 00604 SetAt(&AttrType, pCommonAttrItem); 00605 } 00606 catch(...) 00607 { 00608 Ok = FALSE; 00609 } 00610 } 00611 00612 if (Ok) 00613 { 00614 m_CommonAttrList.AddTail(pCommonAttrItem); 00615 } 00616 00617 if (!Ok) 00618 { 00619 delete pCommonAttrItem; 00620 pCommonAttrItem = NULL; 00621 } 00622 00623 return Ok; 00624 }
|
|
This function initialises the CommonAttrMultiSet ready for finding common attributes Each MultiCommonAttrItem in the set has its Status set to ATTR_NONE and its pAttr set to NULL. You will probably never need to call this function as Range::FindCommonAttributes makes a call to it prior to looking for common attributes.
Definition at line 692 of file attraggl.cpp. 00693 { 00694 MultiCommonAttrItem* pAttrItem = FindFirst(); 00695 while (pAttrItem) 00696 { 00697 ERROR3IF(!pAttrItem->GetAttrID(), "CommonAttrMultiSet contains invalid attr type"); 00698 pAttrItem->ClearResults(); 00699 00700 pAttrItem = FindNext(pAttrItem); 00701 } 00702 }
|
|
To find an item in the CommonAttrMultiSet.
Definition at line 659 of file attraggl.cpp. 00660 { 00661 MultiCommonAttrItem* pAttrItem = NULL; 00662 00663 if (!Lookup(&AttrType, pAttrItem)) 00664 { 00665 pAttrItem = NULL; 00666 } 00667 00668 return pAttrItem; 00669 }
|
|
Definition at line 628 of file attraggl.cpp. 00629 { 00630 MultiCommonAttrItem* pFoundItem = (MultiCommonAttrItem*)m_CommonAttrList.GetHead(); 00631 ENSURE_KIND(pFoundItem, MultiCommonAttrItem); 00632 00633 return pFoundItem; 00634 }
|
|
Definition at line 637 of file attraggl.cpp. 00638 { 00639 MultiCommonAttrItem* pFoundItem = (MultiCommonAttrItem*)m_CommonAttrList.GetNext(pPrevious); 00640 ENSURE_KIND(pFoundItem, MultiCommonAttrItem); 00641 00642 return pFoundItem; 00643 }
|
|
Definition at line 534 of file attraggl.h. |