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

#include <tango/client/GroupReply.h>

//-----------------------------------------------------------------------------
// LOCAL DEBUGGING MACRO
//-----------------------------------------------------------------------------
// #define _LOCAL_DEBUGGING

namespace Tango
{
//=============================================================================
// STATIC MEMBERS
//=============================================================================
bool GroupReply::exception_enabled = false;

//=============================================================================
// class GroupReply
//=============================================================================
GroupReply::GroupReply() :
    dev_name_m("unknown"),
    obj_name_m("unknown"),
    has_failed_m(false),
    group_element_enabled_m(true)
{
}

//-----------------------------------------------------------------------------
GroupReply::GroupReply(const std::string &_dev_name, const std::string &_obj_name, bool group_element_enabled) :
    dev_name_m(_dev_name),
    obj_name_m(_obj_name),
    has_failed_m(false),
    group_element_enabled_m(group_element_enabled)
{
}

//-----------------------------------------------------------------------------
GroupReply::GroupReply(const std::string &_dev_name,
                       const std::string &_obj_name,
                       const Tango::DevFailed &exception,
                       bool group_element_enabled) :
    dev_name_m(_dev_name),
    obj_name_m(_obj_name),
    has_failed_m(true),
    group_element_enabled_m(group_element_enabled),
    exception_m(exception)
{
}

//-----------------------------------------------------------------------------
GroupReply::~GroupReply() = default;

GroupReply::GroupReply(const GroupReply &) = default;
GroupReply &GroupReply::operator=(const GroupReply &) = default;

GroupReply::GroupReply(GroupReply &&) = default;
GroupReply &GroupReply::operator=(GroupReply &&) = default;

//-----------------------------------------------------------------------------
bool GroupReply::enable_exception(bool exception_mode)
{
    bool tmp = GroupReply::exception_enabled;
    GroupReply::exception_enabled = exception_mode;
    return tmp;
}

} // namespace Tango
