Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
TreeNode Class Reference

TreeNode handles and manipulates the activity assessment nodes. More...

Public Member Functions

QString getNodeId ()
 Returns the ID of this node. More...
 
QString getNodeName ()
 Returns the name of this node. More...
 
QString getNodeValue ()
 Returns the value of this node. More...
 
TreeNode getParentNode ()
 Returns the parent node of this node. More...
 
int getChildCount ()
 Returns the number of child nodes for this node. More...
 
ActivityCheckType getCheckType ()
 Returns the checktype of this node. More...
 
TreeNode getChildNodeAt (int)
 Returns the child node at the specified index of this node. More...
 
TreeNode getChildNodeBy (QString)
 Returns the child node with the specified ID of this node. More...
 
TreeNode getCheckOnlyTree ()
 Returns a tree with only half or full checktype nodes. More...
 
QString getIncorrectFeedback ()
 Returns the incorrect feedback of this node. More...
 
void setIncorrectFeedback (QString)
 Sets the incorrect feedback for this node. More...
 
int getLeafCount ()
 Returns the total number of leaf nodes for this node. More...
 
int getCheckLeafCount ()
 Returns the number of full checktype leaf nodes. More...
 
int getTotalLeafPoints ()
 Returns the total points of leaf nodes. More...
 
bool isVariableEnabled ()
 Returns true if this node is variable enabled, otherwise false. More...
 
QString getVariableName ()
 Returns the variable name of this node. More...
 
QString getVariableToString ()
 Returns the variable name if the value type of the node is entire range, otherwise the value of this node. More...
 
void setCheck (bool)
 Checks or unchecks this node. More...
 
ComparatorClass getComparatorClass ()
 Returns the comparator class. More...
 
void setNodeName (QString)
 Sets the node of this node. More...
 
void setNodeValue (QString)
 Sets the value of this node. More...
 
int getLeafCountByComponent (QString)
 Returns the number of leaves with the specified component name (includes all children). More...
 
int getCheckLeafCountByComponent (QString)
 Returns the number of checked leaves with the specified component name (including all children). More...
 
int getCheckLeafPointsByComponent (QString)
 Returns the total points of checked leaves with the specified component name (including all children). More...
 
int getTotalLeafPointsByComponent (QString)
 Returns the total points of leaves with the specified component name (including all children). More...
 
int getCheckLeafPoints ()
 Returns the total points of all nodes that have checks, including all children. More...
 
pair< QString, QString > getCompPointPair ()
 Returns the component and points as a pair associated with only this node. There can be many components and points per node. More...
 
void checkChanged (QString, QString, int)
 This event is emitted when the checktype of a node changes. More...
 
TreeNode getChildNodeByFullId (QString)
 Returns the child node with the specified full ID of this node. More...
 
TreeNode addChildNode (ComparatorClass, QString, QString, QString, bool)
 Create a new child node and add it to the tree. More...
 

Detailed Description

TreeNode handles and manipulates the activity assessment nodes.

Member Function Documentation

◆ addChildNode()

TreeNode TreeNode::addChildNode ( ComparatorClass  ,
QString  ,
QString  ,
QString  ,
bool   
)

Create a new child node and add it to the tree.

Parameters
classType,enum<ComparatorClass>eCompClass_Ip = 0, eCompClass_Routing = 1, eCompClass_Acl = 2, eCompClass_Nat = 3, eCompClass_Physical = 4, eCompClass_Switching = 5, eCompClass_Connectivity = 6, eCompClass_Logical = 7, eCompClass_All = 8, eCompClass_Encircling_Head = 9, eCompClass_Encircling_Sub = 10
nodeName,thename of the node.
nodeId,theid of the node.
nodeValue,thevalue of the node.
bVariableEnabled,bool-trueif variable is enabled and false if it's not on this node
Returns
TreeNode, the child node that was newly created

◆ checkChanged()

void TreeNode::checkChanged ( QString  ,
QString  ,
int   
)

This event is emitted when the checktype of a node changes.

  • nodeName, the name of the node.
  • nodePath, the path of the node.
  • checkType, the checktype of the node.

IPC event.

◆ getCheckLeafCount()

int TreeNode::getCheckLeafCount ( )

Returns the number of full checktype leaf nodes.

Returns
int, the number of full checktype leaf nodes.

◆ getCheckLeafCountByComponent()

int TreeNode::getCheckLeafCountByComponent ( QString  )

Returns the number of checked leaves with the specified component name (including all children).

Parameters
component,thename of the component of interest.
Returns
int, the number of checked leaves with the specified component name (including all children).

◆ getCheckLeafPoints()

int TreeNode::getCheckLeafPoints ( )

Returns the total points of all nodes that have checks, including all children.

Returns
int, the total points of all nodes that have checks, including all children.

◆ getCheckLeafPointsByComponent()

int TreeNode::getCheckLeafPointsByComponent ( QString  )

Returns the total points of checked leaves with the specified component name (including all children).

Parameters
component,thename of the component of interest.
Returns
int, the total points of checked leaves with the specified component name (including all children).

◆ getCheckOnlyTree()

