#include <nodeset.h>
Inheritance diagram for NodeSet:
Public Member Functions | |
NodeSet (BOOL Strict=FALSE) | |
Create a NodeSet. It may or may not be a strict set - it depends on the "Strict" parameter. If it is strict, then when nodes are added, the class checks that they don't already exist in the set - if they do, it just does nothing and returns success. | |
BOOL | AddNode (Node *) |
Adds the specified node to this node set. If this is a strict set (see the NodeSet constructor), then the set is first scanned to see if it already contains this node. If it does, then the set is unchanged and success is returned. | |
void | MakeEmpty () |
Remove all nodes from this NodeSet. | |
void | MarkNodes () |
Set the MARKED flag on all Nodes in this NodeSet. This is usually done before doing a selective rendering pass on the document tree. | |
void | UnmarkNodes () |
Clear the MARKED flag on all Nodes in this NodeSet. This is usually done after doing a selective rendering pass on the document tree. | |
Protected Attributes | |
BOOL | m_fStrictSet |
std::vector< Node * > | m_NodeSet |
Definition at line 126 of file nodeset.h.
|
Create a NodeSet. It may or may not be a strict set - it depends on the "Strict" parameter. If it is strict, then when nodes are added, the class checks that they don't already exist in the set - if they do, it just does nothing and returns success.
Definition at line 133 of file nodeset.cpp. 00133 : m_NodeSet( 50 ) 00134 { 00135 // Remember what kind of set this is. 00136 m_fStrictSet = Strict; 00137 }
|
|
Adds the specified node to this node set. If this is a strict set (see the NodeSet constructor), then the set is first scanned to see if it already contains this node. If it does, then the set is unchanged and success is returned.
Definition at line 158 of file nodeset.cpp. 00159 { 00160 ERROR2IF(pNode == NULL, FALSE, "NULL node pointer in NodeSet::AddNode()"); 00161 00162 if( m_fStrictSet ) 00163 { 00164 // Check to see if we haven't already got this node in the set 00165 size_t cNode = m_NodeSet.size(); 00166 for( size_t i = 0; i < cNode; i++ ) 00167 { 00168 if( m_NodeSet[i] == pNode ) 00169 // Already have this node - return success 00170 return TRUE; 00171 } 00172 } 00173 00174 // See if we can add another node to this set. 00175 m_NodeSet.push_back( pNode ); 00176 00177 // Return success to caller 00178 return TRUE; 00179 }
|
|
Remove all nodes from this NodeSet.
Definition at line 192 of file nodeset.cpp. 00193 { 00194 // Delete all the array elements, and create a new set that are all NULL. 00195 m_NodeSet.clear(); 00196 }
|
|
Set the MARKED flag on all Nodes in this NodeSet. This is usually done before doing a selective rendering pass on the document tree.
Definition at line 212 of file nodeset.cpp.
|
|
Clear the MARKED flag on all Nodes in this NodeSet. This is usually done after doing a selective rendering pass on the document tree.
Definition at line 230 of file nodeset.cpp.
|
|
|
|
|