Sequence Chart Studio  svn HEAD revision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DFSBHMscTraverser Class Reference

#include <dfsb_hmsc_traverser.h>

Inheritance diagram for DFSBHMscTraverser:
Inheritance graph
Collaboration diagram for DFSBHMscTraverser:
Collaboration graph

Public Member Functions

 DFSBHMscTraverser (const std::string &color_attribute="dfsb:color")
 
virtual ~DFSBHMscTraverser ()
 
virtual void traverse (HMscPtr hmsc)
 
virtual void traverse (HMscNode *node, bool cleanup=true)
 
virtual void cleanup_traversing_attributes ()
 
const MscElementPListget_reached_elements ()
 
- Public Member Functions inherited from DFSListenersContainer
void add_node_finished_listener (NodeFinishedListenerP l)
 
void remove_node_finished_listeners ()
 
void add_white_node_found_listener (WhiteNodeFoundListenerP l)
 
void remove_white_node_found_listeners ()
 
void add_gray_node_found_listener (GrayNodeFoundListenerP l)
 
void remove_gray_node_found_listeners ()
 
void add_black_node_found_listener (BlackNodeFoundListenerP l)
 
void remove_black_node_found_listeners ()
 
void remove_all_listeners ()
 
virtual ~DFSListenersContainer ()
 

Protected Member Functions

virtual bool traverse_node (HMscNode *node)
 
virtual void traverse_predecessors (SuccessorNode *succ)
 
virtual bool is_processed (HMscNode *node)
 
void set_color (HMscNode *n, NodeColor c)
 
NodeColorget_color (HMscNode *n)
 
void white_node_found (HMscNode *n)
 
void gray_node_found (HMscNode *n)
 
void black_node_found (HMscNode *n)
 
void node_finished (HMscNode *n)
 

Protected Attributes

HMscNodePList m_colored_nodes
 
MscElementPList m_reached_elements
 
std::string m_color_attribute
 
- Protected Attributes inherited from DFSListenersContainer
NodeFinishedListenerPList m_node_finished_listeners
 
WhiteNodeFoundListenerPList m_white_node_found_listeners
 
GrayNodeFoundListenerPList m_gray_node_found_listeners
 
BlackNodeFoundListenerPList m_black_node_found_listeners
 
GrayNodeFoundListenerPList m_grey_node_found_listeners
 

Detailed Description

Traverses all accessible HMscNodes in single HMsc in depth first search manner in backward (B in class name) direction.

Definition at line 31 of file dfsb_hmsc_traverser.h.

Constructor & Destructor Documentation

DFSBHMscTraverser::DFSBHMscTraverser ( const std::string color_attribute = "dfsb:color")
inline

To change default name of attribute which holds color of HMscNodes use color_attribute parameter.

Definition at line 40 of file dfsb_hmsc_traverser.h.

DFSBHMscTraverser::~DFSBHMscTraverser ( )
virtual

Calls cleanup_traversing_attributes

Definition at line 23 of file dfsb_hmsc_traverser.cpp.

References cleanup_traversing_attributes().

Member Function Documentation

void DFSBHMscTraverser::black_node_found ( HMscNode n)
protectedvirtual

Called when black HMscNode is found.

Reimplemented from DFSListenersContainer.

Definition at line 118 of file dfsb_hmsc_traverser.cpp.

References DFSListenersContainer::black_node_found(), and m_reached_elements.

Referenced by is_processed().

void DFSBHMscTraverser::cleanup_traversing_attributes ( )
virtual

Cleans up traversing attributes

Definition at line 97 of file dfsb_hmsc_traverser.cpp.

References m_color_attribute, m_colored_nodes, and m_reached_elements.

Referenced by traverse(), and ~DFSBHMscTraverser().

NodeColor & DFSBHMscTraverser::get_color ( HMscNode n)
protected

Returns value of color attribute.

If attribute isn't set it is set to default value WHITE.

Definition at line 131 of file dfsb_hmsc_traverser.cpp.

References MscElement::get_attribute(), m_color_attribute, m_colored_nodes, and WHITE.

Referenced by is_processed(), and set_color().

