Public Member Functions | Private Member Functions | Private Attributes
beliefstate::Node Class Reference

Class describing a single node entity. More...

#include <Node.h>

List of all members.

Public Member Functions

CKeyValuePairaddDescriptionListItem (std::string strDomain, std::string strPrefix)
void addDesignator (std::string strType, std::list< CKeyValuePair * > lstDescription, std::string strUniqueID, std::string strAnnotation="")
std::string addFailure (std::string strCondition, std::string strTimestamp)
std::string addImage (std::string strOrigin, std::string strFilename, std::string strTimestamp)
std::string addObject (std::list< CKeyValuePair * > lstDescription)
void addSubnode (Node *ndAdd)
 Add a sub-node to this node.
std::string catchFailure (std::string strFailureID, Node *ndEmitter, std::string strTimestamp)
std::list< CKeyValuePair * > description ()
 Returns the node's current description.
NodeemitterForCaughtFailure (std::string strFailureID, std::string strEmitterID, std::string strTimestamp)
void ensureProperty (std::string strKey, std::string strDefaultValue)
bool hasFailures ()
int highestID ()
int id ()
bool includesUniqueID (std::string strUniqueID)
CKeyValuePairmetaInformation ()
 Node ()
 Constructur for generating an empty node.
 Node (std::string strTitle)
 Constructor for generating a title'd node.
 Node (std::list< CKeyValuePair * > lstDescription)
 Constructur for generating a node given an existing description.
Nodeparent ()
 Return this node's parent node.
bool prematurelyEnded ()
NodepreviousNode ()
NoderelativeWithID (int nID, bool bIgnoreSelf=false)
void removeCaughtFailure (std::string strFailureID)
void setDescription (std::list< CKeyValuePair * > lstDescription)
 Sets this node's description.
void setID (int nID)
void setParent (Node *ndParent)
 Set this node's pointer to its parent node.
void setPrematurelyEnded (bool bPrematurelyEnded)
void setSuccess (bool bSuccess)
void setTitle (std::string strTitle)
 Set this node's title.
void setUniqueID (std::string strUniqueID)
std::list< Node * > subnodes ()
 Return the list of sub-nodes for this node.
bool success ()
std::string title ()
 Return this node's title.
std::string uniqueID ()
 ~Node ()
 Destructor, cleaning up the internal node data.

Private Member Functions

void clearDescription ()
 Deletes the internal description cache for this node.
void clearSubnodes ()
 Deletes the internal sub-node references for this node.
void init ()
 Central initialization method for the Node class.

Private Attributes

CKeyValuePairm_ckvpMetaInformation
 This nide's meta information.
std::list< std::pair
< std::string, Node * > > 
m_lstCaughtFailures
 List of failures caught by this node, and their emitters.
std::list< CKeyValuePair * > m_lstDescription
 List of description key/value-pairs.
std::list< Node * > m_lstSubnodes
 List of this node's sub-nodes.
Nodem_ndParent
 Pointer to the node's parent node instance.
int m_nID
 Internal counter ID.
std::string m_strTitle
 The string title of the current node.
std::string m_strUniqueID
 Unique ID for this node.

Detailed Description

Class describing a single node entity.

Nodes are the basic building block of task trees. They can have (meta-)properties, a title, a unique ID, and sub nodes. They also know about their parent node to ease tree processing.

Definition at line 57 of file Node.h.


Constructor & Destructor Documentation

Constructur for generating an empty node.

Definition at line 44 of file Node.cpp.

beliefstate::Node::Node ( std::string  strTitle)

Constructor for generating a title'd node.

Definition at line 48 of file Node.cpp.

beliefstate::Node::Node ( std::list< CKeyValuePair * >  lstDescription)

Constructur for generating a node given an existing description.

Definition at line 53 of file Node.cpp.

Destructor, cleaning up the internal node data.

Definition at line 59 of file Node.cpp.


Member Function Documentation

CKeyValuePair * beliefstate::Node::addDescriptionListItem ( std::string  strDomain,
std::string  strPrefix 
)

Definition at line 189 of file Node.cpp.

void beliefstate::Node::addDesignator ( std::string  strType,
std::list< CKeyValuePair * >  lstDescription,
std::string  strUniqueID,
std::string  strAnnotation = "" 
)

Definition at line 291 of file Node.cpp.

std::string beliefstate::Node::addFailure ( std::string  strCondition,
std::string  strTimestamp 
)

Definition at line 219 of file Node.cpp.

std::string beliefstate::Node::addImage ( std::string  strOrigin,
std::string  strFilename,
std::string  strTimestamp 
)

Definition at line 199 of file Node.cpp.

std::string beliefstate::Node::addObject ( std::list< CKeyValuePair * >  lstDescription)

Definition at line 209 of file Node.cpp.

Add a sub-node to this node.

To build up a tree structure, nodes can hold sub-nodes to reflect branching. This function adds a Node instance to the sub-branches of this node.

Parameters:
ndAddThe node instance to add as branch

Definition at line 105 of file Node.cpp.

std::string beliefstate::Node::catchFailure ( std::string  strFailureID,
Node ndEmitter,
std::string  strTimestamp 
)

