/*
 * This file is part of ArmarX.
 *
 * ArmarX is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * ArmarX is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    RobotAPI::ArmarXObjects::PlatformDataUnit
 * @author     Raphael ( ufdrv at student dot kit dot edu )
 * @date       2017
 * @copyright  http://www.gnu.org/licenses/gpl-2.0.txt
 *             GNU General Public License
 */

#ifndef _ARMARX_LIB_RobotAPI_PlatformDataUnit_H
#define _ARMARX_LIB_RobotAPI_PlatformDataUnit_H

namespace armarx
{
    class PlatformDataUnitInterface
    {
    public:
        virtual const float* getFrontRightWheelVelocity() const = 0;
        virtual const float* getFrontLeftWheelVelocity() const = 0;
        virtual const float* getRearRightWheelVelocity() const = 0;
        virtual const float* getRearLeftWheelVelocity() const = 0;
    };

    class PlatformDataUnitPtrProvider : public virtual PlatformDataUnitInterface
    {
    public:
        const float* getFrontRightWheelVelocity() const override
        {
            return frontRightVelocity;
        }

        const float* getFrontLeftWheelVelocity() const override
        {
            return frontLeftVelocity;
        }

        const float* getRearRightWheelVelocity() const override
        {
            return rearRightVelocity;
        }

        const float* getRearLeftWheelVelocity() const override
        {
            return rearLeftVelocity;
        }

    protected:
        void setFrontRightVelocityPtr(float* velocity)
        {
            frontRightVelocity = velocity;
        }

        void setFrontLeftVelocityPtr(float* velocity)
        {
            frontRightVelocity = velocity;
        }

        void setRearRightVelocityPtr(float* velocity)
        {
            frontRightVelocity = velocity;
        }

        void setRearLeftVelocityPtr(float* velocity)
        {
            frontRightVelocity = velocity;
        }

        float* frontRightVelocity;
        float* frontLeftVelocity;
        float* rearRightVelocity;
        float* rearLeftVelocity;
    };
}

#endif