#include <GraphContainer.h>
Inheritance diagram for VGServer::GraphContainer:
Public Types | |
typedef RTree_t::Tree< struct RTreeData, struct RTreeDataCallback > | GraphRTree |
typedef RTree | RTree_t |
typedef RTree_t::LevelStats | RTreeLevelStats_t |
typedef RTree_t::Stats | RTreeStats_t |
Public Member Functions | |
void | applyChangelist (const class Changelist &cl) |
this takes the changes from cl and merges them into the current graph data. | |
void | applyChangeTimeline (const class ChangeTimeline &ct) |
this takes the changes from cl and merges them into the current graph data. | |
void | applyGraphData (class GraphData &newgraph) |
atomicly changes the graph data, swaps the old data into newgraph and updates index structures | |
void | getArea (coord_t x1, coord_t y1, coord_t x2, coord_t y2, const QueryLimits *ql, const char *filter, const char *vertexattrsel, const char *edgeattrsel, const class ChangeTimeline &ct, class ByteBuffer &dest) const |
main function for the client: retrieve all vertices and edges within the specified rectangle which match the expression in filter. | |
EdgeRef | getEdge (vertexid_t src, vertexid_t tgt, const class Changelist &cl) const |
return a single edge reference object | |
std::vector< class EdgeRef > | getEdgeList (vertexid_t id, const class Changelist &cl) const |
return the list of outgoing edge references | |
void | getGraphProperties (class ByteBuffer &dest) const |
unsigned int | getLastQueryEdgenum () const |
function for experiments: return the number of edges returned in the last query | |
void | getNearestNeighbor (coord_t x1, coord_t y1, coord_t x2, coord_t y2, coord_t selx, coord_t sely, const QueryLimits *ql, const char *filter, const char *vertexattrsel, const char *edgeattrsel, const class Changelist &cl, class ByteBuffer &dest) const |
auxiliary function for the client to handle a mouse click on the world | |
unsigned int | getRTreeNum () const |
return number of rtrees | |
void | getRTreeStats (RTreeStats_t &st) const |
return the statistics struct caluclated from all rtrees | |
VertexRef | getVertex (vertexid_t id, const class Changelist &cl) const |
return a single vertex reference object | |
GraphContainer (const class GraphProperties &properties) | |
bool | loadSnapshot (std::istream &s) |
reload the global static graph arrays from a snapshot including the r-tree | |
void | saveSnapshot (std::ostream &s) const |
write the global static graph arrays as a snapshot which can be loaded very fast. | |
void | swap (class GraphContainer &other) |
atomicly swaps the graph data and index structures from the other object. | |
~GraphContainer () | |
Public Attributes | |
unsigned int | reinsertnum |
Classes | |
class | NNResult |
class used to save the current nearest neighbor result | |
class | NNVisitor |
class used as a visitor when walking the R-Tree for nearest neighbor | |
struct | RTreeData |
structure which contains the data for each rectangle in the leaves of the rtree More... | |
struct | RTreeDataCallback |
callback context class used to get a MBR from a data object More... | |
struct | rtreemap_compare |
struct used as Comparison Relation for the rtreemap | |
class | Visitor |
class used as a visitor when walking the R-Tree |
This makes it the place in which the threads of the client connections have to be synchronized. It will also manage additional data structures used for efficient searching in the graph.
Definition at line 32 of file GraphContainer.h.
typedef RTree_t::Tree<struct RTreeData, struct RTreeDataCallback> VGServer::GraphContainer::GraphRTree |
Definition at line 78 of file GraphContainer.h.
typedef class RTree VGServer::GraphContainer::RTree_t |
Definition at line 36 of file GraphContainer.h.
typedef RTree_t::LevelStats VGServer::GraphContainer::RTreeLevelStats_t |
Definition at line 196 of file GraphContainer.h.
typedef RTree_t::Stats VGServer::GraphContainer::RTreeStats_t |
Definition at line 195 of file GraphContainer.h.
VGServer::GraphContainer::GraphContainer | ( | const class GraphProperties & | properties | ) | [explicit] |
VGServer::GraphContainer::~GraphContainer | ( | ) |
Definition at line 47 of file GraphContainer.cc.
void VGServer::GraphContainer::applyChangelist | ( | const class Changelist & | cl | ) |
this takes the changes from cl and merges them into the current graph data.
this operation takes a long time, because the arrays are reconstructed. care should be taken not to access the data in this time.
Reimplemented from VGServer::GraphData.
Definition at line 175 of file GraphContainer.cc.
References VGServer::GraphData::applyChangelist(), VGServer::GraphData::getEdgeAttr(), VGServer::GraphData::getEdgeCount(), VGServer::AnyType::getInteger(), and reinsertnum.
Referenced by applyChangeTimeline(), and VGServer::GraphConnection::commit().
void VGServer::GraphContainer::applyChangeTimeline | ( | const class ChangeTimeline & | ct | ) |
this takes the changes from cl and merges them into the current graph data.
this operation takes a long time, because the arrays are reconstructed. care should be taken not to access the data in this time.
Definition at line 242 of file GraphContainer.cc.
References applyChangelist().
void VGServer::GraphContainer::applyGraphData | ( | class GraphData & | newgraph | ) |
atomicly changes the graph data, swaps the old data into newgraph and updates index structures
Definition at line 51 of file GraphContainer.cc.
References VGServer::GraphData::swap().
void VGServer::GraphContainer::getArea | ( | coord_t | x1, | |
coord_t | y1, | |||
coord_t | x2, | |||
coord_t | y2, | |||
const QueryLimits * | ql, | |||
const char * | filter, | |||
const char * | vertexattrsel, | |||
const char * | edgeattrsel, | |||
const class ChangeTimeline & | ct, | |||
class ByteBuffer & | dest | |||
) | const |
main function for the client: retrieve all vertices and edges within the specified rectangle which match the expression in filter.
Includes the attributes which's names are in vertexattrsel or edgeattrsel.
Definition at line 456 of file GraphContainer.cc.
References VGServer::ByteOutBuffer::append(), VGServer::ByteOutBuffer::appendByteBuffer(), VGServer::ByteOutBuffer::appendBytes(), VGServer::ByteOutBuffer::appendString(), VGServer::ChangeFrame::CHG_ADDEDGE, VGServer::ChangeFrame::CHG_ADDVERTEX, VGServer::ChangeFrame::CHG_DELEDGE, VGServer::ChangeFrame::CHG_DELVERTEX, VGServer::ChangeFrame::CHG_NONE, VGServer::ChangeFrame::CHG_SETEDGE, VGServer::ChangeFrame::CHG_SETVERTEX, VGServer::TpAttributeBlob< AllocPolicy >::data(), VGServer::QueryLimits::edgemaxlimit, VGServer::QueryLimits::edgeminlimit, VGServer::FilterRoot::parseString(), VGServer::GraphData::properties, VGServer::ByteBuffer::size(), VGServer::timestamp(), VGServer::VE_EDGE, VGServer::VE_VERTEX, VGServer::GraphData::vertexcount, VGServer::QueryLimits::vertexmaxlimit, VGServer::QueryLimits::vertexminlimit, and VGServer::GraphException::what_str().
Referenced by VGServer::GraphConnection::getArea().
class EdgeRef VGServer::GraphContainer::getEdge | ( | vertexid_t | src, | |
vertexid_t | tgt, | |||
const class Changelist & | cl | |||
) | const |
return a single edge reference object
Definition at line 358 of file GraphContainer.cc.
References VGServer::GraphData::EdgeRef, VGServer::GraphData::edges, and VGServer::GraphData::getEdgeIdx().
Referenced by VGServer::GraphConnection::getEdge().
std::vector< class EdgeRef > VGServer::GraphContainer::getEdgeList | ( | vertexid_t | id, | |
const class Changelist & | cl | |||
) | const |
return the list of outgoing edge references
Definition at line 378 of file GraphContainer.cc.
References VGServer::GraphData::EdgeRef, VGServer::GraphData::edges, and VGServer::GraphData::vertices.
Referenced by VGServer::GraphConnection::getEdgeList().
void VGServer::GraphContainer::getGraphProperties | ( | class ByteBuffer & | dest | ) | const |
Definition at line 438 of file GraphContainer.cc.
References VGServer::ByteOutBuffer::append(), VGServer::GraphProperties::appendBinaryFormat(), and VGServer::GraphData::properties.
Referenced by VGServer::GraphConnection::getGraphProperties().
unsigned int VGServer::GraphContainer::getLastQueryEdgenum | ( | ) | const [inline] |
function for experiments: return the number of edges returned in the last query
Definition at line 188 of file GraphContainer.h.
void VGServer::GraphContainer::getNearestNeighbor | ( | coord_t | x1, | |
coord_t | y1, | |||
coord_t | x2, | |||
coord_t | y2, | |||
coord_t | selx, | |||
coord_t | sely, | |||
const QueryLimits * | ql, | |||
const char * | filter, | |||
const char * | vertexattrsel, | |||
const char * | edgeattrsel, | |||
const class Changelist & | cl, | |||
class ByteBuffer & | dest | |||
) | const |
auxiliary function for the client to handle a mouse click on the world
this is the result nearest neighbor object
Definition at line 916 of file GraphContainer.cc.
References VGServer::ByteOutBuffer::append(), VGServer::ByteOutBuffer::appendBytes(), VGServer::ByteOutBuffer::appendString(), VGServer::TpAttributeBlob< AllocPolicy >::data(), VGServer::QueryLimits::edgemaxlimit, VGServer::QueryLimits::edgeminlimit, VGServer::FilterRoot::parseString(), VGServer::GraphData::properties, VGServer::timestamp(), VGServer::VE_EDGE, VGServer::VE_VERTEX, VGServer::VERTEX_INVALID, VGServer::QueryLimits::vertexmaxlimit, VGServer::QueryLimits::vertexminlimit, and VGServer::GraphException::what_str().
Referenced by VGServer::GraphConnection::getNearestNeighbor().
unsigned int VGServer::GraphContainer::getRTreeNum | ( | ) | const [inline] |
void VGServer::GraphContainer::getRTreeStats | ( | RTreeStats_t & | st | ) | const |
return the statistics struct caluclated from all rtrees
Definition at line 167 of file GraphContainer.cc.
class VertexRef VGServer::GraphContainer::getVertex | ( | vertexid_t | id, | |
const class Changelist & | cl | |||
) | const |
return a single vertex reference object
Definition at line 338 of file GraphContainer.cc.
References VGServer::GraphData::existVertex(), and VGServer::GraphData::VertexRef.
Referenced by VGServer::GraphConnection::getVertex().
bool VGServer::GraphContainer::loadSnapshot | ( | std::istream & | s | ) |
reload the global static graph arrays from a snapshot including the r-tree
Reimplemented from VGServer::GraphData.
Definition at line 282 of file GraphContainer.cc.
References VGServer::GraphData::loadSnapshot().
void VGServer::GraphContainer::saveSnapshot | ( | std::ostream & | s | ) | const |
write the global static graph arrays as a snapshot which can be loaded very fast.
this includes the r-tree
Reimplemented from VGServer::GraphData.
Definition at line 247 of file GraphContainer.cc.
References VGServer::GraphData::saveSnapshot().
void VGServer::GraphContainer::swap | ( | class GraphContainer & | other | ) |
atomicly swaps the graph data and index structures from the other object.
Definition at line 60 of file GraphContainer.cc.
References VGServer::GraphData::swap().
unsigned int VGServer::GraphContainer::reinsertnum |
Definition at line 120 of file GraphContainer.h.
Referenced by applyChangelist(), and GraphContainer().