Newer
Older
#include "WimaDataContainer.h"
WimaDataContainer::WimaDataContainer(QObject *parent)
Valentin Platzgummer
committed
, _planData (this /* parent */)
, _dataValid (false)
Valentin Platzgummer
committed
/*!
* \fn bool WimaDataContainer::dataValid() const
* Returns \c true if the data is valid, \c false else.
*/
bool WimaDataContainer::dataValid() const/*!
* \fn bool dijkstraAlgorithm(int startIndex, int endIndex, const QList<T> elements, QList<T> &elementPath, double(*distance)(const T &t1, const T &t2))
* Calculates the shortest path between the elements stored in \a elements.
* The \l {Dijkstra Algorithm} is used to find the shorest path.
* Stores the result inside \a elementPath when sucessfull.
* The function handle \a distance is used to calculate the distance between two elements. The distance must be positive.
* Returns \c true if successful, \c false else.
*
* \sa QList
*/
Valentin Platzgummer
committed
return _dataValid;
Valentin Platzgummer
committed
/*!
* \fn void WimaDataContainer::push(const WimaPlanData &planData)
*
* Updates the \c WimaPlanData members content with \a planData.
* Emits the planDataChanged() signal.
*
* \sa WimaPlanData
*/
void WimaDataContainer::push(const WimaPlanData &planData)
Valentin Platzgummer
committed
setDataValid(false);
_planData = planData;
setDataValid(true);
Valentin Platzgummer
committed
/*!
* \fn const WimaPlanData &WimaDataContainer::pull() const
*
* Returns a constant referenc to the \c WimaPlanData member.
*
* \sa WimaPlanData
*/
const WimaPlanData &WimaDataContainer::pull() const
Valentin Platzgummer
committed
return _planData;
Valentin Platzgummer
committed
/*!
* \fn void WimaDataContainer::setDataValid(bool valid)
*
* Sets the validity of the data to \a valid.
* Mainly for internal usage. Should be invoked from \c WimaPlaner only.
*
* \sa WimaPlanData
*/
void WimaDataContainer::setDataValid(bool valid)
Valentin Platzgummer
committed
if ( _dataValid != valid ) {
_dataValid = valid;
Valentin Platzgummer
committed
emit dataValidChanged(_dataValid);
Valentin Platzgummer
committed
/*!
* \class WimaDataContainer
* \brief Data container designed for data exchange between \c WimaPlaner and \c WimaController.
* Data container designed for data exchange between \c WimaPlaner and \c WimaController.
* It is meant that only one instance of this class exists. Both \c WimaPlaner and \c WimaController
* have a reference to this instance and can modify its data.
*
* \sa WimaController, WimaPlaner
*/