ROSE
0.9.6a
|
graph database storage class More...
#include <SqliteDatabaseGraph.h>
Public Types | |
typedef boost::adjacency_list < BoostVertexList, BoostEdgeList, BoostDirection, boost::property < boost::vertex_index1_t, std::size_t, boost::property < boost::vertex_name_t, std::string, boost::property < boost::vertex_color_t, boost::default_color_type, boost::property < boost::vertex_dbg_data_t, VertexType, BoostVertexProperty > > > >, boost::property < boost::edge_dbg_data_t, EdgeType, BoostEdgeProperty > , boost::property < boost::graph_dbg_data_t, int, BoostGraphProperty > > | dbgType |
boost graph typedefs More... | |
typedef boost::graph_traits < dbgType >::vertex_descriptor | dbgVertex |
typedef boost::graph_traits < dbgType >::vertex_iterator | dbgVertexIterator |
typedef boost::graph_traits < dbgType >::edge_descriptor | dbgEdge |
typedef boost::graph_traits < dbgType >::edge_iterator | dbgEdgeIterator |
typedef std::pair< bool, dbgEdge > | dbgEdgeReturn |
Public Member Functions | |
DatabaseGraph (long pid, long type, sqlite3x::sqlite3_connection *gdb) | |
constructor More... | |
~DatabaseGraph () | |
destructor More... | |
dbgVertex | insertVertex (VertexType &e1, std::string name) |
add a vertex to the graph, returns the boost vertex descriptor More... | |
dbgVertex | insertVertex (VertexType &e, std::string name, int subgraphId, std::string subgraphName) |
add a vertex with subgraph information - subgraphs are currently not supported!!! More... | |
dbgEdgeReturn | insertEdge (VertexType &e1, VertexType &e2, EdgeType &value) |
insert an edge between e1 and e2 More... | |
dbgEdgeReturn | insertEdge (VertexType &e1, VertexType &e2) |
insert an edge between e1 and e2, using the empty edge data class More... | |
bool | searchEdge (EdgeType &edge, dbgEdge &edesc) const |
search for a specific edge in the graph, using operator= on the id, returns false if not found More... | |
void | setSubgraphInit (int refcol, dbRow *rowdata, int namecol) |
set subgraph initialization information More... | |
int | clearSuccessors (VertexType &parent) |
remove all successor pointers from a node More... | |
int | removeNode (VertexType &node) |
remove node from the tree More... | |
int | nodeIsUsed (VertexType &node) |
check if there is an edge in the graph pointing to this node More... | |
int | getGraphId () |
get graph id (this function creates an graphdata entry, if the id is not retrieved by another function yet) More... | |
void | setNodeNameColumn (int set) |
set the column number of the VertexType column to take the node names from More... | |
int | loadFromDatabase (void) |
load graph from datbase More... | |
int | writeToDatabase (void) |
store graph in datbase More... | |
void | writeToDOTFile (std::string filename) |
write DOT graph to filename More... | |
void | writeAdjacencyMatrixToFileRaw (std::string filename) |
write the adjacency matrix to a file (only integer matrix entries, raw file format) More... | |
void | writeAdjacencyMatrixToFileMcl (std::string filename) |
write the adjacency matrix to a file (in MCL raw file format for mcxassemble) More... | |
Private Member Functions | |
bool | searchVertex (VertexType &node, dbgVertex &vdesc) const |
search for a specific node in the graph, using operator=, returns NULL if not found More... | |
Private Attributes | |
long | mProjectId |
project id for this graph More... | |
long | mGraphId |
graph id from the graphdata table More... | |
long | mType |
graph type More... | |
short | mNameColumn |
column index of the column used for the node names More... | |
sqlite3x::sqlite3_connection * | mpGDB |
database connection pointer More... | |
bool | mInitSubgraphs |
initialize subgraph information from another table? More... | |
int | mSubgraphReferenceColumn |
column id for subgraph table id's More... | |
dbRow * | mpSubgraphNameRowdata |
table rowdata object for selection of subgraph names More... | |
int | mSubgraphNameColumn |
index of subgraph name table column More... | |
graph database storage class
Definition at line 377 of file SqliteDatabaseGraph.h.
typedef boost::adjacency_list< BoostVertexList, BoostEdgeList, BoostDirection, boost::property< boost::vertex_index1_t, std::size_t, boost::property<boost::vertex_name_t, std::string, boost::property<boost::vertex_color_t, boost::default_color_type, boost::property<boost::vertex_dbg_data_t, VertexType, BoostVertexProperty > > > >, boost::property<boost::edge_dbg_data_t, EdgeType, BoostEdgeProperty>, boost::property<boost::graph_dbg_data_t, int, BoostGraphProperty> > DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::dbgType |
boost graph typedefs
Definition at line 404 of file SqliteDatabaseGraph.h.
typedef boost::graph_traits< dbgType >::vertex_descriptor DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::dbgVertex |
Definition at line 405 of file SqliteDatabaseGraph.h.
typedef boost::graph_traits< dbgType >::vertex_iterator DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::dbgVertexIterator |
Definition at line 406 of file SqliteDatabaseGraph.h.
typedef boost::graph_traits< dbgType >::edge_descriptor DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::dbgEdge |
Definition at line 407 of file SqliteDatabaseGraph.h.
typedef boost::graph_traits< dbgType >::edge_iterator DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::dbgEdgeIterator |
Definition at line 408 of file SqliteDatabaseGraph.h.
typedef std::pair<bool, dbgEdge> DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::dbgEdgeReturn |
Definition at line 409 of file SqliteDatabaseGraph.h.
DBG_TEMPLATE_DEF DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::DatabaseGraph | ( | long | pid, |
long | type, | ||
sqlite3x::sqlite3_connection * | gdb | ||
) |
constructor
Definition at line 516 of file SqliteDatabaseGraph.h.
DBG_TEMPLATE_DEF DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::~DatabaseGraph | ( | ) |
destructor
Definition at line 600 of file SqliteDatabaseGraph.h.
DBG_TEMPLATE_DEF DatabaseGraph< DBG_TEMPLATE_CLASSES >::dbgVertex DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::insertVertex | ( | VertexType & | e1, |
std::string | name | ||
) |
add a vertex to the graph, returns the boost vertex descriptor
Definition at line 528 of file SqliteDatabaseGraph.h.
References boost::vertex_dbg_data.
DBG_TEMPLATE_DEF DatabaseGraph< DBG_TEMPLATE_CLASSES >::dbgVertex DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::insertVertex | ( | VertexType & | e, |
std::string | name, | ||
int | subgraphId, | ||
std::string | subgraphName | ||
) |
add a vertex with subgraph information - subgraphs are currently not supported!!!
Definition at line 548 of file SqliteDatabaseGraph.h.
References boost::vertex_dbg_data.
DBG_TEMPLATE_DEF DatabaseGraph< DBG_TEMPLATE_CLASSES >::dbgEdgeReturn DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::insertEdge | ( | VertexType & | e1, |
VertexType & | e2, | ||
EdgeType & | value | ||
) |
insert an edge between e1 and e2
Definition at line 571 of file SqliteDatabaseGraph.h.
References boost::edge_dbg_data.
dbgEdgeReturn DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::insertEdge | ( | VertexType & | e1, |
VertexType & | e2 | ||
) |
insert an edge between e1 and e2, using the empty edge data class
DBG_TEMPLATE_DEF bool DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::searchEdge | ( | EdgeType & | edge, |
dbgEdge & | edesc | ||
) | const |
search for a specific edge in the graph, using operator= on the id, returns false if not found
Definition at line 684 of file SqliteDatabaseGraph.h.
References boost::edge_dbg_data.
DBG_TEMPLATE_DEF void DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::setSubgraphInit | ( | int | refcol, |
dbRow * | rowdata, | ||
int | namecol | ||
) |
set subgraph initialization information
Definition at line 608 of file SqliteDatabaseGraph.h.
DBG_TEMPLATE_DEF int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::clearSuccessors | ( | VertexType & | parent) |
remove all successor pointers from a node
Definition at line 621 of file SqliteDatabaseGraph.h.
References always_true_pred().
DBG_TEMPLATE_DEF int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::removeNode | ( | VertexType & | node) |
remove node from the tree
Definition at line 718 of file SqliteDatabaseGraph.h.
DBG_TEMPLATE_DEF int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::nodeIsUsed | ( | VertexType & | node) |
check if there is an edge in the graph pointing to this node
Definition at line 703 of file SqliteDatabaseGraph.h.
DBG_TEMPLATE_DEF int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::getGraphId | ( | ) |
get graph id (this function creates an graphdata entry, if the id is not retrieved by another function yet)
helper predicate for removeNode function
Definition at line 751 of file SqliteDatabaseGraph.h.
References Dbg::dbg, cgData::get_graphid(), and cgData::insert().
|
inline |
set the column number of the VertexType column to take the node names from
Definition at line 447 of file SqliteDatabaseGraph.h.
DBG_TEMPLATE_DEF int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::loadFromDatabase | ( | void | ) |
load graph from datbase
Definition at line 768 of file SqliteDatabaseGraph.h.
References boost::edge_dbg_data, SageInterface::find(), cgEdge::get_edgeId(), cgEdge::get_sourceId(), cgEdge::get_targetId(), GRAPHEDGETBL, GRAPHNODETBL, cgEdge::load(), and boost::vertex_dbg_data.
DBG_TEMPLATE_DEF int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::writeToDatabase | ( | void | ) |
store graph in datbase
Definition at line 980 of file SqliteDatabaseGraph.h.
References boost::edge_dbg_data, GRAPHEDGETBL, GRAPHNODETBL, cgNode::insert(), cgEdge::insert(), and boost::vertex_dbg_data.
DBG_TEMPLATE_DEF void DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::writeToDOTFile | ( | std::string | filename) |
write DOT graph to filename
Definition at line 648 of file SqliteDatabaseGraph.h.
|
inline |
write the adjacency matrix to a file (only integer matrix entries, raw file format)
Definition at line 462 of file SqliteDatabaseGraph.h.
|
inline |
write the adjacency matrix to a file (in MCL raw file format for mcxassemble)
Definition at line 465 of file SqliteDatabaseGraph.h.
|
private |
search for a specific node in the graph, using operator=, returns NULL if not found
Definition at line 666 of file SqliteDatabaseGraph.h.
References boost::vertex_dbg_data.
|
private |
project id for this graph
Definition at line 477 of file SqliteDatabaseGraph.h.
|
private |
graph id from the graphdata table
Definition at line 480 of file SqliteDatabaseGraph.h.
|
private |
graph type
Definition at line 483 of file SqliteDatabaseGraph.h.
|
private |
column index of the column used for the node names
Definition at line 486 of file SqliteDatabaseGraph.h.
|
private |
database connection pointer
Definition at line 489 of file SqliteDatabaseGraph.h.
|
private |
initialize subgraph information from another table?
Definition at line 492 of file SqliteDatabaseGraph.h.
|
private |
column id for subgraph table id's
Definition at line 495 of file SqliteDatabaseGraph.h.
|
private |
table rowdata object for selection of subgraph names
Definition at line 498 of file SqliteDatabaseGraph.h.
|
private |
index of subgraph name table column
Definition at line 501 of file SqliteDatabaseGraph.h.