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
DFSBackwardTraverser Class Reference

#include <dfs_backward_traverser.h>

Collaboration diagram for DFSBackwardTraverser:
Collaboration graph

Public Member Functions

 DFSBackwardTraverser (const std::string &color="color")
virtual ~DFSBackwardTraverser ()
virtual void traverse (BMscPtr bmsc)
void add_event_finished_listener (EventFinishedListener *l)
void add_white_event_found_listener (WhiteEventFoundListener *l)
void add_gray_event_found_listener (GrayEventFoundListener *l)
void add_black_event_found_listener (BlackEventFoundListener *l)
void add_instance_finished_listener (InstanceFinishedListener *l)
virtual void cleanup_traversing_attributes ()
const MscElementPListget_reached_elements ()
void remove_white_event_found_listeners ()
void remove_gray_event_found_listeners ()
void remove_black_event_found_listeners ()
void remove_event_finished_listeners ()
void remove_instance_finished_listeners ()
void remove_all_listeners ()

Protected Member Functions

virtual void traverse_area (EventArea *area)
virtual void traverse_event (Event *event)
virtual void traverse_matching_event (Event *event)
bool is_processed (Event *event)
void white_event_found (Event *e)
void gray_event_found (Event *e)
void black_event_found (Event *e)
void event_finished (Event *e)
void instance_finished (Instance *i)
void set_color (Event *e, NodeColor c)
NodeColor get_color (Event *e)

Protected Attributes

MscElementPList m_reached_elements
EventPList m_colored_events
std::string m_color
EventFinishedListenerPList event_finished_listeners
WhiteEventFoundListenerPList white_event_found_listeners
GrayEventFoundListenerPList gray_event_found_listeners
BlackEventFoundListenerPList black_event_found_listeners
GrayEventFoundListenerPList grey_event_found_listeners
InstanceFinishedListenerPList instance_finished_listeners

Detailed Description

Processes Events during traversing BMsc's Events in depth first search manner from last Event till first.

Events of BMsc are during traversing in different states - with different color. WHITE color means that event wasn't traversed before. GRAY events are those which have been already traversed and they are just on the stack - not all successors of these events were processed. BLACK events are those which have been already traversed but aren't yet on the stack - all successors have been processed.

Listeners' methods are called at particular positions in code of traversing.

Definition at line 40 of file dfs_backward_traverser.h.

Constructor & Destructor Documentation

DFSBackwardTraverser::DFSBackwardTraverser ( const std::string color = "color")

Definition at line 24 of file dfs_backward_traverser.cpp.

DFSBackwardTraverser::~DFSBackwardTraverser ( )

Definition at line 28 of file dfs_backward_traverser.cpp.

References cleanup_traversing_attributes().

Member Function Documentation

void DFSBackwardTraverser::add_black_event_found_listener ( BlackEventFoundListener l)

Adds BlackEventFoundListener

Definition at line 83 of file dfs_backward_traverser.h.

void DFSBackwardTraverser::add_event_finished_listener ( EventFinishedListener l)
void DFSBackwardTraverser::add_gray_event_found_listener ( GrayEventFoundListener l)

Adds GrayEventFoundListener

Definition at line 75 of file dfs_backward_traverser.h.

void DFSBackwardTraverser::add_instance_finished_listener ( InstanceFinishedListener l)

Adds InstanceFinishedListener

Definition at line 91 of file dfs_backward_traverser.h.

void DFSBackwardTraverser::add_white_event_found_listener ( WhiteEventFoundListener l)

Adds WhiteEventFoundListener

Definition at line 67 of file dfs_backward_traverser.h.

void DFSBackwardTraverser::black_event_found ( Event e)

Called when black Event is found.

Definition at line 150 of file dfs_backward_traverser.cpp.

References black_event_found_listeners, and m_reached_elements.

Referenced by is_processed().

void DFSBackwardTraverser::cleanup_traversing_attributes ( void  )

Cleans up set attributes.

Definition at line 125 of file dfs_backward_traverser.cpp.

References m_color, and m_colored_events.

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

void DFSBackwardTraverser::event_finished ( Event e)

Called when all successors of e are processed.

Definition at line 158 of file dfs_backward_traverser.cpp.

References BLACK, event_finished_listeners, m_reached_elements, and set_color().

Referenced by traverse_event().

NodeColor DFSBackwardTraverser::get_color ( Event e)

Returns value of color attribute.

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

Definition at line 174 of file dfs_backward_traverser.cpp.

References MscElement::get_attribute(), m_color, and WHITE.

Referenced by is_processed().

