Markopy
Utilizing Markov Models for brute forcing attacks
Markov::Edge< NodeStorageType > Class Template Reference

Edge class used to link nodes in the model together. More...

#include <edge.h>

Collaboration diagram for Markov::Edge< NodeStorageType >:

Public Member Functions

 Edge ()
 Default constructor. More...
 
 Edge (Node< NodeStorageType > *_left, Node< NodeStorageType > *_right)
 Constructor. Initialize edge with given RightNode and LeftNode. More...
 
void AdjustEdge (long int offset)
 Adjust the edge EdgeWeight with offset. Adds the offset parameter to the edge EdgeWeight. More...
 
Node< NodeStorageType > * TraverseNode ()
 Traverse this edge to RightNode. More...
 
void SetLeftEdge (Node< NodeStorageType > *)
 Set LeftNode of this edge. More...
 
void SetRightEdge (Node< NodeStorageType > *)
 Set RightNode of this edge. More...
 
uint64_t EdgeWeight ()
 return edge's EdgeWeight. More...
 
Node< NodeStorageType > * LeftNode ()
 return edge's LeftNode More...
 
Node< NodeStorageType > * RightNode ()
 return edge's RightNode More...
 

Private Attributes

Node< NodeStorageType > * _left
 source node More...
 
Node< NodeStorageType > * _right
 target node More...
 
long int _weight
 Edge Edge Weight. More...
 

Detailed Description

template<typename NodeStorageType>
class Markov::Edge< NodeStorageType >

Edge class used to link nodes in the model together.

Has LeftNode, RightNode, and EdgeWeight of the edge. Edges are UNIDIRECTIONAL in this model. They can only be traversed LeftNode to RightNode.

Definition at line 23 of file edge.h.

Constructor & Destructor Documentation

◆ Edge() [1/2]

template<typename NodeStorageType >
Markov::Edge< NodeStorageType >::Edge

Default constructor.

Definition at line 123 of file edge.h.

123  {
124  this->_left = NULL;
125  this->_right = NULL;
126  this->_weight = 0;
127 }
Node< NodeStorageType > * _left
source node
Definition: edge.h:105
Node< NodeStorageType > * _right
target node
Definition: edge.h:110
long int _weight
Edge Edge Weight.
Definition: edge.h:115

◆ Edge() [2/2]

template<typename NodeStorageType >
Markov::Edge< NodeStorageType >::Edge ( Markov::Node< NodeStorageType > *  _left,
Markov::Node< NodeStorageType > *  _right 
)

Constructor. Initialize edge with given RightNode and LeftNode.

Parameters
_left- Left node of this edge.
_right- Right node of this edge.

Example Use: Construct edge

Edge class used to link nodes in the model together.
Definition: edge.h:23
A node class that for the vertices of model. Connected with eachother using Edge.
Definition: node.h:24

Definition at line 130 of file edge.h.

130  {
131  this->_left = _left;
132  this->_right = _right;
133  this->_weight = 0;
134 }

Member Function Documentation

◆ AdjustEdge()

template<typename NodeStorageType >
void Markov::Edge< NodeStorageType >::AdjustEdge ( long int  offset)

Adjust the edge EdgeWeight with offset. Adds the offset parameter to the edge EdgeWeight.

Parameters
offset- NodeValue to be added to the EdgeWeight

Example Use: Construct edge

e1->AdjustEdge(25);
void AdjustEdge(long int offset)
Adjust the edge EdgeWeight with offset. Adds the offset parameter to the edge EdgeWeight.
Definition: edge.h:137

Definition at line 137 of file edge.h.

137  {
138  this->_weight += offset;
139  this->LeftNode()->UpdateTotalVerticeWeight(offset);
140 }
Node< NodeStorageType > * LeftNode()
return edge's LeftNode
Definition: edge.h:165
void UpdateTotalVerticeWeight(long int offset)
Change total weights with offset.
Definition: node.h:267

Referenced by Markov::API::MarkovPasswords::Buff().

Here is the caller graph for this function:

◆ EdgeWeight()

template<typename NodeStorageType >
uint64_t Markov::Edge< NodeStorageType >::EdgeWeight
inline

return edge's EdgeWeight.

Returns
edge's EdgeWeight.

Definition at line 160 of file edge.h.

160  {
161  return this->_weight;
162 }

Referenced by Markov::API::MarkovPasswords::Buff(), and Markov::API::ModelMatrix::ConstructMatrix().

Here is the caller graph for this function:

◆ LeftNode()

template<typename NodeStorageType >
Markov::Node< NodeStorageType > * Markov::Edge< NodeStorageType >::LeftNode

return edge's LeftNode

Returns
edge's LeftNode.

Definition at line 165 of file edge.h.

165  {
166  return this->_left;
167 }

◆ RightNode()

template<typename NodeStorageType >
Markov::Node< NodeStorageType > * Markov::Edge< NodeStorageType >::RightNode
inline

return edge's RightNode

Returns
edge's RightNode.

Definition at line 170 of file edge.h.

170  {
171  return this->_right;
172 }

Referenced by Markov::API::ModelMatrix::ConstructMatrix().

Here is the caller graph for this function:

◆ SetLeftEdge()

template<typename NodeStorageType >
void Markov::Edge< NodeStorageType >::SetLeftEdge ( Markov::Node< NodeStorageType > *  n)

Set LeftNode of this edge.

Parameters
node- Node to be linked with.

Definition at line 150 of file edge.h.

150  {
151  this->_left = n;
152 }

◆ SetRightEdge()

template<typename NodeStorageType >
void Markov::Edge< NodeStorageType >::SetRightEdge ( Markov::Node< NodeStorageType > *  n)

Set RightNode of this edge.

Parameters
node- Node to be linked with.

Definition at line 155 of file edge.h.

155  {
156  this->_right = n;
157 }

◆ TraverseNode()

template<typename NodeStorageType >
Markov::Node< NodeStorageType > * Markov::Edge< NodeStorageType >::TraverseNode
inline

Traverse this edge to RightNode.

Returns
Right node. If this is a terminator node, return NULL

Example Use: Traverse a node

Definition at line 143 of file edge.h.

143  {
144  if (this->RightNode()->NodeValue() == 0xff) //terminator node
145  return NULL;
146  return _right;
147 }
Node< NodeStorageType > * RightNode()
return edge's RightNode
Definition: edge.h:170

References Markov::Edge< NodeStorageType >::_right.

Member Data Documentation

◆ _left

template<typename NodeStorageType >
Node<NodeStorageType>* Markov::Edge< NodeStorageType >::_left
private

source node

Definition at line 105 of file edge.h.

◆ _right

template<typename NodeStorageType >
Node<NodeStorageType>* Markov::Edge< NodeStorageType >::_right
private

target node

Definition at line 110 of file edge.h.

Referenced by Markov::Edge< NodeStorageType >::TraverseNode().

◆ _weight

template<typename NodeStorageType >
long int Markov::Edge< NodeStorageType >::_weight
private

Edge Edge Weight.

Definition at line 115 of file edge.h.


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