libgexf
0.1.3
|
Topology structure of the graph. More...
#include <graph.h>
Public Member Functions | |
Graph (const Graph &orig) | |
Copy constructor. | |
void | addNode (const libgexf::t_id id) |
Add a node. More... | |
void | addEdge (const libgexf::t_id id, const libgexf::t_id source_id, const libgexf::t_id target_id, const float weight=1.0, const libgexf::t_edge_type type=EDGE_UNDEF) |
Add an edge. More... | |
void | removeNode (const libgexf::t_id id) |
Remove a node. More... | |
void | removeEdge (const libgexf::t_id source_id, const libgexf::t_id target_id) |
Remove an edge. More... | |
bool | containsNode (const libgexf::t_id id) const |
Test node existence. More... | |
bool | containsEdge (const libgexf::t_id source_id, const libgexf::t_id target_id) const |
Test edge existence. More... | |
t_id | getEdge (const libgexf::t_id source_id, const libgexf::t_id target_id) const |
Get the edge id. More... | |
libgexf::NodeIter * | getNodes () const |
Get all nodes. More... | |
libgexf::EdgeIter * | getEdges () const |
Get all edges. More... | |
std::vector< libgexf::t_id > | getNeighbors (const libgexf::t_id node_id) const |
Get node neighbors. More... | |
unsigned int | getNodeCount () const |
Count the nodes. More... | |
unsigned int | getEdgeCount () const |
Count the edges. More... | |
unsigned int | getDegree (const libgexf::t_id node_id) const |
Get node degree. More... | |
void | clearEdges (const libgexf::t_id node_id) |
Delete node links. More... | |
void | clear () |
Clear the graph. | |
void | clearEdges () |
Delete all edges. | |
void | readLock () throw (libgexf::ReadLockException) |
Set a lock on reading. More... | |
void | readUnlock () |
Unset a lock on reading. | |
void | writeLock () throw (libgexf::WriteLockException) |
Get a lock on writing. More... | |
void | writeUnlock () |
Unset a lock on writing. | |
bool | isReadLock () |
Test if a read lock exists. | |
bool | isWriteLock () |
Test if a write lock exists. | |
bool | isUnlock () |
Unset all locks. | |
Protected Attributes | |
std::set< t_id > | _nodes |
std::map< t_id, std::map< t_id, t_id > > | _edges |
std::map< t_id, std::set< t_id > > | _reverse_edges |
std::set< t_id > | _bloom_edges |
std::map< t_id, std::map< t_edge_property, t_edge_value > > | _edges_properties |
unsigned short int | _rlock_count |
char | _lock_flag |
Flag used for determining the lock type: More... | |
Friends | |
class | NodeIter |
class | EdgeIter |
std::ostream & | operator<< (std::ostream &os, const Graph &o) |
Topology structure of the graph.
void libgexf::Graph::addEdge | ( | const libgexf::t_id | id, |
const libgexf::t_id | source_id, | ||
const libgexf::t_id | target_id, | ||
const float | weight = 1.0 , |
||
const libgexf::t_edge_type | type = EDGE_UNDEF |
||
) |
Add an edge.
id | : edge ID |
source_id | : source node ID |
target_id | : target node ID |
weight | : weight of the edge (optional, 1.0 by default) |
type | : type of edge (optional, undef by default) |
void libgexf::Graph::addNode | ( | const libgexf::t_id | id | ) |
Add a node.
id | : node ID |
void libgexf::Graph::clearEdges | ( | const libgexf::t_id | node_id | ) |
Delete node links.
node_id | : node ID |
bool libgexf::Graph::containsEdge | ( | const libgexf::t_id | source_id, |
const libgexf::t_id | target_id | ||
) | const |
Test edge existence.
source_id | : source node ID |
target_id | : target node ID |
bool libgexf::Graph::containsNode | ( | const libgexf::t_id | id | ) | const |
Test node existence.
id | : node ID |
unsigned int libgexf::Graph::getDegree | ( | const libgexf::t_id | node_id | ) | const |
Get node degree.
node_id | : node ID |
t_id libgexf::Graph::getEdge | ( | const libgexf::t_id | source_id, |
const libgexf::t_id | target_id | ||
) | const |
Get the edge id.
source_id | : source node ID |
target_id | : target node ID |
unsigned int libgexf::Graph::getEdgeCount | ( | ) | const |
Count the edges.
EdgeIter * libgexf::Graph::getEdges | ( | ) | const |
Get all edges.
vector< t_id > libgexf::Graph::getNeighbors | ( | const libgexf::t_id | node_id | ) | const |
Get node neighbors.
node_id | : node ID |
unsigned int libgexf::Graph::getNodeCount | ( | ) | const |
Count the nodes.
NodeIter * libgexf::Graph::getNodes | ( | ) | const |
Get all nodes.
void libgexf::Graph::readLock | ( | ) | ||
throw | ( | libgexf::ReadLockException | ||
) |
Set a lock on reading.
ReadLockException | { Unable to set the lock } |
void libgexf::Graph::removeEdge | ( | const libgexf::t_id | source_id, |
const libgexf::t_id | target_id | ||
) |
Remove an edge.
source_id | : source node ID |
target_id | : target node ID |
void libgexf::Graph::removeNode | ( | const libgexf::t_id | id | ) |
Remove a node.
id | : node ID |
void libgexf::Graph::writeLock | ( | ) | ||
throw | ( | libgexf::WriteLockException | ||
) |
Get a lock on writing.
WriteLockException | { Unable to set the lock } |
|
protected |
Set of all edge_id used as a (poor) bloom filter
map<source_id, map<target_id, edge_id> >
|
protected |
Topological properties of edges
|
protected |
Flag used for determining the lock type:
|
protected |
Set of all nodes
map<target_id, set<source_id> >
|
protected |
Number of read-locks