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

#include <tango/client/NamedDevFailedList.h>

#include <memory>
#include <string>
#include <vector>

namespace Tango
{
class DeviceProxy;

/**
 * Asynchronous write attribute execution callback data
 *
 * This class is used to pass data to the callback method in asynchronous callback model for write_attribute(s)
 * execution.
 *
 *
 * @headerfile tango.h
 * @ingroup Client
 */

class AttrWrittenEvent
{
  public:
    ///@privatesection
    AttrWrittenEvent(DeviceProxy *dev, std::vector<std::string> &att_names, NamedDevFailedList &err_in) :
        device(dev),
        attr_names(att_names),
        errors(err_in)
    {
        err = errors.call_failed();
    }

    ///@publicsection
    Tango::DeviceProxy *device{nullptr};  ///< The DeviceProxy object on which the call was executed
    std::vector<std::string> &attr_names; ///< The attribute name list
    bool err{false};                      ///< A boolean flag set to true if the request failed. False otherwise
    NamedDevFailedList &errors;           ///< The error stack

  private:
    class AttrWrittenEventExt
    {
      public:
        AttrWrittenEventExt() { }
    };

    std::unique_ptr<AttrWrittenEventExt> ext;
};
} // namespace Tango
#endif
