Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes

BasicAlgorithm Class Reference

#include <algorithms.h>

Inheritance diagram for BasicAlgorithm:
Collaboration diagram for BasicAlgorithm:

List of all members.

Public Member Functions

 BasicAlgorithm ()
virtual ~BasicAlgorithm ()
bool hasSettingsDialog () const
bool requireCreator () const
bool run (const IAutomaton::TAutomataList &input, QSharedPointer< IAutomaton > &result, QString *report=0) const
void runSettingsDialog (QWidget *)
void setAutomataCreator (const QSharedPointer< IAutomataCreator > &creator)

Protected Member Functions

virtual void addReport (const QString &text) const
 const because doesn't change algorithm, however changes report member
virtual bool determinize (QSharedPointer< IAutomaton > &automaton) const
IState::TIStateNameSet getEpsilonClosure (const QSharedPointer< IAutomaton > &automaton, const QSharedPointer< IState > &state) const
void makeSureNamesUnique (const QSharedPointer< IAutomaton > &automaton1, const QSharedPointer< IAutomaton > &automaton2) const
void makeSureNameUnique (const QSharedPointer< IAutomaton > &automaton, QString &name) const
virtual bool removeEpsilonTransitions (QSharedPointer< IAutomaton > &automaton) const
virtual bool removeMultipleInitials (QSharedPointer< IAutomaton > &automaton) const
virtual bool runInternal (const IAutomaton::TAutomataList &input, QSharedPointer< IAutomaton > &result) const =0
 each basic algorithm has to implements this method
bool tryMergeAlphabet (const ITransition::TCharSet &alphabet1, const ITransition::TCharSet &alphabet2, ITransition::TCharSet &alphabet) const

Protected Attributes

QSharedPointer< IAutomataCreatorm_creator

Private Attributes

QString m_report

Detailed Description

Definition at line 13 of file algorithms.h.


Constructor & Destructor Documentation

BasicAlgorithm::BasicAlgorithm (  ) 

Definition at line 75 of file algorithms.cpp.

virtual BasicAlgorithm::~BasicAlgorithm (  )  [inline, virtual]

Definition at line 18 of file algorithms.h.


Member Function Documentation

void BasicAlgorithm::addReport ( const QString &  text  )  const [protected, virtual]
bool BasicAlgorithm::determinize ( QSharedPointer< IAutomaton > &  automaton  )  const [protected, virtual]

Definition at line 180 of file algorithms.cpp.

References addReport(), and m_creator.

Referenced by MinimalizeAlgorithm::runInternal().

Here is the call graph for this function:

Here is the caller graph for this function:

IState::TIStateNameSet BasicAlgorithm::getEpsilonClosure ( const QSharedPointer< IAutomaton > &  automaton,
const QSharedPointer< IState > &  state 
) const [protected]

Definition at line 112 of file algorithms.cpp.

Referenced by RemoveEpsilonAlgorithm::runInternal().

Here is the caller graph for this function:

bool BasicAlgorithm::hasSettingsDialog (  )  const [inline, virtual]

Implements IAlgorithm.

Reimplemented in BasicAlgorithmWithSettings.

Definition at line 24 of file algorithms.h.

void BasicAlgorithm::makeSureNamesUnique ( const QSharedPointer< IAutomaton > &  automaton1,
const QSharedPointer< IAutomaton > &  automaton2 
) const [protected]

Definition at line 209 of file algorithms.cpp.

Referenced by IntersectionParallelAlgorithm::runInternal(), and UniteParallelAlgorithm::runInternal().

Here is the caller graph for this function:

void BasicAlgorithm::makeSureNameUnique ( const QSharedPointer< IAutomaton > &  automaton,
QString &  name 
) const [protected]

Definition at line 198 of file algorithms.cpp.

Referenced by BasicAlgorithmWithSettings::chooseStateName(), and RemoveMultipleInitialsAlgorithm::runInternal().

Here is the caller graph for this function:

bool BasicAlgorithm::removeEpsilonTransitions ( QSharedPointer< IAutomaton > &  automaton  )  const [protected, virtual]

Definition at line 144 of file algorithms.cpp.

References addReport(), and m_creator.

Referenced by IntersectionParallelAlgorithm::runInternal(), UniteParallelAlgorithm::runInternal(), and DeterminizeAlgorithm::runInternal().

Here is the call graph for this function:

Here is the caller graph for this function:

bool BasicAlgorithm::removeMultipleInitials ( QSharedPointer< IAutomaton > &  automaton  )  const [protected, virtual]

Definition at line 162 of file algorithms.cpp.

References addReport(), and m_creator.

Referenced by IntersectionParallelAlgorithm::runInternal(), UniteParallelAlgorithm::runInternal(), and DeterminizeAlgorithm::runInternal().

Here is the call graph for this function:

Here is the caller graph for this function:

bool BasicAlgorithm::requireCreator (  )  const [inline, virtual]

Algorithm can implement own IAutomaton, IState and ITransition classes, in that case doesn't require creator to be set

Implements IAlgorithm.

Definition at line 20 of file algorithms.h.

bool BasicAlgorithm::run ( const IAutomaton::TAutomataList input,
QSharedPointer< IAutomaton > &  result,
QString *  report = 0 
) const [virtual]

Implements IAlgorithm.

Definition at line 84 of file algorithms.cpp.

References addReport(), DBGLOG_ALGO, IAlgorithm::getName(), m_creator, m_report, RELLOG, and runInternal().

Here is the call graph for this function:

virtual bool BasicAlgorithm::runInternal ( const IAutomaton::TAutomataList input,
QSharedPointer< IAutomaton > &  result 
) const [protected, pure virtual]

each basic algorithm has to implements this method

Implemented in RemoveEpsilonAlgorithm, RemoveInaccessibleAlgorithm, RemoveUselessAlgorithm, RemoveMultipleInitialsAlgorithm, DeterminizeAlgorithm, MinimalizeAlgorithm, UniteParallelAlgorithm, and IntersectionParallelAlgorithm.

Referenced by run().

Here is the caller graph for this function:

void BasicAlgorithm::runSettingsDialog ( QWidget *   )  [inline, virtual]

Implements IAlgorithm.

Reimplemented in BasicAlgorithmWithSettings.

Definition at line 25 of file algorithms.h.

void BasicAlgorithm::setAutomataCreator ( const QSharedPointer< IAutomataCreator > &  creator  )  [virtual]

Implements IAlgorithm.

Definition at line 79 of file algorithms.cpp.

References m_creator.

bool BasicAlgorithm::tryMergeAlphabet ( const ITransition::TCharSet alphabet1,
const ITransition::TCharSet alphabet2,
ITransition::TCharSet alphabet 
) const [protected]

Definition at line 233 of file algorithms.cpp.

Referenced by IntersectionParallelAlgorithm::runInternal(), and UniteParallelAlgorithm::runInternal().

Here is the caller graph for this function:


Member Data Documentation

QSharedPointer<IAutomataCreator> BasicAlgorithm::m_creator [protected]
QString BasicAlgorithm::m_report [mutable, private]

Definition at line 58 of file algorithms.h.

Referenced by addReport(), and run().


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