//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / IE
//
//File: cause.cpp
//
//Version: $Revision: 1.5 $
//
//State: $State: Exp $
//
//Date: $Date: 1999/03/10 16:05:42 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Sami Raatikainen
//      Timo Kokkonen
//
//Description:
//      See corresponding header file.
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 

#include "cause.h"
#include "pf/error.h"

ieCause :: ieCause(pfUlong value_, pfUlong location_)
    : ieInformationElement(),
      _causeValue(value_),
      _location(location_)
{
    return;
}

ieCause :: ieCause(const ieCause &other_)
    : _causeValue(other_._causeValue),
      _location(other_._location)
{
    return;
}

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

const ieCause &ieCause :: operator=(const ieCause &other_)
{
    if (&other_ != this)
    {
        _causeValue = other_._causeValue;
        _location = other_._location;
    }
    return *this;
}

ieCause* ieCause :: narrow(pfIE *ie_)
{
    ieCause *result =
        dynamic_cast<ieCause*>(ie_);
    THROW_IF_DYNAMIC_CAST_FAILED(result);
    return result;
}

pfIE *ieCause :: clone(void) const
{
    ieCause *newIe = new ieCause(*this);
    return (pfIE *)newIe;
}

void ieCause :: setCauseValue(pfUlong value_)
{
    _causeValue = value_;
    return;
}

pfUlong ieCause :: getCauseValue(void) const
{
    return _causeValue;
}

void ieCause :: setLocation(pfUlong value_)
{
    _location = value_;
    return;
}

pfUlong ieCause :: getLocation(void) const
{
    return _location;
}