TreeNode TreeNode::getCheckOnlyTree ( )

Returns a tree with only half or full checktype nodes.

Returns
TreeNode, the TreeNode object with only half or full checktype nodes.

◆ getCheckType()

ActivityCheckType TreeNode::getCheckType ( )

Returns the checktype of this node.

Returns
int, the checktype for this node. Checktypes: eCheckTypeBlank = 0, eCheckTypeHalf = 1, eCheckTypeFull = 2
Remarks
Full is correct, blank is incorrect, and half means there are correct and incorrect children.

◆ getChildCount()

int TreeNode::getChildCount ( )

Returns the number of child nodes for this node.

Returns
int, the number of child nodes for this node.

◆ getChildNodeAt()

TreeNode TreeNode::getChildNodeAt ( int  )

Returns the child node at the specified index of this node.

Parameters
index,theindex of the child node of interest.
Returns
TreeNode, the child node at the specified index of this node.

◆ getChildNodeBy()

TreeNode TreeNode::getChildNodeBy ( QString  )

Returns the child node with the specified ID of this node.

Parameters
ID,theID of the child node of interest.
Returns
TreeNode, the child node with the specified ID of this node.

◆ getChildNodeByFullId()

TreeNode TreeNode::getChildNodeByFullId ( QString  )

Returns the child node with the specified full ID of this node.

Parameters
ID,thefull ID of the child node of interest.
Returns
TreeNode, the child node with the specified full ID of this node.

◆ getComparatorClass()

ComparatorClass TreeNode::getComparatorClass ( )

Returns the comparator class.

Returns
enum<ComparatorClass>, the comparator class. eCompClass_Ip = 0, eCompClass_Routing = 1, eCompClass_Acl = 2, eCompClass_Nat = 3, eCompClass_Physical = 4, eCompClass_Switching = 5, eCompClass_Connectivity = 6, eCompClass_Logical = 7, eCompClass_All = 8, eCompClass_Encircling_Head = 9, eCompClass_Encircling_Sub = 10

◆ getCompPointPair()

pair< QString, QString > TreeNode::getCompPointPair ( )

Returns the component and points as a pair associated with only this node. There can be many components and points per node.

Returns
pair<QString, QString>, the list of comma-separated components and list of comma-separated points.

◆ getIncorrectFeedback()

QString TreeNode::getIncorrectFeedback ( )

Returns the incorrect feedback of this node.

Returns
QString, the incorrect feedback of this node.

◆ getLeafCount()

int TreeNode::getLeafCount ( )

Returns the total number of leaf nodes for this node.

Returns
int, the total number of leaf nodes for this node.

◆ getLeafCountByComponent()

int TreeNode::getLeafCountByComponent ( QString  )

Returns the number of leaves with the specified component name (includes all children).

Parameters
component,thename of the component of interest.
Returns
int, the number of leaves with the specified component name (includes all children).

◆ getNodeId()

QString TreeNode::getNodeId ( )

Returns the ID of this node.

Returns
QString, the ID of this node.

◆ getNodeName()

QString TreeNode::getNodeName ( )

Returns the name of this node.

Returns
QString, the name of this node.

◆ getNodeValue()

QString TreeNode::getNodeValue ( )

Returns the value of this node.

Returns
QString, the value of this node.

◆ getParentNode()

TreeNode TreeNode::getParentNode ( )

Returns the parent node of this node.

Returns
TreeNode, the TreeNode object of the parent node of this node.

◆ getTotalLeafPoints()

int TreeNode::getTotalLeafPoints ( )

Returns the total points of leaf nodes.

Returns
int, the total points of leaf nodes.

◆ getTotalLeafPointsByComponent()

int TreeNode::getTotalLeafPointsByComponent ( QString  )

Returns the total points of leaves with the specified component name (including all children).

Parameters
component,thename of the component of interest.
Returns
int, the total points of leaves with the specified component name (including all children).

◆ getVariableName()

QString TreeNode::getVariableName ( )

Returns the variable name of this node.

Returns
QString, the variable name of this node.

◆ getVariableToString()

QString TreeNode::getVariableToString ( )

Returns the variable name if the value type of the node is entire range, otherwise the value of this node.

Returns
QString, the variable name if the value type of the node is entire range, otherwise the value of this node.

◆ isVariableEnabled()

bool TreeNode::isVariableEnabled ( )

Returns true if this node is variable enabled, otherwise false.

Returns
bool, true if this node is variable enabled, otherwise false.

◆ setCheck()

void TreeNode::setCheck ( bool  )

Checks or unchecks this node.

Parameters
bCheck,trueto check this node, false to uncheck it.

◆ setIncorrectFeedback()

void TreeNode::setIncorrectFeedback ( QString  )

Sets the incorrect feedback for this node.

Parameters
feedbackStr,theincorrect feedback for this node.

◆ setNodeName()

void TreeNode::setNodeName ( QString  )

Sets the node of this node.

Parameters
name,thenode of this node.

◆ setNodeValue()

void TreeNode::setNodeValue ( QString  )

Sets the value of this node.

Parameters
value,thevalue of this node.

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