const MscElementPList& DFSBHMscTraverser::get_reached_elements ( )
inline

Returns reached HMscNodes in particular phase of traversing.

The result corresponds to call stack on particular HMscNodes.

Warning: The result is emptied when cleanup_traversing_attributes() is called

Definition at line 69 of file dfsb_hmsc_traverser.h.

void DFSBHMscTraverser::gray_node_found ( HMscNode n)
protectedvirtual

Called when gray HMscNode is found.

Reimplemented from DFSListenersContainer.

Definition at line 112 of file dfsb_hmsc_traverser.cpp.

References DFSListenersContainer::gray_node_found(), and m_reached_elements.

Referenced by is_processed().

bool DFSBHMscTraverser::is_processed ( HMscNode node)
protectedvirtual

Returns true iff node is already processed false otherwise

Definition at line 81 of file dfsb_hmsc_traverser.cpp.

References BLACK, black_node_found(), get_color(), GRAY, and gray_node_found().

Referenced by traverse_node().

void DFSBHMscTraverser::node_finished ( HMscNode n)
protectedvirtual

Called when all successors of e are processed.

Reimplemented from DFSListenersContainer.

Definition at line 124 of file dfsb_hmsc_traverser.cpp.

References BLACK, m_reached_elements, DFSListenersContainer::node_finished(), and set_color().

Referenced by traverse_node().

void DFSBHMscTraverser::set_color ( HMscNode n,
NodeColor  c 
)
protected

Sets color attribute of e to c value .

Definition at line 142 of file dfsb_hmsc_traverser.cpp.

References get_color().

Referenced by node_finished(), and white_node_found().

void DFSBHMscTraverser::traverse ( HMscPtr  hmsc)
virtual

Trigger of traversing

Definition at line 28 of file dfsb_hmsc_traverser.cpp.

References cleanup_traversing_attributes(), and traverse_node().

Referenced by NoendingNodesEliminator::eliminate(), and HMscFinder::on_white_node_found().

void DFSBHMscTraverser::traverse ( HMscNode node,
bool  cleanup = true 
)
virtual

Definition at line 42 of file dfsb_hmsc_traverser.cpp.

References cleanup_traversing_attributes(), and traverse_node().

bool DFSBHMscTraverser::traverse_node ( HMscNode node)
protectedvirtual

Traverses single node

Definition at line 51 of file dfsb_hmsc_traverser.cpp.

References is_processed(), m_reached_elements, node_finished(), traverse_predecessors(), and white_node_found().

Referenced by traverse(), and traverse_predecessors().

void DFSBHMscTraverser::traverse_predecessors ( SuccessorNode succ)
protectedvirtual

Traverses predecessors of succ

Definition at line 68 of file dfsb_hmsc_traverser.cpp.

References SuccessorNode::get_predecessors(), m_reached_elements, and traverse_node().

Referenced by traverse_node().

void DFSBHMscTraverser::white_node_found ( HMscNode n)
protectedvirtual

Called when white HMscNode is found.

Reimplemented from DFSListenersContainer.

Definition at line 106 of file dfsb_hmsc_traverser.cpp.

References GRAY, set_color(), and DFSListenersContainer::white_node_found().

Referenced by traverse_node().

Member Data Documentation

std::string DFSBHMscTraverser::m_color_attribute
protected

Color attribute's name

Definition at line 104 of file dfsb_hmsc_traverser.h.

Referenced by cleanup_traversing_attributes(), and get_color().

HMscNodePList DFSBHMscTraverser::m_colored_nodes
protected

Holds nodes with set color attribute

Definition at line 79 of file dfsb_hmsc_traverser.h.

Referenced by cleanup_traversing_attributes(), and get_color().

MscElementPList DFSBHMscTraverser::m_reached_elements
protected

Holds currently reached HMscElements.

Definition at line 84 of file dfsb_hmsc_traverser.h.

Referenced by black_node_found(), cleanup_traversing_attributes(), gray_node_found(), node_finished(), traverse_node(), and traverse_predecessors().


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

SourceForge.net Logo
Generated on Fri Jan 15 2016 16:26:58 for Sequence Chart Studio by  doxygen