/*
 * Copyright (c) 2013, AllSeen Alliance. All rights reserved.
 *
 *    Permission to use, copy, modify, and/or distribute this software for any
 *    purpose with or without fee is hereby granted, provided that the above
 *    copyright notice and this permission notice appear in all copies.
 *
 *    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 *    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 *    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 *    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 *    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 *    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 *    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
#include "SessionLostReasonInterface.h"

#include <qcc/Debug.h>

#define QCC_MODULE "ALLJOYN_JS"

std::map<qcc::String, int32_t> _SessionLostReasonInterface::constants;

std::map<qcc::String, int32_t>& _SessionLostReasonInterface::Constants()
{
    if (constants.empty()) {
        CONSTANT("INVALID",                     0x00); /**< Invalid */
        CONSTANT("REMOTE_END_LEFT_SESSION",     0x01); /**< Remote end called LeaveSession */
        CONSTANT("REMOTE_END_CLOSED_ABRUPTLY",  0x02); /**< Remote end closed abruptly */
        CONSTANT("REMOVED_BY_BINDER",           0x03); /**< Session binder removed this endpoint by calling RemoveSessionMember */
        CONSTANT("LINK_TIMEOUT",                0x04); /**< Link was timed-out */
        CONSTANT("REASON_OTHER",                0x05); /**< Unspecified reason for session loss */
    }
    return constants;
}

_SessionLostReasonInterface::_SessionLostReasonInterface(Plugin& plugin) :
    ScriptableObject(plugin, Constants())
{
    QCC_DbgTrace(("%s", __FUNCTION__));
}

_SessionLostReasonInterface::~_SessionLostReasonInterface()
{
    QCC_DbgTrace(("%s", __FUNCTION__));
}

