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

#include <tango/common/defines.h>

#ifdef TANGO_USE_TELEMETRY

  #include <tango/common/telemetry/Interface.h>

namespace Tango::telemetry
{

//-----------------------------------------------------------------------------------------------------------------
//! A telemetry Interface factory.
//-----------------------------------------------------------------------------------------------------------------
class InterfaceFactory
{
  public:
    //-----------------------------------------------------------------------------------------------------------------
    //! Create a new Interface object.
    //!
    //! This factory function might throw a Tango::DevFailed in case the instantiation of the underlying interface
    //! failed - it will notably be the case if one of telemetry endpoints is ill-formed.
    //!
    //! @param cfg the v configuration.
    //!
    //! \throws Tango::DevFailed (see description)
    //!
    //! \see Configuration
    //-----------------------------------------------------------------------------------------------------------------
    static InterfacePtr create(const Tango::telemetry::Configuration &cfg);

  private:
    InterfaceFactory() = delete;
};

} // namespace Tango::telemetry

#endif // TANGO_USE_TELEMETRY

#endif // TANGO_COMMON_TELEMETRY_INTERFACEFACTORY_H
