SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes > Class Template Reference

`#include <slikenet/DS_WeightedGraph.h>`

## Classes

struct | NodeAndParent

## Public Member Functions

| WeightedGraph ()
| ~WeightedGraph ()
| WeightedGraph (const WeightedGraph &original_copy)
WeightedGraph & | operator= (const WeightedGraph &original_copy)
void | AddNode (const node_type &node)
void | RemoveNode (const node_type &node)
void | AddConnection (const node_type &node1, const node_type &node2, weight_type weight)
void | RemoveConnection (const node_type &node1, const node_type &node2)
bool | HasConnection (const node_type &node1, const node_type &node2)
void | Print (void)
void | Clear (void)
bool | GetShortestPath (DataStructures::List< node_type > &path, node_type startNode, node_type endNode, weight_type INFINITE_WEIGHT)
bool | GetSpanningTree (DataStructures::Tree< node_type > &outTree, DataStructures::List< node_type > *inputNodes, node_type startNode, weight_type INFINITE_WEIGHT)
unsigned | GetNodeCount (void) const
unsigned | GetConnectionCount (unsigned nodeIndex) const
void | GetConnectionAtIndex (unsigned nodeIndex, unsigned connectionIndex, node_type &outNode, weight_type &outWeight) const
node_type | GetNodeAtIndex (unsigned nodeIndex) const

## Static Public Member Functions

static void | IMPLEMENT_DEFAULT_COMPARISON (void)

## Protected Member Functions

void | ClearDijkstra (void)
void | GenerateDisjktraMatrix (node_type startNode, weight_type INFINITE_WEIGHT)

## Protected Attributes

DataStructures::Map< node_type, DataStructures::Map< node_type, weight_type > * > | adjacencyLists
bool | isValidPath
node_type | rootNode
DataStructures::OrderedList < node_type, node_type > | costMatrixIndices
weight_type * | costMatrix
node_type * | leastNodeArray

## Detailed Description

### template<class node_type, class weight_type, bool allow_unlinkedNodes>
class DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >

Definition at line 46 of file DS_WeightedGraph.h.

## Class Documentation

struct DataStructures::WeightedGraph::NodeAndParent

### template<class node_type, class weight_type, bool allow_unlinkedNodes>
struct DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::NodeAndParent

Definition at line 86 of file DS_WeightedGraph.h.

Class Members
Tree< node_type > * | node |
Tree< node_type > * | parent |

## Constructor & Destructor Documentation

template<class node_type , class weight_type , bool allow_unlinkedNodes>

DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::WeightedGraph | ( |  | ) |

Definition at line 94 of file DS_WeightedGraph.h.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::~WeightedGraph | ( |  | ) |

Definition at line 101 of file DS_WeightedGraph.h.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::WeightedGraph | ( | const WeightedGraph< node_type, weight_type, allow_unlinkedNodes > & | original_copy | ) |

Definition at line 107 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::adjacencyLists, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::costMatrix, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::costMatrixIndices, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::isValidPath, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::leastNodeArray, and DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::rootNode.

## Member Function Documentation

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::AddConnection | ( | const node_type & | node1,
|  | const node_type & | node2,
|  | weight_type | weight
| ) |  |

Definition at line 186 of file DS_WeightedGraph.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GetSpanningTree().

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::AddNode | ( | const node_type & | node | ) |

Definition at line 143 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, and SLNet::OP_NEW().

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::Clear | ( | void |  | ) |

Definition at line 220 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, and SLNet::OP_DELETE().

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::ClearDijkstra | ( | void |  | ) |

protected

Definition at line 506 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, and SLNet::OP_DELETE_ARRAY().

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GenerateDisjktraMatrix | ( | node_type | startNode,
|  | weight_type | INFINITE_WEIGHT
| ) |  |

protected

Definition at line 398 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, DataStructures::Heap< weight_type, data_type, isMaxHeap >::Clear(), DataStructures::Map< key_type, data_type, key_comparison_func >::Delete(), DataStructures::Map< key_type, data_type, key_comparison_func >::Get(), DataStructures::Map< key_type, data_type, key_comparison_func >::GetIndexAtKey(), DataStructures::Map< key_type, data_type, key_comparison_func >::GetKeyAtIndex(), DataStructures::Heap< weight_type, data_type, isMaxHeap >::PeekWeight(), DataStructures::Heap< weight_type, data_type, isMaxHeap >::Pop(), DataStructures::Heap< weight_type, data_type, isMaxHeap >::Push(), DataStructures::Map< key_type, data_type, key_comparison_func >::Set(), DataStructures::Heap< weight_type, data_type, isMaxHeap >::Size(), and DataStructures::Map< key_type, data_type, key_comparison_func >::Size().

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GetConnectionAtIndex | ( | unsigned | nodeIndex,
|  | unsigned | connectionIndex,
|  | node_type & | outNode,
|  | weight_type & | outWeight
| ) |  | const

Definition at line 325 of file DS_WeightedGraph.h.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

unsigned DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GetConnectionCount | ( | unsigned | nodeIndex | ) | const

Definition at line 319 of file DS_WeightedGraph.h.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

