RepastHPC  2.3.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
repast::Vertex< V, E > Class Template Referenceabstract

Used internally by repast graphs / networks to encapsulate Vertices. More...

#include <Vertex.h>

Inheritance diagram for repast::Vertex< V, E >:
repast::DirectedVertex< V, E > repast::UndirectedVertex< V, E >

Public Types

enum  EdgeType { INCOMING, OUTGOING }
 Enum the identifies whether an edge is incoming or outgoing.
 
typedef boost::unordered_map< Vertex< V, E > *, boost::shared_ptr< E >, HashVertex< V, E > > AdjListMap
 Typedef for the adjacency list map that contains the other Vertices that this Vertex links to.
 
typedef AdjListMap::iterator AdjListMapIterator
 

Public Member Functions

 Vertex (boost::shared_ptr< V > item)
 Creates a Vertex that contains the specified item. More...
 
virtual boost::shared_ptr< E > removeEdge (Vertex *other, EdgeType type)=0
 Removes the edge of the specified type between this Vertex and the specified Vertex. More...
 
virtual boost::shared_ptr< E > findEdge (Vertex *other, EdgeType type)=0
 Finds the edge of the specified type between this Vertex and the specified vertex. More...
 
virtual void addEdge (Vertex< V, E > *other, boost::shared_ptr< E > edge, EdgeType type)=0
 Adds an edge of the specified type between this Vertex and the specified vertex. More...
 
virtual void successors (std::vector< V * > &out)=0
 Gets the successors of this Vertex. More...
 
virtual void predecessors (std::vector< V * > &out)=0
 Gets the predecessors of this Vertex. More...
 
virtual void adjacent (std::vector< V * > &out)=0
 Gets the Vertices adjacent to this Vertex. More...
 
virtual void edges (EdgeType type, std::vector< boost::shared_ptr< E > > &out)=0
 Gets all the edges of the specified type in which this Vertex participates and return them in out. More...
 
virtual int inDegree ()=0
 Gets the in degree of this Vertex. More...
 
virtual int outDegree ()=0
 Gets the out degree of this Vertex. More...
 
boost::shared_ptr< V > item () const
 Gets the item that this Vertex contains. More...
 

Protected Member Functions

boost::shared_ptr< E > removeEdge (Vertex< V, E > *other, AdjListMap *adjMap)
 
void getItems (AdjListMap *adjMap, std::vector< V * > &out)
 
void edges (AdjListMap *adjMap, std::vector< boost::shared_ptr< E > > &out)
 

Protected Attributes

boost::shared_ptr< V > ptr
 

Friends

struct NodeGetter< V, E >
 

Detailed Description

template<typename V, typename E>
class repast::Vertex< V, E >

Used internally by repast graphs / networks to encapsulate Vertices.

Template Parameters
Vthe type of object stored by in a Vertex.
Ethe edge type of the network.

Constructor & Destructor Documentation

◆ Vertex()

template<typename V , typename E >
repast::Vertex< V, E >::Vertex ( boost::shared_ptr< V >  item)

Creates a Vertex that contains the specified item.

Parameters
itemthe item the Vertex should contain

Member Function Documentation

◆ addEdge()

template<typename V , typename E >
virtual void repast::Vertex< V, E >::addEdge ( Vertex< V, E > *  other,
boost::shared_ptr< E >  edge,
EdgeType  type 
)
pure virtual

Adds an edge of the specified type between this Vertex and the specified vertex.

Parameters
edgethe edge to add
otherthe other end of the edge
typethe type of edge to add

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.

◆ adjacent()

template<typename V , typename E >
virtual void repast::Vertex< V, E >::adjacent ( std::vector< V * > &  out)
pure virtual

Gets the Vertices adjacent to this Vertex.

Parameters
[out]thevector where the adjacent vectors will be put

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.

◆ edges()

template<typename V , typename E >
virtual void repast::Vertex< V, E >::edges ( EdgeType  type,
std::vector< boost::shared_ptr< E > > &  out 
)
pure virtual

Gets all the edges of the specified type in which this Vertex participates and return them in out.

Parameters
typethe type of edges to get
[out]wherethe edges will be put.

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.

◆ findEdge()

template<typename V , typename E >
virtual boost::shared_ptr<E> repast::Vertex< V, E >::findEdge ( Vertex< V, E > *  other,
EdgeType  type 
)
pure virtual

Finds the edge of the specified type between this Vertex and the specified vertex.

Parameters
otherthe other end of the edge
typethe type of edge to remove
Returns
the found edge, or 0.

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.

◆ inDegree()

template<typename V , typename E >
virtual int repast::Vertex< V, E >::inDegree ( )
pure virtual

Gets the in degree of this Vertex.

Returns
the in degree of this Vertex.

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.

◆ item()

template<typename V , typename E >
boost::shared_ptr<V> repast::Vertex< V, E >::item ( ) const
inline

Gets the item that this Vertex contains.

Returns
the item.

◆ outDegree()

template<typename V , typename E >
virtual int repast::Vertex< V, E >::outDegree ( )
pure virtual

Gets the out degree of this Vertex.

Returns
the out degree of this Vertex.

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.

◆ predecessors()

template<typename V , typename E >
virtual void repast::Vertex< V, E >::predecessors ( std::vector< V * > &  out)
pure virtual

Gets the predecessors of this Vertex.

Parameters
[out]thevector where any predecessors will be put

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.

◆ removeEdge()

template<typename V , typename E >
virtual boost::shared_ptr<E> repast::Vertex< V, E >::removeEdge ( Vertex< V, E > *  other,
EdgeType  type 
)
pure virtual

Removes the edge of the specified type between this Vertex and the specified Vertex.

Parameters
otherthe other end of the edge
typethe type of edge to remove
Returns
the removed edge if such an edge was found, otherwise 0.

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.

◆ successors()

template<typename V , typename E >
virtual void repast::Vertex< V, E >::successors ( std::vector< V * > &  out)
pure virtual

Gets the successors of this Vertex.

Parameters
[out]thevector where any successors will be put

Implemented in repast::DirectedVertex< V, E >, and repast::UndirectedVertex< V, E >.


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