Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
WsTreeTraversal Class Referenceabstract

Used to traverse the tree. More...

#include <WsTreeTraversal.h>

Inheritance diagram for WsTreeTraversal:
Inheritance graph
Collaboration diagram for WsTreeTraversal:
Collaboration graph

Public Member Functions

 WsTreeTraversal (NodePtr root)
 constructor More...
 
int start ()
 start traversing the Tree. More...
 

Protected Attributes

NodePtr m_root
 

Private Member Functions

int traverse (NodePtr n)
 Traverses a Node. Calls the WsTreeTraversal::traverseDirNode() or WsTreeTraversal::traverseFileNode() depending on type of node. More...
 
int traverseDirNodes (std::vector< NodePtr > l)
 Traverses WsDirNodes recusively. More...
 
int traverseFileNodes (std::vector< NodePtr > l)
 Traverse a file and calls WsTreeTraversal::traverseFile() method. More...
 
virtual int beginTraverseDir (NodePtr n)=0
 Called when a directory is being traversed. More...
 
virtual int endTraverseDir (NodePtr n)=0
 Called when a directory has been completely traversed. ie all subnodes(recursively all sub nodes of subnodes etc..) have been traversed. More...
 
virtual int traverseFile (NodePtr n)=0
 Called when traversing a fileNode. More...
 

Detailed Description

Used to traverse the tree.

It uses DFS traversal

Definition at line 30 of file WsTreeTraversal.h.

Constructor & Destructor Documentation

WsTreeTraversal::WsTreeTraversal ( NodePtr  root)

constructor

Definition at line 16 of file WsTreeTraversal.cpp.

Member Function Documentation

virtual int WsTreeTraversal::beginTraverseDir ( NodePtr  n)
privatepure virtual

Called when a directory is being traversed.

Parameters
nthe NodePtr representing the directory being traversed
Returns
SUCCESS or FAILURE if an error occured

Implemented in WsAbstractTree, WsLatestNews, and WsSearchRSS.

Here is the caller graph for this function:

virtual int WsTreeTraversal::endTraverseDir ( NodePtr  n)
privatepure virtual

Called when a directory has been completely traversed. ie all subnodes(recursively all sub nodes of subnodes etc..) have been traversed.

Parameters
nThe NodePtr representing the directory that has been completely traversed
Returns
SUCCESS or FAILURE

Implemented in WsAbstractTree, WsLatestNews, and WsSearchRSS.

Here is the caller graph for this function:

int WsTreeTraversal::start ( )

start traversing the Tree.

Definition at line 21 of file WsTreeTraversal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int WsTreeTraversal::traverse ( NodePtr  n)
private

Traverses a Node. Calls the WsTreeTraversal::traverseDirNode() or WsTreeTraversal::traverseFileNode() depending on type of node.

Parameters
nA NodePtr containing the Node
Returns
SUCCESS or FAILURE

Definition at line 29 of file WsTreeTraversal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int WsTreeTraversal::traverseDirNodes ( std::vector< NodePtr l)
private

Traverses WsDirNodes recusively.

Parameters
l
Returns

Definition at line 49 of file WsTreeTraversal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual int WsTreeTraversal::traverseFile ( NodePtr  n)
privatepure virtual

Called when traversing a fileNode.

Parameters
nA NodePtr representing the file being traversed
Returns
SUCCESS or FAILURE

Implemented in WsAbstractTree, WsLatestNews, and WsSearchRSS.

Here is the caller graph for this function:

int WsTreeTraversal::traverseFileNodes ( std::vector< NodePtr l)
private

Traverse a file and calls WsTreeTraversal::traverseFile() method.

Parameters
lA NodePtr containing the WsFileNode
Returns
SUCCESS or FAILURE

Definition at line 60 of file WsTreeTraversal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

NodePtr WsTreeTraversal::m_root
protected

Definition at line 99 of file WsTreeTraversal.h.


The documentation for this class was generated from the following files: