//Editor-Info: -*- C++ -*-
//
//Subject: SCOMS project / IE
//
//File:  callidentity.cpp 
//
//Version: $Revision: 1.1 $
//
//State: $State: Exp $
//
//Date: $Date: 1999/02/26 13:30:14 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Teemu Tynjälä
//
//Description:
//      Contains the code for Call Identity Information Element present
//      in DSS1 protocol.  See also the header file description
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 

#include "callidentity.h"

//-------------------------------------------------------------------

ieCallIdentity :: ieCallIdentity(pfUlong first4CallIdentityOctets_,
                                 pfUlong second4CallIdentityOctets_)
{
    _first4octets = first4CallIdentityOctets_;
    _second4octets = second4CallIdentityOctets_;
    return;
}

ieCallIdentity :: ieCallIdentity(const ieCallIdentity &other_)
{
    _first4octets = other_.getFirst4CallIdentityOctets();
    _second4octets = other_.getSecond4CallIdentityOctets();
    return;
}

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

//-------------------------------------------------------------------

const ieCallIdentity &ieCallIdentity :: operator=(
    const ieCallIdentity &other_)
{
    if (&other_ != this)
    {
        _first4octets = other_.getFirst4CallIdentityOctets();
        _second4octets = other_.getSecond4CallIdentityOctets();
    }
    return *this;
}


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

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

//---------------------------------------------------------------------

void ieCallIdentity :: setFirst4CallIdentityOctets(pfUlong value_)
{
    _first4octets = value_;
    return;
}

pfUlong ieCallIdentity :: getFirst4CallIdentityOctets(void) const
{
    return _first4octets;
}

void ieCallIdentity :: setSecond4CallIdentityOctets(pfUlong value_)
{
    _second4octets = value_;
    return;
}

pfUlong ieCallIdentity :: getSecond4CallIdentityOctets(void) const
{
    return _second4octets;
}
