WimaDataContainer.cc 1.38 KB
Newer Older
1 2 3
#include "WimaDataContainer.h"

WimaDataContainer::WimaDataContainer(QObject *parent)
4
    :   QObject     (parent)
5 6 7
{

}
8

9 10 11 12 13 14 15 16
/*!
 * \fn void WimaDataContainer::push(const WimaPlanData &planData)
 *
 * Updates the \c WimaPlanData members content with \a planData.
 * Emits the planDataChanged() signal.
 *
 * \sa WimaPlanData
 */
17
void WimaDataContainer::push(QSharedPointer<const WimaPlanData> planData)
18
{
19
    _planData = planData;
20

21
    auto start = std::chrono::high_resolution_clock::now();
22
    emit newDataAvailable();
23 24 25 26
    qWarning() << "WimaDataContainer::push"
               << std::chrono::duration_cast<std::chrono::milliseconds>(
                      std::chrono::high_resolution_clock::now()-start).count()
               << " ms";
27 28
}

29 30 31 32 33 34 35
/*!
 * \fn const WimaPlanData &WimaDataContainer::pull() const
 *
 * Returns a constant referenc to the \c WimaPlanData member.
 *
 * \sa WimaPlanData
 */
36
QSharedPointer<const WimaPlanData> WimaDataContainer::pull() const
37
{
38
    return  _planData;
39 40
}

41 42 43 44 45 46 47 48 49 50 51 52
/*!
 * \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
 */



53