ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty > Class Template Reference

graph database storage class More...

#include <SqliteDatabaseGraph.h>

Inheritance diagram for DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >:
Collaboration diagram for DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >:

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, dbgEdgedbgEdgeReturn
 

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...
 
dbRowmpSubgraphNameRowdata
 table rowdata object for selection of subgraph names More...
 
int mSubgraphNameColumn
 index of subgraph name table column More...
 

Detailed Description

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
class DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >

graph database storage class

Definition at line 377 of file SqliteDatabaseGraph.h.

Member Typedef Documentation

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
typedef std::pair<bool, dbgEdge> DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::dbgEdgeReturn

Definition at line 409 of file SqliteDatabaseGraph.h.

Constructor & Destructor Documentation

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
DBG_TEMPLATE_DEF DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::~DatabaseGraph ( )

destructor

Definition at line 600 of file SqliteDatabaseGraph.h.

Member Function Documentation

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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().

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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().

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
void DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::setNodeNameColumn ( int  set)
inline

set the column number of the VertexType column to take the node names from

Definition at line 447 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
DBG_TEMPLATE_DEF int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::loadFromDatabase ( void  )
template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
DBG_TEMPLATE_DEF int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::writeToDatabase ( void  )
template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
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.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
void DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::writeAdjacencyMatrixToFileRaw ( std::string  filename)
inline

write the adjacency matrix to a file (only integer matrix entries, raw file format)

Definition at line 462 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
void DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::writeAdjacencyMatrixToFileMcl ( std::string  filename)
inline

write the adjacency matrix to a file (in MCL raw file format for mcxassemble)

Definition at line 465 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
DBG_TEMPLATE_DEF bool DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::searchVertex ( VertexType &  node,
dbgVertex vdesc 
) const
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.

Member Data Documentation

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
long DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mProjectId
private

project id for this graph

Definition at line 477 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
long DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mGraphId
private

graph id from the graphdata table

Definition at line 480 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
long DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mType
private

graph type

Definition at line 483 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
short DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mNameColumn
private
template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
sqlite3x::sqlite3_connection* DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mpGDB
private

database connection pointer

Definition at line 489 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
bool DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mInitSubgraphs
private

initialize subgraph information from another table?

Definition at line 492 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mSubgraphReferenceColumn
private

column id for subgraph table id's

Definition at line 495 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
dbRow* DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mpSubgraphNameRowdata
private

table rowdata object for selection of subgraph names

Definition at line 498 of file SqliteDatabaseGraph.h.

template<class VertexType, class EdgeType, class BoostVertexList, class BoostEdgeList, class BoostDirection, class BoostVertexProperty, class BoostEdgeProperty, class BoostGraphProperty>
int DatabaseGraph< VertexType, EdgeType, BoostVertexList, BoostEdgeList, BoostDirection, BoostVertexProperty, BoostEdgeProperty, BoostGraphProperty >::mSubgraphNameColumn
private

index of subgraph name table column

Definition at line 501 of file SqliteDatabaseGraph.h.


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