Definition at line 228 of file Node.cpp.

Deletes the internal description cache for this node.

This is a clean-up method and is called by the system automatically.

Definition at line 77 of file Node.cpp.

Deletes the internal sub-node references for this node.

This is a clean-up method and is called by the system automatically.

Definition at line 85 of file Node.cpp.

Returns the node's current description.

Returns:
List of key/value-pairs denoting the node's current description fields.

Definition at line 93 of file Node.cpp.

Node * beliefstate::Node::emitterForCaughtFailure ( std::string  strFailureID,
std::string  strEmitterID,
std::string  strTimestamp 
)

Definition at line 268 of file Node.cpp.

void beliefstate::Node::ensureProperty ( std::string  strKey,
std::string  strDefaultValue 
)

Definition at line 332 of file Node.cpp.

Definition at line 281 of file Node.cpp.

Definition at line 151 of file Node.cpp.

Definition at line 147 of file Node.cpp.

bool beliefstate::Node::includesUniqueID ( std::string  strUniqueID)

Definition at line 122 of file Node.cpp.

void beliefstate::Node::init ( ) [private]

Central initialization method for the Node class.

Definition at line 64 of file Node.cpp.

Definition at line 139 of file Node.cpp.

Return this node's parent node.

Returns:
The pointer to this node's parent node instance

Definition at line 165 of file Node.cpp.

Definition at line 185 of file Node.cpp.

Definition at line 312 of file Node.cpp.

Node * beliefstate::Node::relativeWithID ( int  nID,
bool  bIgnoreSelf = false 
)

Definition at line 169 of file Node.cpp.

void beliefstate::Node::removeCaughtFailure ( std::string  strFailureID)

Definition at line 243 of file Node.cpp.

void beliefstate::Node::setDescription ( std::list< CKeyValuePair * >  lstDescription)

Sets this node's description.

The formerly present description is replaced by the one given as lstDescription.

Parameters:
lstDescriptionThe description to replace the current one with

Definition at line 71 of file Node.cpp.

void beliefstate::Node::setID ( int  nID)

Definition at line 143 of file Node.cpp.

void beliefstate::Node::setParent ( Node ndParent)

Set this node's pointer to its parent node.

Parameters:
ndParentThe node to set as this node's parent instance

Definition at line 161 of file Node.cpp.

void beliefstate::Node::setPrematurelyEnded ( bool  bPrematurelyEnded)

Definition at line 181 of file Node.cpp.

void beliefstate::Node::setSuccess ( bool  bSuccess)

Definition at line 304 of file Node.cpp.

void beliefstate::Node::setTitle ( std::string  strTitle)

Set this node's title.

The (string) title of a node can for example be its task- or goal-context.

Parameters:
strTitleThe title to assign to this node

Definition at line 97 of file Node.cpp.

void beliefstate::Node::setUniqueID ( std::string  strUniqueID)

Definition at line 114 of file Node.cpp.

std::list< Node * > beliefstate::Node::subnodes ( )

Return the list of sub-nodes for this node.

Returns:
List of Node instances that are held as branching nodes for this Node instance

Definition at line 110 of file Node.cpp.

Definition at line 308 of file Node.cpp.

std::string beliefstate::Node::title ( )

Return this node's title.

Returns:
The node's current title string

Definition at line 101 of file Node.cpp.

std::string beliefstate::Node::uniqueID ( )

Definition at line 118 of file Node.cpp.


Member Data Documentation

This nide's meta information.

This meta-information includes when a node context was started and ended (timestamps), what its success value was, and similar meta-information. This is automatically set by the system.

Definition at line 91 of file Node.h.

std::list< std::pair<std::string, Node*> > beliefstate::Node::m_lstCaughtFailures [private]

List of failures caught by this node, and their emitters.

Nodes can act as failure handling nodes. When the external plan system signals that a node caught a formerly thrown failure, the respective emitter and the failure type are denoted here.

Definition at line 98 of file Node.h.

List of description key/value-pairs.

This description is information set by the external system that triggers logging mechanisms. This is custom data and its fields can be set via the designator interface.

Definition at line 83 of file Node.h.

std::list<Node*> beliefstate::Node::m_lstSubnodes [private]

List of this node's sub-nodes.

Definition at line 85 of file Node.h.

Pointer to the node's parent node instance.

Definition at line 77 of file Node.h.

int beliefstate::Node::m_nID [private]

Internal counter ID.

This represents this node's identity during the current run of the system. This is a volatile value and should not be used for external node reference.

Definition at line 74 of file Node.h.

std::string beliefstate::Node::m_strTitle [private]

The string title of the current node.

Mostly representing its task- or goal-context.

Definition at line 62 of file Node.h.

std::string beliefstate::Node::m_strUniqueID [private]

Unique ID for this node.

Mostly important when exporting tree data (such as .owl files) in order to give every individual node a unique identity. Is set automatically by the system.

Definition at line 68 of file Node.h.


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


beliefstate
Author(s): Jan Winkler
autogenerated on Sun Oct 5 2014 22:30:16