Context Class Reference
[Algorithms]

Context class. More...

List of all members.

Public Member Functions

void AddEdgeType (sparksee::gdb::type_t t, sparksee::gdb::EdgesDirection d)
 Allows for traversing edges of the given type.
void AddAllEdgeTypes (sparksee::gdb::EdgesDirection d)
 Allows for traversing all edge types of the graph.
void AddNodeType (sparksee::gdb::type_t t)
 Allows for traversing nodes of the given type.
void AddAllNodeTypes ()
 Allows for traversing all node types of the graph.
void ExcludeNodes (sparksee::gdb::Objects &nodes)
 Set which nodes can't be used.
void ExcludeEdges (sparksee::gdb::Objects &edges)
 Set which edges can't be used.
sparksee::gdb::Objects * Compute ()
 Gets the resulting collection of nodes.
void SetMaximumHops (sparksee::gdb::int32_t maxhops, sparksee::gdb::bool_t include)
 Sets the maximum hops restriction.
virtual ~Context ()
 Destructor.
 Context (sparksee::gdb::Session &session, sparksee::gdb::oid_t node)
 Creates a new instance.

Static Public Member Functions

static sparksee::gdb::Objects * Compute (sparksee::gdb::Session &session, sparksee::gdb::oid_t node, sparksee::gdb::TypeList *nodeTypes, sparksee::gdb::TypeList *edgeTypes, sparksee::gdb::EdgesDirection dir, sparksee::gdb::int32_t maxhops, sparksee::gdb::bool_t include)
 Helper method to easily compute a context from a node.

Protected Attributes

sparksee::gdb::Session * sess
 Session.
sparksee::gdb::Graph * graph
 Graph.
sparksee::gdb::oid_t src
 Source node of the traversal.
std::map
< sparksee::gdb::type_t,
sparksee::gdb::EdgesDirection
edgeTypes
 Allowed edge types.
std::vector
< sparksee::gdb::type_t
nodeTypes
 Allowed node types.
sparksee::gdb::int32_t maxHops
 Maximum number of hops allowed.
sparksee::gdb::bool_t inclusive
 Include those nodes at distance <= maxhops or just those nodes at distance == maxhops.
sparksee::gdb::Objects * excludedNodes
 The set of excluded nodes.
sparksee::gdb::Objects * excludedEdges
 The set of excluded edges.


Detailed Description

Context class.

It provides a very similar functionality than the Traversal classes. The main difference is Context returns a resulting collection whereas Traversal provides an iterator behaviour.

Check out the 'Algorithms' section in the SPARKSEE User Manual for more details on this.

Author:
Sparsity Technologies http://www.sparsity-technologies.com

Constructor & Destructor Documentation

Context::Context ( sparksee::gdb::Session &  session,
sparksee::gdb::oid_t  node 
)

Creates a new instance.

Parameters:
session [in] Session to get the graph from and perform operation.
node [in] Node to start traversal from.


Member Function Documentation

void Context::AddEdgeType ( sparksee::gdb::type_t  t,
sparksee::gdb::EdgesDirection  d 
)

Allows for traversing edges of the given type.

Parameters:
t [in] Edge type.
d [in] Edge direction.

void Context::AddAllEdgeTypes ( sparksee::gdb::EdgesDirection  d  ) 

Allows for traversing all edge types of the graph.

Parameters:
d [in] Edge direction.

void Context::ExcludeNodes ( sparksee::gdb::Objects &  nodes  ) 

Set which nodes can't be used.

This will replace any previously specified set of excluded nodes. Should only be used to exclude the usage of specific nodes from allowed node types because it's less efficient than not allowing a node type.

Parameters:
nodes [in] A set of node identifiers that must be kept intact until the destruction of the class.

void Context::ExcludeEdges ( sparksee::gdb::Objects &  edges  ) 

Set which edges can't be used.

This will replace any previously specified set of excluded edges. Should only be used to exclude the usage of specific edges from allowed edge types because it's less efficient than not allowing an edge type.

Parameters:
edges [in] A set of edge identifiers that must be kept intact until the destruction of the class.

sparksee::gdb::Objects* Context::Compute (  ) 

Gets the resulting collection of nodes.

Returns:
The resulting collection of nodes.

void Context::SetMaximumHops ( sparksee::gdb::int32_t  maxhops,
sparksee::gdb::bool_t  include 
)

Sets the maximum hops restriction.

All paths longer than the maximum hops restriction will be ignored.

Parameters:
maxhops [in] The maximum hops restriction. It must be positive or zero. Zero, the default value, means unlimited.
include [in] If TRUE, the resulting collection will include those nodes at distance less or equal than the given one, otherwise it will just include those nodes at distance equal than the given one. This parameter just makes sense if maxhops is different from 0; in that case it includes all nodes no matters the distance.

static sparksee::gdb::Objects* Context::Compute ( sparksee::gdb::Session &  session,
sparksee::gdb::oid_t  node,
sparksee::gdb::TypeList *  nodeTypes,
sparksee::gdb::TypeList *  edgeTypes,
sparksee::gdb::EdgesDirection  dir,
sparksee::gdb::int32_t  maxhops,
sparksee::gdb::bool_t  include 
) [static]

Helper method to easily compute a context from a node.

Parameters:
session [in] Session to get the graph from and perform operation.
node [in] Node to start traversal from.
nodeTypes [in] Allowed node type list. NULL means all node types are allowed.
edgeTypes [in] Allowed edge type list. NULL means all edge types are allowed.
dir [in] Allowed direction for the allowed edge types.
maxhops [in] The maximum hops restriction. It must be positive or zero. Zero, the default value, means unlimited.
include [in] If TRUE, the resulting collection will include those nodes at distance less or equal than the given one, otherwise it will just include those nodes at distance equal than the given one. This parameter just makes sense if maxhops is different from 0; in that case it includes all nodes no matters the distance.
Returns:
Returns an Objects with the computed context of a node.


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

Generated on Fri Sep 12 13:36:25 2014 for Sparksee by  doxygen 1.5.6