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

#include <dfs_events_traverser.h>

Inheritance diagram for DFSEventsTraverser:
Inheritance graph
Collaboration diagram for DFSEventsTraverser:
Collaboration graph

Public Member Functions

 DFSEventsTraverser (const std::string &color="color")
virtual ~DFSEventsTraverser ()
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_event_successor_listener (EventSuccessorListener *l)
void add_send_receive_pair_listener (SendReceivePairListener *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_event_successor_listeners ()
void remove_send_receive_pair_listeners ()
void remove_instance_finished_listeners ()
void remove_all_listeners ()

Static Public Member Functions

static EventPListPtr topology_order (BMscPtr b)

Protected Member Functions

virtual void traverse_area (EventArea *area, Event *predecessor=NULL)
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 event_successor (Event *event, Event *successor)
void send_receive_pair (MessageEvent *send, MessageEvent *receive)
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
EventSuccessorListenerPList event_successor_listeners
SendReceivePairListenerPList send_receive_pair_listeners
InstanceFinishedListenerPList instance_finished_listeners

Detailed Description

Processes Events during traversing BMsc's Events in depth first search manner.

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 152 of file dfs_events_traverser.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file dfs_events_traverser.cpp.

DFSEventsTraverser::~DFSEventsTraverser ( )

Definition at line 27 of file dfs_events_traverser.cpp.

References cleanup_traversing_attributes().

Member Function Documentation

void DFSEventsTraverser::add_black_event_found_listener ( BlackEventFoundListener l)

Adds BlackEventFoundListener

Definition at line 195 of file dfs_events_traverser.h.

void DFSEventsTraverser::add_event_finished_listener ( EventFinishedListener l)
void DFSEventsTraverser::add_event_successor_listener ( EventSuccessorListener l)
void DFSEventsTraverser::add_gray_event_found_listener ( GrayEventFoundListener l)

Adds GrayEventFoundListener

Definition at line 187 of file dfs_events_traverser.h.

void DFSEventsTraverser::add_instance_finished_listener ( InstanceFinishedListener l)

Adds InstanceFinishedListener

Definition at line 219 of file dfs_events_traverser.h.

void DFSEventsTraverser::add_send_receive_pair_listener ( SendReceivePairListener l)

Adds SendReceivePairListenerPList

Definition at line 211 of file dfs_events_traverser.h.

Referenced by LayoutOptimizer::after_import_process(), AcyclicChecker::check(), and LayoutOptimizer::process().

void DFSEventsTraverser::add_white_event_found_listener ( WhiteEventFoundListener l)
void DFSEventsTraverser::black_event_found ( Event e)

Called when black Event is found.

Definition at line 158 of file dfs_events_traverser.cpp.

References black_event_found_listeners, and m_reached_elements.

Referenced by is_processed().

void DFSEventsTraverser::cleanup_traversing_attributes ( )
void DFSEventsTraverser::event_finished ( Event e)

Called when all successors of e are processed.

Definition at line 166 of file dfs_events_traverser.cpp.

References BLACK, event_finished_listeners, and set_color().

Referenced by DFSAreaTraverser::traverse_event(), and traverse_event().

void DFSEventsTraverser::event_successor ( Event event,
Event successor 

Called when a relation event–>successor is found.

Definition at line 174 of file dfs_events_traverser.cpp.

References event_successor_listeners.

Referenced by traverse_area(), and traverse_event().

NodeColor DFSEventsTraverser::get_color ( Event e)

Returns value of color attribute.

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

Definition at line 205 of file dfs_events_traverser.cpp.

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

Referenced by is_processed().

const MscElementPList& DFSEventsTraverser::get_reached_elements ( )

Definition at line 229 of file dfs_events_traverser.h.

Referenced by EventsCreatorListener::get_preceding_event().

void DFSEventsTraverser::gray_event_found ( Event e)

Called when gray Event is found.

Definition at line 150 of file dfs_events_traverser.cpp.

References gray_event_found_listeners, and m_reached_elements.

Referenced by is_processed().

void DFSEventsTraverser::instance_finished ( Instance i)

Called when all events on i are processed.

Definition at line 188 of file dfs_events_traverser.cpp.

References instance_finished_listeners.

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

Definition at line 220 of file dfs_events_traverser.cpp.

References black_event_found_listeners.

Referenced by remove_all_listeners().

void DFSEventsTraverser::remove_event_finished_listeners ( )

Definition at line 225 of file dfs_events_traverser.cpp.

References event_finished_listeners.

Referenced by remove_all_listeners().

void DFSEventsTraverser::remove_event_successor_listeners ( )

Definition at line 230 of file dfs_events_traverser.cpp.

References event_successor_listeners.

Referenced by remove_all_listeners().

void DFSEventsTraverser::remove_gray_event_found_listeners ( )

Definition at line 215 of file dfs_events_traverser.cpp.

References gray_event_found_listeners.

Referenced by remove_all_listeners().

void DFSEventsTraverser::remove_instance_finished_listeners ( )

Definition at line 240 of file dfs_events_traverser.cpp.

References instance_finished_listeners.

Referenced by remove_all_listeners().

void DFSEventsTraverser::remove_send_receive_pair_listeners ( )

Definition at line 235 of file dfs_events_traverser.cpp.

References send_receive_pair_listeners.

Referenced by remove_all_listeners().

void DFSEventsTraverser::remove_white_event_found_listeners ( )
void DFSEventsTraverser::send_receive_pair ( MessageEvent send,
MessageEvent receive 

Called when a message send–>receive is found.

Definition at line 181 of file dfs_events_traverser.cpp.

References send_receive_pair_listeners.

Referenced by traverse_matching_event().

void DFSEventsTraverser::set_color ( Event e,
NodeColor  c 

Sets color attribute of e to c value .

Definition at line 317 of file dfs_events_traverser.h.

References MscElement::set_attribute().

Referenced by event_finished(), and white_event_found().

EventPListPtr DFSEventsTraverser::topology_order ( BMscPtr  b)
void DFSEventsTraverser::traverse ( BMscPtr  bmsc)
void DFSEventsTraverser::traverse_area ( EventArea area,
Event predecessor = NULL 
void DFSEventsTraverser::traverse_event ( Event event)
void DFSEventsTraverser::traverse_matching_event ( Event event)
void DFSEventsTraverser::white_event_found ( Event e)

Called when white Event is found.

Definition at line 141 of file dfs_events_traverser.cpp.

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

Referenced by is_processed().

Member Data Documentation

BlackEventFoundListenerPList DFSEventsTraverser::black_event_found_listeners
EventFinishedListenerPList DFSEventsTraverser::event_finished_listeners

Holds listeners

Definition at line 262 of file dfs_events_traverser.h.

Referenced by event_finished(), and remove_event_finished_listeners().

EventSuccessorListenerPList DFSEventsTraverser::event_successor_listeners

Definition at line 267 of file dfs_events_traverser.h.

Referenced by event_successor(), and remove_event_successor_listeners().

GrayEventFoundListenerPList DFSEventsTraverser::gray_event_found_listeners

Definition at line 264 of file dfs_events_traverser.h.

Referenced by gray_event_found(), and remove_gray_event_found_listeners().

GrayEventFoundListenerPList DFSEventsTraverser::grey_event_found_listeners

Definition at line 266 of file dfs_events_traverser.h.

InstanceFinishedListenerPList DFSEventsTraverser::instance_finished_listeners
std::string DFSEventsTraverser::m_color

Definition at line 257 of file dfs_events_traverser.h.

Referenced by cleanup_traversing_attributes(), and get_color().

EventPList DFSEventsTraverser::m_colored_events

List of colored events during traversing.

Definition at line 255 of file dfs_events_traverser.h.

Referenced by cleanup_traversing_attributes(), and white_event_found().

MscElementPList DFSEventsTraverser::m_reached_elements

Holds path to currently reached event

Definition at line 250 of file dfs_events_traverser.h.

Referenced by black_event_found(), gray_event_found(), DFSAreaTraverser::traverse_event(), traverse_event(), and traverse_matching_event().

SendReceivePairListenerPList DFSEventsTraverser::send_receive_pair_listeners
WhiteEventFoundListenerPList DFSEventsTraverser::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