GraphNodeBase< NODEDATA, EDGE > Class Template Reference

#include <graphbase.h>

详细描述

template<typename NODEDATA, typename EDGE>
class maxon::GraphNodeBase< NODEDATA, EDGE >

Basic node template for a graph, reppresent a node with attached strokes pointers list basically an node with an adjacency list.

Template Parameters
NODEDATA 自定义 数据 attched to the node.
EDGE Edge type have to be GraphEdgeBase <this->Type>.

Public Types

typedef GraphNodeBase < NODEDATA, EDGE >  NodeType

公共成员函数

  GraphNodeBase ()
  GraphNodeBase (const NODEDATA &data, 向量 pos= 向量 ())
  ~GraphNodeBase ()
  GraphNodeBase ( GraphNodeBase && src )
Result < void >  CopyFrom (const GraphNodeBase & src )
向量   GetPosition () const
void  SetPosition (const 向量 &pos)
Int   GetEdgesCount () const
Result < EDGE * >  GetEdge ( Int pos) const
Result < NodeType * >  GetNeighbor ( Int pos) const
Result < EDGE * >  FindEdge ( NodeType *otherHand)
Result < void >  AddEdge (EDGE *edge)
Result < void >  DeleteEdge ( Int32 pos)
Result < void >  DeleteEdge (EDGE *edge)
const NODEDATA *  GetData () const
Result < void >  SetData (const NODEDATA &data)
void  Visit ()
void  Unvisit ()
Bool   IsVisited () const
void  重置 ()

Protected Attributes

NODEDATA  _data
向量   _pos
Bool   _visited
BaseArray < EDGE * >  _edges

Member Typedef Documentation

◆  NodeType

typedef GraphNodeBase <NODEDATA, EDGE> NodeType

构造函数 & 析构函数文档编制

◆  GraphNodeBase() [1/3]

GraphNodeBase ( )
explicit

◆  GraphNodeBase() [2/3]

GraphNodeBase ( const NODEDATA &  data ,
向量   pos = Vector()  
)
explicit

◆  ~GraphNodeBase()

~ GraphNodeBase ( )

◆  GraphNodeBase() [3/3]

GraphNodeBase ( GraphNodeBase < NODEDATA, EDGE > &&  src )

成员函数文档编制

◆  CopyFrom()

Result <void> CopyFrom ( const GraphNodeBase < NODEDATA, EDGE > &  src )

◆  GetPosition()

向量 GetPosition ( ) const

Get the Node position.

返回
The Node position.

◆  SetPosition()

void SetPosition ( const 向量 pos )

Set the Node position.

参数
[in] pos The new Node position.

◆  GetEdgesCount()

Int GetEdgesCount ( ) const

Get the edges count for this point.

返回
The PenPoint::EdgeType count.

◆  GetEdge()

Result <EDGE*> GetEdge ( Int   pos ) const

Get the edges at pos in the list.

参数
[in] pos The edge index position.
返回
The PenPoint::EdgeType pointer pos or error if pos is out of bounds.

◆  GetNeighbor()

Result < NodeType *> GetNeighbor ( Int   pos ) const

Get The other hand of the edge at index pos.

参数
[in] pos the edge index.
返回
The node pointer otherwise an error.

◆  FindEdge()

Result <EDGE*> FindEdge ( NodeType otherHand )

Find an edge in between this node and otherHand node.

参数
[in] otherHand The other node which create the edge.
返回
The edge pointer of an error if used nodes does not share any edge.

◆  AddEdge()

Result <void> AddEdge ( EDGE *  edge )

Add a new edges to the point.

参数
[in] edge The edge to add.
返回
OK on success.

◆  DeleteEdge() [1/2]

Result <void> DeleteEdge ( Int32   pos )

Remove the edge at pos.

参数
[in] pos The edge list index.
返回
OK on success.

◆  DeleteEdge() [2/2]

Result <void> DeleteEdge ( EDGE *  edge )

Remove edge form the list.

参数
[in] edge The edge to be removed.
返回
OK on success.

◆  GetData()

const NODEDATA* GetData ( ) const

Get a pointer to user data.

返回
The user data pointer.

◆  SetData()

Result <void> SetData ( const NODEDATA &  data )

Replace current user data with the passed one, data is duplicated.

参数
[in] data The new data to be used.
返回
OK on success.

◆  Visit()

void Visit ( )

Process this node.

◆  Unvisit()

void Unvisit ( )

Reset the processing status.

◆  IsVisited()

Bool IsVisited ( ) const

Get the processing status.

返回
The processing status.

◆  Reset()

void Reset ( )

Free memory and reset all values, could be extended for each implementation.

Member Data Documentation

◆  _data

NODEDATA _data protected

◆  _pos

向量 _pos
protected

◆  _visited

Bool _visited
protected

◆  _edges

BaseArray <EDGE*> _edges
protected