SubcloneSeeker  1.0.0
Subclone deconvolution software framework
 All Classes Files Functions Variables Macros Pages
SubcloneSeeker::SubcloneLoadTreeTraverser Class Reference

A tree traverser that loads an entire tree structure from a database. More...

#include <Subclone.h>

Inheritance diagram for SubcloneSeeker::SubcloneLoadTreeTraverser:
SubcloneSeeker::TreeTraverseDelegate

Public Member Functions

 SubcloneLoadTreeTraverser (sqlite3 *database)
 
virtual void processNode (TreeNode *node)
 
- Public Member Functions inherited from SubcloneSeeker::TreeTraverseDelegate
 TreeTraverseDelegate ()
 
virtual ~TreeTraverseDelegate ()
 
void terminate ()
 
bool isTerminated ()
 
virtual void preprocessNode (TreeNode *)
 
virtual void postprocessNode (TreeNode *)
 

Static Public Member Functions

static std::vector< sqlite3_int64 > rootNodes (sqlite3 *database)
 Query the database for a set of nodes that appears to be root. More...
 
static std::vector< sqlite3_int64 > nodesOfParentID (sqlite3 *database, sqlite3_int64 parentId)
 Query the database for a set of nodes that appears to be the children of a given node ID. More...
 

Protected Attributes

sqlite3 * _database
 
- Protected Attributes inherited from SubcloneSeeker::TreeTraverseDelegate
bool _isTerminated
 

Detailed Description

A tree traverser that loads an entire tree structure from a database.

The traverser takes one argument at construction, which is the database pointer from which the entire subclone structure will be loaded. When performing the actual load, a pre-order traverse should be performed on a node that is initialized through unarchiving (which would have its id field populated). The traverser will find all the children nodes in the database, unarchive them, add them as children to the node currently being processed, and continue the traverse.

Constructor & Destructor Documentation

SubcloneSeeker::SubcloneLoadTreeTraverser::SubcloneLoadTreeTraverser ( sqlite3 *  database)
inline

Constructor of the SubcloneLoadTreeTraverser class

Parameters
databaseFrom which database will the tree be load

Member Function Documentation

std::vector< sqlite3_int64 > SubcloneLoadTreeTraverser::nodesOfParentID ( sqlite3 *  database,
sqlite3_int64  parentId 
)
static

Query the database for a set of nodes that appears to be the children of a given node ID.

Parameters
databaseThe database to which the query is sent
parentIdThe ID representing a node in the database
Returns
a vector of IDs representing nodes in the database that appears to be the direct children of the given parent ID
void SubcloneLoadTreeTraverser::processNode ( TreeNode )
virtual

Process the given node during a tree traverse

Parameters
nodethe Node which needs to be processed

Implements SubcloneSeeker::TreeTraverseDelegate.

std::vector< sqlite3_int64 > SubcloneLoadTreeTraverser::rootNodes ( sqlite3 *  database)
static

Query the database for a set of nodes that appears to be root.

Parameters
databaseThe database to which the query is sent
Returns
A vector of IDs representing nodes in the database that appears to be root nodes.

Member Data Documentation

sqlite3* SubcloneSeeker::SubcloneLoadTreeTraverser::_database
protected

From which database will be tree be loaded


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