#pragma once

/* $Hedaer$
*/

#include <SharknirDrotServiceWorker.h>
#include <Nice/Property.h>
#include <Basda/Mocca/NDevice.h>
#include <Basda/ServiceWorkerSkeleton.h>

namespace Sharknir
{
    class DrotServiceWorkerMock : public DrotServiceWorker
    {
        public:
            DrotServiceWorkerMock(const Nice::JointPtr & _config,
                                       const Basda::MoccaNDevicePtr &_device);

            ~DrotServiceWorkerMock();

            void setTimelapse(double _timelapse);

            double getTimelapse();

        protected:
            /**
             * @brief This is the implementation of the call back object to
             *        update the completion status.
             */
            struct DeviceAsyncImplMock 
		: public Basda::MoccaNServiceWorkerCore<double, double, Nice::Point, DrotServiceWorkerSkeleton>::DeviceAsyncImpl
            {
                virtual int asyncWait(const Nice::Time & _t);
            };

            /**
             * @brief This struct is the implementation of the asynchronous
             *        command status method.
             */
            struct DeviceCmdAsyncImplMock : public Basda::MoccaNServiceWorkerCore<double,
            double, Nice::Point, DrotServiceWorkerSkeleton>::DeviceCmdAsyncImpl
            {
                    virtual int asyncWait(const Nice::Time & _t);
            };

            double m_timelapse;

            DeviceAsyncImplMock m_deviceAsyncMock;

            DeviceCmdAsyncImplMock m_deviceCmdAsyncMock;

            virtual DeviceAsyncImpl & deviceAsyncImpl() { return m_deviceAsyncMock; };

            virtual DeviceAsyncImpl & deviceCmdAsyncImpl() { return m_deviceCmdAsyncMock; };
    };

    typedef IceUtil::Handle<DrotServiceWorkerMock> DrotServiceWorkerMockPtr;
}
;
