VGServer::GraphConnection Class Reference
[Public Application Interface]

GraphConnection represents the context and link to exactly one client instance. More...

#include <GraphConnection.h>

List of all members.

Public Types

typedef std::vector< class
EdgeRef
edgereflist_t
 typedef of the return value of getEdgeList

Public Member Functions

bool addEdge (vertexid_t src, vertexid_t tgt)
 adds a new edge from source to target vertex. returns true for success
bool addVertex (vertexid_t id)
 adds a new vertex. Returns true for success (the vertex didnt exist yet)
unsigned int advanceTimeFrame ()
 advance the change timeline to the next frame.
void commit ()
 commit recorded changes into the global graph. warning: slow operation
bool delEdge (vertexid_t src, vertexid_t tgt)
 removes an edge from the graph. returns true if it existed.
bool delVertex (vertexid_t id)
 deletes a vertex from the graph. returns true if it existed
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, class ByteBuffer &dest) const
 main function for the client: retrieve all vertices and edges within the specified rectangle which match the expression in filter.
GraphClientFace getClientFace ()
EdgeRef getEdge (vertexid_t src, vertexid_t tgt) const
 return a single edge object (if it exists)
edgereflist_t getEdgeList (vertexid_t id) const
 return the list of outgoing edges
void getGraphProperties (class ByteBuffer &dest) const
 auxiliary function for the client: return a serialization of the graph properties including all available attributes.
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, class ByteBuffer &dest) const
 another function for the client: retrieve within the specified rectangle the vertex and edge closest to (selx,sely).
VertexRef getVertex (vertexid_t id) const
 return a single vertex object
 GraphConnection (GraphContainer &graph)
 construct a new application scenario connection
void rollback ()
 abort all changes by clearing the current changelist
bool setEdgeAttr (vertexid_t src, vertexid_t tgt, unsigned int attrid, const AnyType &value)
 changes the value of an attribute on the edge
bool setVertexAttr (vertexid_t id, unsigned int attrid, const AnyType &value)
 changes the value of an attribute on the vertex
virtual ~GraphConnection ()


Detailed Description

GraphConnection represents the context and link to exactly one client instance.

Each client context has it's local set of changes to the graph made by the application. This class is abstract and must be filled with the application itself, as in most cases the application's interesting issues are limited to a client's context.

Definition at line 17 of file GraphConnection.h.


Member Typedef Documentation

typedef std::vector<class EdgeRef> VGServer::GraphConnection::edgereflist_t

typedef of the return value of getEdgeList

Definition at line 84 of file GraphConnection.h.


Constructor & Destructor Documentation

VGServer::GraphConnection::GraphConnection ( GraphContainer graph  ) 

construct a new application scenario connection

Definition at line 10 of file GraphConnection.cc.

VGServer::GraphConnection::~GraphConnection (  )  [virtual]

Definition at line 15 of file GraphConnection.cc.


Member Function Documentation

bool VGServer::GraphConnection::addEdge ( vertexid_t  src,
vertexid_t  tgt 
) [inline]

adds a new edge from source to target vertex. returns true for success

Definition at line 57 of file GraphConnection.h.

References VGServer::ChangeTimeline::addEdge().

bool VGServer::GraphConnection::addVertex ( vertexid_t  id  )  [inline]

adds a new vertex. Returns true for success (the vertex didnt exist yet)

Definition at line 45 of file GraphConnection.h.

References VGServer::ChangeTimeline::addVertex().

unsigned int VGServer::GraphConnection::advanceTimeFrame (  )  [inline]

advance the change timeline to the next frame.

returns the number of the next frame.

Definition at line 70 of file GraphConnection.h.

References VGServer::ChangeTimeline::advanceTimeFrame().

void VGServer::GraphConnection::commit (  ) 

commit recorded changes into the global graph. warning: slow operation

Definition at line 27 of file GraphConnection.cc.

References VGServer::GraphContainer::applyChangelist(), VGServer::ChangeTimeline::clear(), and VGServer::ChangeTimeline::getChangelistEnd().

bool VGServer::GraphConnection::delEdge ( vertexid_t  src,
vertexid_t  tgt 
) [inline]

removes an edge from the graph. returns true if it existed.

Definition at line 65 of file GraphConnection.h.

References VGServer::ChangeTimeline::delEdge().

bool VGServer::GraphConnection::delVertex ( vertexid_t  id  )  [inline]

deletes a vertex from the graph. returns true if it existed

Definition at line 53 of file GraphConnection.h.

References VGServer::ChangeTimeline::delVertex().

void VGServer::GraphConnection::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,
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 39 of file GraphConnection.cc.

References VGServer::GraphContainer::getArea().

Referenced by VGServer::GraphClientFace::getArea().

class GraphClientFace VGServer::GraphConnection::getClientFace (  ) 

Definition at line 19 of file GraphConnection.cc.

References VGServer::GraphClientFace::GraphClientFace().

class EdgeRef VGServer::GraphConnection::getEdge ( vertexid_t  src,
vertexid_t  tgt 
) const [inline]

return a single edge object (if it exists)

Definition at line 80 of file GraphConnection.h.

References VGServer::ChangeTimeline::getChangelistEnd(), and VGServer::GraphContainer::getEdge().

edgereflist_t VGServer::GraphConnection::getEdgeList ( vertexid_t  id  )  const [inline]

return the list of outgoing edges

Definition at line 87 of file GraphConnection.h.

References VGServer::ChangeTimeline::getChangelistEnd(), and VGServer::GraphContainer::getEdgeList().

void VGServer::GraphConnection::getGraphProperties ( class ByteBuffer dest  )  const

auxiliary function for the client: return a serialization of the graph properties including all available attributes.

Definition at line 33 of file GraphConnection.cc.

References VGServer::GraphContainer::getGraphProperties().

void VGServer::GraphConnection::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,
class ByteBuffer dest 
) const

another function for the client: retrieve within the specified rectangle the vertex and edge closest to (selx,sely).

Returns the selected attributes.

Definition at line 48 of file GraphConnection.cc.

References VGServer::ChangeTimeline::getChangelistStart(), and VGServer::GraphContainer::getNearestNeighbor().

class VertexRef VGServer::GraphConnection::getVertex ( vertexid_t  id  )  const [inline]

return a single vertex object

Definition at line 76 of file GraphConnection.h.

References VGServer::ChangeTimeline::getChangelistEnd(), and VGServer::GraphContainer::getVertex().

void VGServer::GraphConnection::rollback (  ) 

abort all changes by clearing the current changelist

Definition at line 22 of file GraphConnection.cc.

References VGServer::ChangeTimeline::clear().

bool VGServer::GraphConnection::setEdgeAttr ( vertexid_t  src,
vertexid_t  tgt,
unsigned int  attrid,
const AnyType value 
) [inline]

changes the value of an attribute on the edge

Definition at line 61 of file GraphConnection.h.

References VGServer::ChangeTimeline::setEdgeAttr().

bool VGServer::GraphConnection::setVertexAttr ( vertexid_t  id,
unsigned int  attrid,
const AnyType value 
) [inline]

changes the value of an attribute on the vertex

Definition at line 49 of file GraphConnection.h.

References VGServer::ChangeTimeline::setVertexAttr().


The documentation for this class was generated from the following files:
Generated on Wed Sep 27 14:34:01 2006 for VGServer by  doxygen 1.4.7