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

#ifndef TANGO_TEST_DEVICE_SERVER_GENERIC_DSERVERIMPL_H
#define TANGO_TEST_DEVICE_SERVER_GENERIC_DSERVERIMPL_H

#include "DevTestClass.h"

#include <tango/tango.h>

namespace DevTest_ns
{
//
// Create DevTestClass singleton and store it in DServer object
//

class DServerImpl : public Tango::DServer
{
  public:
    DServerImpl(Tango::DeviceClass *cl_ptr,
                const std::string &name,
                const std::string &desc,
                Tango::DevState state,
                const std::string &status) :
        DServer(cl_ptr, name.c_str(), desc.c_str(), state, status.c_str())
    {
    }

  private:
    void class_factory()
    {
        add_class(DevTestClass::init("DevTest"));
    }
};

inline Tango::DServer *constructor(Tango::DeviceClass *cl_ptr,
                                   const std::string &name,
                                   const std::string &desc,
                                   Tango::DevState state,
                                   const std::string &status)
{
    return new DServerImpl(cl_ptr, name, desc, state, status);
}
} // namespace DevTest_ns
#endif
