//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / UNI
//
//File: unierrorinfo.cpp
//
//Version: $Revision: 1.3 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/12/14 06:56:32 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Jari Katajavuori
//
//Description:
//      Error info contains specified information about occured
//      error condition.
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 

#include "unierrorinfo.h"

#include "unistrings.h"

uniErrorInfo :: uniErrorInfo(pfUlong cause_)
    : pfStorage(),
      _fatalError(0)
{
    defineInteger(uniCause_LocationStr);
    defineInteger(uniCause_ValueStr);

    setInteger(uniCause_LocationStr, 0);
    setInteger(uniCause_ValueStr, cause_);

    return;
}

uniErrorInfo :: uniErrorInfo(const uniErrorInfo &other_)
    : pfStorage(other_),
      _fatalError(other_._fatalError)
{
    return;
}

uniErrorInfo :: ~uniErrorInfo(void)
{
    return;
}

pfUlong uniErrorInfo :: getCause(void)
{
    pfUlong cause = getInteger(uniCause_ValueStr);
    return cause;
}

void uniErrorInfo :: setIEid(pfUlong id_)
{
    if (isVariableDefined(uniCause_IETypeStr) == 0)
    {
        defineInteger(uniCause_IETypeStr);
    }
    setInteger(uniCause_IETypeStr, id_);
    return;
}

void uniErrorInfo :: setMessageType(pfUlong type_)
{
    if (isVariableDefined(uniCause_MessageTypeStr) == 0)
    {
        defineInteger(uniCause_MessageTypeStr);
    }
    setInteger(uniCause_MessageTypeStr, type_);
    return;
}

void uniErrorInfo :: setIEList(pfFrame list_)
{
    if (isVariableDefined(uniCause_IETypeListStr) == 0)
    {
        defineFrame(uniCause_IETypeListStr);
    }
    setFrame(uniCause_IETypeListStr, list_);
    return;
}

void uniErrorInfo :: setFatalError(void)
{
    _fatalError = 1;
    return;
}

bool uniErrorInfo :: isFatalError(void)
{
    return _fatalError;
}

