#include <algorithms.h>
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< IAutomataCreator > | m_creator |
Private Attributes | |
QString | m_report |
Definition at line 13 of file algorithms.h.
BasicAlgorithm::BasicAlgorithm | ( | ) |
Definition at line 75 of file algorithms.cpp.
virtual BasicAlgorithm::~BasicAlgorithm | ( | ) | [inline, virtual] |
Definition at line 18 of file algorithms.h.
void BasicAlgorithm::addReport | ( | const QString & | text | ) | const [protected, virtual] |
const because doesn't change algorithm, however changes report member
Definition at line 228 of file algorithms.cpp.
References m_report.
Referenced by determinize(), removeEpsilonTransitions(), removeMultipleInitials(), run(), IntersectionParallelAlgorithm::runInternal(), UniteParallelAlgorithm::runInternal(), MinimalizeAlgorithm::runInternal(), DeterminizeAlgorithm::runInternal(), RemoveMultipleInitialsAlgorithm::runInternal(), RemoveUselessAlgorithm::runInternal(), RemoveInaccessibleAlgorithm::runInternal(), and RemoveEpsilonAlgorithm::runInternal().
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().
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().
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().
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().
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().
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().
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().
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().
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] |
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().
QSharedPointer<IAutomataCreator> BasicAlgorithm::m_creator [protected] |
Definition at line 55 of file algorithms.h.
Referenced by determinize(), removeEpsilonTransitions(), removeMultipleInitials(), run(), IntersectionParallelAlgorithm::runInternal(), UniteParallelAlgorithm::runInternal(), DeterminizeAlgorithm::runInternal(), RemoveUselessAlgorithm::runInternal(), RemoveInaccessibleAlgorithm::runInternal(), RemoveEpsilonAlgorithm::runInternal(), and setAutomataCreator().
QString BasicAlgorithm::m_report [mutable, private] |
Definition at line 58 of file algorithms.h.
Referenced by addReport(), and run().