node_type DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GetNodeAtIndex | ( | unsigned | nodeIndex | ) | const

Definition at line 307 of file DS_WeightedGraph.h.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

unsigned DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GetNodeCount | ( | void |  | ) | const

Definition at line 313 of file DS_WeightedGraph.h.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

bool DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GetShortestPath | ( | DataStructures::List< node_type > & | path,
|  | node_type | startNode,
|  | node_type | endNode,
|  | weight_type | INFINITE_WEIGHT
| ) |  |

Definition at line 231 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, DataStructures::List< list_type >::Clear(), DataStructures::List< list_type >::Insert(), DataStructures::Queue< queue_type >::IsEmpty(), DataStructures::Queue< queue_type >::Pop(), DataStructures::Queue< queue_type >::PushAtHead(), and DataStructures::Queue< queue_type >::Size().

template<class node_type , class weight_type , bool allow_unlinkedNodes>

bool DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GetSpanningTree | ( | DataStructures::Tree< node_type > & | outTree,
|  | DataStructures::List< node_type > * | inputNodes,
|  | node_type | startNode,
|  | weight_type | INFINITE_WEIGHT
| ) |  |

Definition at line 332 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::AddConnection(), DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::adjacencyLists, DataStructures::Tree< TreeType >::children, DataStructures::Tree< TreeType >::data, DataStructures::Tree< TreeType >::DeleteDecendants(), DataStructures::Map< key_type, data_type, key_comparison_func >::Get(), DataStructures::Map< key_type, data_type, key_comparison_func >::GetKeyAtIndex(), DataStructures::Map< key_type, data_type, key_comparison_func >::Has(), DataStructures::List< list_type >::Insert(), DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::NodeAndParent::node, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::NodeAndParent::parent, DataStructures::Queue< queue_type >::Pop(), DataStructures::Queue< queue_type >::Push(), DataStructures::Queue< queue_type >::Size(), DataStructures::Map< key_type, data_type, key_comparison_func >::Size(), and DataStructures::List< list_type >::Size().

template<class node_type , class weight_type , bool allow_unlinkedNodes>

bool DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::HasConnection | ( | const node_type & | node1,
|  | const node_type & | node2
| ) |  |

Definition at line 176 of file DS_WeightedGraph.h.

template<class node_type, class weight_type, bool allow_unlinkedNodes>

static void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::IMPLEMENT_DEFAULT_COMPARISON | ( | void |  | ) |

inlinestatic

Definition at line 49 of file DS_WeightedGraph.h.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

WeightedGraph< node_type, weight_type, allow_unlinkedNodes > & DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::operator= | ( | const WeightedGraph< node_type, weight_type, allow_unlinkedNodes > & | original_copy | ) |

Definition at line 124 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::adjacencyLists, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::costMatrix, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::costMatrixIndices, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::isValidPath, DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::leastNodeArray, and DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::rootNode.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::Print | ( | void |  | ) |

Definition at line 518 of file DS_WeightedGraph.h.

References RAKNET_DEBUG_PRINTF.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::RemoveConnection | ( | const node_type & | node1,
|  | const node_type & | node2
| ) |  |

Definition at line 200 of file DS_WeightedGraph.h.

template<class node_type , class weight_type , bool allow_unlinkedNodes>

void DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::RemoveNode | ( | const node_type & | node | ) |

Definition at line 149 of file DS_WeightedGraph.h.

References _FILE_AND_LINE_, SLNet::OP_DELETE(), DataStructures::Queue< queue_type >::Pop(), DataStructures::Queue< queue_type >::Push(), and DataStructures::Queue< queue_type >::Size().

## Member Data Documentation

template<class node_type, class weight_type, bool allow_unlinkedNodes>

DataStructures::Map<node_type, DataStructures::Map<node_type, weight_type> *> DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::adjacencyLists

protected

Definition at line 73 of file DS_WeightedGraph.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GetSpanningTree(), DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::operator=(), and DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::WeightedGraph().

template<class node_type, class weight_type, bool allow_unlinkedNodes>

weight_type* DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::costMatrix

protected

Definition at line 82 of file DS_WeightedGraph.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::operator=(), and DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::WeightedGraph().

template<class node_type, class weight_type, bool allow_unlinkedNodes>

DataStructures::OrderedList<node_type, node_type> DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::costMatrixIndices

protected

Definition at line 81 of file DS_WeightedGraph.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::operator=(), and DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::WeightedGraph().

template<class node_type, class weight_type, bool allow_unlinkedNodes>

bool DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::isValidPath

protected

Definition at line 79 of file DS_WeightedGraph.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::operator=(), and DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::WeightedGraph().

template<class node_type, class weight_type, bool allow_unlinkedNodes>

node_type* DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::leastNodeArray

protected

Definition at line 83 of file DS_WeightedGraph.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::operator=(), and DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::WeightedGraph().

template<class node_type, class weight_type, bool allow_unlinkedNodes>

node_type DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::rootNode

protected

Definition at line 80 of file DS_WeightedGraph.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::operator=(), and DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::WeightedGraph().

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

- Source/include/slikenet/DS_WeightedGraph.h