The following code fragment shows a typical use of the e4_NodeVisitor class:
The e4_NodeVisitor class provides the following methods:e4_Storage s("mystorage", E4_METAKIT); e4_Marker m; e4_Node n; ... if (!s.GetMarker("mymarker", m)) {...} if (!m.GetMarkedNode(n)) {...} ... e4_Node cn; e4_NodeVisitor nv(n); while (nv.CurrentNodeAndAdvance(cn)) { if (!cn.IsValid()) {...} if (cn == n) { fprintf(stderr, "Found our node, %d %d\n", cn.GetUniqueID(), n.GetUniqueID()); } }
e4_NodeVisitor() | Default constructor. Creates an instance of e4_NodeVisitor that is initially invalid, because it is not connected to a storage and has no currently visited node.fs |
e4_NodeVisitor(const e4_NodeVisitor &referrer) | Copy constructor. Creates an instance of e4_NodeVisitor that will visit nodes in the same storage as referrer and in the same order. |
e4_NodeVisitor(const e4_Storage &s) | Constructor that creates an instance of e4_NodeVisitor that will visit all the nodes defined in the storage s. |
e4_NodeVisitor(const e4_Marker &m) | Constructor that creates an instance of e4_NodeVisitor that will visit all the nodes defined in the storage containing the marker m. |
e4_NodeVisitor(const e4_Node &n) | Constructor that creates an instance of e4_NodeVisitor that will visit all the nodes defined in the storage containing the node n. |
e4_NodeVisitor(const e4_Vertex &v) | Constructor that creates an instance of e4_NodeVisitor that will visit all the nodes defined in the storage containing the vertex v. |
~e4_NodeVisitor() | Destructor. |
e4_NodeVisitor &operator=(const e4_NodeVisitor &referrer) | Assignment operator. Makes this instance visit the same nodes as referrer and in the same order. |
bool operator==(const e4_NodeVisitor &comp) | Returns true if this and comp refer to the same e4_NodeVisitor instance. All invalid instances are identical. |
bool operator!=(const e4_NodeVisitor &comp) | Returns true if this and comp do not refer to the same e4_NodeVisitor instance. All invalid instances are identical. |
bool IsDone() | Returns true if this instance of e4_NodeVisitor has no more nodes to visit. |
bool IsValid() | Returns true if this instance of e4_NodeVisitor is valid. An instance is valid if it has a current node being visited. |
bool CurrentNode(e4_Node &n) | Returns true if the node currently being visited is successfully retrieved in n. |
bool NextNode(e4_Node &n) | Returns true if the visitor is successfully advanced to the next node to be visited and that node is successfully retrieved in n. |
bool CurrentNodeAndAdvance(e4_Node &n) | Returns true if the node currently being visited is successfully retrieved in n and the visitor is successfully advanced to the next node to be visited. |
bool SetStorage(const e4_Storage &s) | Returns true if the visitor is successfully reset to visit all nodes defined in the storage s. |
bool SetMarker(const e4_Marker &m) | Returns true if the visitor is successfully reset to visit all nodes defined in the storage containing the marker m. |
bool SetNode(const e4_Node &n) | Returns true if the visitor is successfully reset to visit all nodes defined in the storage containing the node n. |
bool SetVertex(const e4_Vertex &v) | Returns true if the visitor is successfully reset to visit all nodes defined in the storage containing the vertex v. |