/*
 * SPDX-FileCopyrightText: 2004 Copyright contributors to the cppTango project
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#ifndef TANGO_INTERNAL_SERVER_POLLCMDS_H
#define TANGO_INTERNAL_SERVER_POLLCMDS_H

#include <tango/server/Command.h>

namespace Tango
{

//=============================================================================
//
//            The PolledDevice class
//
// description :    Class to implement the PolledDevice command.
//            This class returns the name list of device actually
//            polled
//
//=============================================================================

class PolledDeviceCmd : public Command
{
  public:
    PolledDeviceCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc);

    ~PolledDeviceCmd() override { }

    CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any) override;
};

//=============================================================================
//
//            The DevPollStatus class
//
// description :    Class to implement the DevPollStatus command.
//            This class returns status of all commands and/or
//            attribute polled for a device
//
//=============================================================================

class DevPollStatusCmd : public Command
{
  public:
    DevPollStatusCmd(
        const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc);

    ~DevPollStatusCmd() override { }

    CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any) override;
};

//=============================================================================
//
//            The AddObjPolling class
//
// description :    Class to implement the AddObjPolling command.
//            This command add a new command/attribute in the list
//            of command/attribute to be polled
//
//=============================================================================

class AddObjPollingCmd : public Command
{
  public:
    AddObjPollingCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc);

    ~AddObjPollingCmd() override { }

    CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any) override;
};

//=============================================================================
//
//            The UpdObjPollingPeriod class
//
// description :    Class to implement the UpdObjPollingPeriod command.
//            This command updates an object update period
//
//=============================================================================

class UpdObjPollingPeriodCmd : public Command
{
  public:
    UpdObjPollingPeriodCmd(const char *cmd_name,
                           Tango::CmdArgType in,
                           Tango::CmdArgType out,
                           const std::string &in_desc);

    ~UpdObjPollingPeriodCmd() override { }

    CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any) override;
};

//=============================================================================
//
//            The RemObjPolling class
//
// description :    Class to implement the RemObjPolling command.
//            This command removes one object of the device polling
//            list
//
//=============================================================================

class RemObjPollingCmd : public Command
{
  public:
    RemObjPollingCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc);

    ~RemObjPollingCmd() override { }

    CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any) override;
};

//=============================================================================
//
//            The StopPolling class
//
// description :    Class to implement the StopPolling command.
//            This command stops the polling thread
//
//=============================================================================

class StopPollingCmd : public Command
{
  public:
    StopPollingCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out);

    ~StopPollingCmd() override { }

    CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any) override;
};

//=============================================================================
//
//            The StartPolling class
//
// description :    Class to implement the StartPolling command.
//            This command starts the polling thread
//
//=============================================================================

class StartPollingCmd : public Command
{
  public:
    StartPollingCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out);

    ~StartPollingCmd() override { }

    CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any) override;
};

} // namespace Tango

#endif // TANGO_INTERNAL_SERVER_POLLCMDS_H