const MscElementPList& DFSBackwardTraverser::get_reached_elements ( )

Definition at line 101 of file dfs_backward_traverser.h.

void DFSBackwardTraverser::gray_event_found ( Event e)

Called when gray Event is found.

Definition at line 142 of file dfs_backward_traverser.cpp.

References gray_event_found_listeners, and m_reached_elements.

Referenced by is_processed().

void DFSBackwardTraverser::instance_finished ( Instance i)

Called when Instance searching is finished.

Definition at line 167 of file dfs_backward_traverser.cpp.

References instance_finished_listeners.

Referenced by traverse().

bool DFSBackwardTraverser::is_processed ( Event event)
void DFSBackwardTraverser::remove_all_listeners ( )
void DFSBackwardTraverser::remove_black_event_found_listeners ( )

Definition at line 189 of file dfs_backward_traverser.cpp.

References black_event_found_listeners.

Referenced by remove_all_listeners().

void DFSBackwardTraverser::remove_event_finished_listeners ( )

Definition at line 194 of file dfs_backward_traverser.cpp.

References event_finished_listeners.

Referenced by remove_all_listeners().

void DFSBackwardTraverser::remove_gray_event_found_listeners ( )

Definition at line 184 of file dfs_backward_traverser.cpp.

References gray_event_found_listeners.

Referenced by remove_all_listeners().

void DFSBackwardTraverser::remove_instance_finished_listeners ( )

Definition at line 199 of file dfs_backward_traverser.cpp.

References instance_finished_listeners.

Referenced by remove_all_listeners().

void DFSBackwardTraverser::remove_white_event_found_listeners ( )

Definition at line 179 of file dfs_backward_traverser.cpp.

References white_event_found_listeners.

Referenced by remove_all_listeners().

void DFSBackwardTraverser::set_color ( Event e,
NodeColor  c 

Sets color attribute of e to c value .

Definition at line 174 of file dfs_backward_traverser.h.

References MscElement::set_attribute().

Referenced by event_finished(), and white_event_found().

void DFSBackwardTraverser::traverse ( BMscPtr  bmsc)

Traverses events in bmsc.

Events are traversed in depth first search manner from instance's last event to instance's first event.

Definition at line 33 of file dfs_backward_traverser.cpp.

References cleanup_traversing_attributes(), instance_finished(), and traverse_area().

Referenced by AbsoluteTimeConsistencyChecker::check(), TimeRelevantOrdering::tranform_relative_times(), AbsoluteTimeTighter::transform(), and TimeRelevantOrdering::transform_absolute_times().

void DFSBackwardTraverser::traverse_area ( EventArea area)
void DFSBackwardTraverser::traverse_event ( Event event)
void DFSBackwardTraverser::traverse_matching_event ( Event event)
void DFSBackwardTraverser::white_event_found ( Event e)

Called when white Event is found.

Definition at line 133 of file dfs_backward_traverser.cpp.

References GRAY, m_colored_events, set_color(), and white_event_found_listeners.

Referenced by is_processed().

Member Data Documentation

BlackEventFoundListenerPList DFSBackwardTraverser::black_event_found_listeners
EventFinishedListenerPList DFSBackwardTraverser::event_finished_listeners

Holds listeners

Definition at line 131 of file dfs_backward_traverser.h.

Referenced by event_finished(), and remove_event_finished_listeners().

GrayEventFoundListenerPList DFSBackwardTraverser::gray_event_found_listeners
GrayEventFoundListenerPList DFSBackwardTraverser::grey_event_found_listeners

Definition at line 135 of file dfs_backward_traverser.h.

InstanceFinishedListenerPList DFSBackwardTraverser::instance_finished_listeners
std::string DFSBackwardTraverser::m_color

Definition at line 126 of file dfs_backward_traverser.h.

Referenced by cleanup_traversing_attributes(), and get_color().

EventPList DFSBackwardTraverser::m_colored_events

List of colored events during traversing.

Definition at line 124 of file dfs_backward_traverser.h.

Referenced by cleanup_traversing_attributes(), and white_event_found().

MscElementPList DFSBackwardTraverser::m_reached_elements

Holds path to currently reached event

Definition at line 119 of file dfs_backward_traverser.h.

Referenced by black_event_found(), event_finished(), gray_event_found(), traverse_event(), and traverse_matching_event().

WhiteEventFoundListenerPList DFSBackwardTraverser::white_event_found_listeners

The documentation for this class was generated from the following files: Logo
Generated on Fri Jan 15 2016 16:26:58 for Sequence Chart Studio by  doxygen