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

#include "aalparameters.h"

ieAALParameters :: ieAALParameters(AALtype type_)
    : ieInformationElement(),
      _type(type_),
      _subtype(0),
      _CBRRate(0),
      _multiplier(0),
      _sourceClockRecovery(0),
      _errorCorrectionMethod(0),
      _dataTransferBlocksize(0),
      _partiallyFilled(0),
      _forwardMaxSDUSize(0),
      _backwardMaxSDUSize(0),
      _MIDRangeLow(0),
      _MIDRangeHigh(0),
      _SSCSType(0),
      _userDefinedInfo(0),
      _subtypeSet(false),
      _CBRRateSet(false),
      _multiplierSet(false),
      _sourceClockRecoverySet(false),
      _errorCorrectionMethodSet(false),
      _dataTransferBlocksizeSet(false),
      _partiallyFilledSet(false),
      _forwardMaxSDUSizeSet(false),
      _backwardMaxSDUSizeSet(false),
      _MIDRangeLowSet(false),
      _MIDRangeHighSet(false),
      _SSCSTypeSet(false),
      _userDefinedInfoSet(false)
{
    return;
}

ieAALParameters :: ieAALParameters(
    const ieAALParameters &other_)
    :  ieInformationElement(),
       _type(other_._type),
       _subtype(other_._subtype),
       _CBRRate(other_._CBRRate),
       _multiplier(other_._multiplier),
       _sourceClockRecovery(other_._sourceClockRecovery),
       _errorCorrectionMethod(other_._errorCorrectionMethod),
       _dataTransferBlocksize(other_._dataTransferBlocksize),
       _partiallyFilled(other_._partiallyFilled),
       _forwardMaxSDUSize(other_._forwardMaxSDUSize),
       _backwardMaxSDUSize(other_._backwardMaxSDUSize),
       _MIDRangeLow(other_._MIDRangeLow),
       _MIDRangeHigh(other_._MIDRangeHigh),
       _SSCSType(other_._SSCSType),
       _userDefinedInfo(other_._userDefinedInfo),
       _subtypeSet(other_._subtypeSet),
       _CBRRateSet(other_._CBRRateSet),
       _multiplierSet(other_._multiplierSet),
       _sourceClockRecoverySet(other_._sourceClockRecoverySet),
       _errorCorrectionMethodSet(other_._errorCorrectionMethodSet),
       _dataTransferBlocksizeSet(other_._dataTransferBlocksizeSet),
       _partiallyFilledSet(other_._partiallyFilledSet),
       _forwardMaxSDUSizeSet(other_._forwardMaxSDUSizeSet),
       _backwardMaxSDUSizeSet(other_._backwardMaxSDUSizeSet),
       _MIDRangeLowSet(other_._MIDRangeLowSet),
       _MIDRangeHighSet(other_._MIDRangeHighSet),
      _SSCSTypeSet(other_._SSCSTypeSet),
       _userDefinedInfoSet(other_._userDefinedInfoSet)
{
    return;
}

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

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

const ieAALParameters &ieAALParameters :: operator=(
    const ieAALParameters &other_)
{
    if (&other_ != this)
    {
        _type = other_._type;
        _subtype = other_._subtype;
        _CBRRate = other_._CBRRate;
        _multiplier = other_._multiplier;
        _sourceClockRecovery = other_._sourceClockRecovery;
        _errorCorrectionMethod = other_._errorCorrectionMethod;
        _dataTransferBlocksize = other_._dataTransferBlocksize;
        _partiallyFilled = other_._partiallyFilled;
        _forwardMaxSDUSize = other_._forwardMaxSDUSize;
        _backwardMaxSDUSize = other_._backwardMaxSDUSize;
        _MIDRangeLow = other_._MIDRangeLow;
        _MIDRangeHigh = other_._MIDRangeHigh;
        _SSCSType = other_._SSCSType;
        _userDefinedInfo = other_._userDefinedInfo;
        _subtypeSet = other_._subtypeSet;
        _CBRRateSet = other_._CBRRateSet;
        _multiplierSet = other_._multiplierSet;
        _sourceClockRecoverySet = other_._sourceClockRecoverySet;
        _errorCorrectionMethodSet = other_._errorCorrectionMethodSet;
        _dataTransferBlocksizeSet  = other_._dataTransferBlocksizeSet;
        _partiallyFilledSet = other_._partiallyFilledSet;
        _forwardMaxSDUSizeSet = other_._forwardMaxSDUSizeSet;
        _backwardMaxSDUSizeSet = other_._backwardMaxSDUSizeSet;
        _MIDRangeLowSet = other_._MIDRangeLowSet;
        _MIDRangeHighSet = other_._MIDRangeHighSet;
        _SSCSTypeSet = other_._SSCSTypeSet;
        _userDefinedInfoSet = other_._userDefinedInfoSet;
    }
    return *this; 
}

pfUlong ieAALParameters :: getType(void) const
{
    return _type;
}


// AAL1
void ieAALParameters :: setSubtype(pfUlong value_)
{
    _subtype = value_;
    _subtypeSet = true;
    return;
}

void ieAALParameters :: setMultiplier(pfUlong value_)
{
    _multiplier = value_;
    _multiplierSet = true;
    return;
}
void ieAALParameters :: setSourceClockRecovery(pfUlong value_)
{
    _sourceClockRecovery = value_;
    _sourceClockRecoverySet = true;
    return;
}
void ieAALParameters :: setErrorCorrectionMethod(pfUlong value_)
{
    _errorCorrectionMethod = value_;
    _errorCorrectionMethodSet = true;
    return;
}
void ieAALParameters :: setDataTransferBlocksize(pfUlong value_)
{
    _dataTransferBlocksize = value_;
    _dataTransferBlocksizeSet = true;
    return;
}

void ieAALParameters :: setPartiallyFilled(pfUlong value_)
{
    _partiallyFilled = value_;
    _partiallyFilledSet = true;
    return;
}

pfUlong ieAALParameters :: getSubtype(void) const
{
    return _subtype;
}

pfUlong ieAALParameters :: getMultiplier(void) const
{
    return _multiplier;
}

pfUlong ieAALParameters :: getSourceClockRecovery(void) const
{
    return _sourceClockRecovery;
}

pfUlong ieAALParameters :: getErrorCorrectionMethod(void) const
{
    return _errorCorrectionMethod;
}

pfUlong ieAALParameters :: getDataTransferBlocksize(void) const
{
    return _dataTransferBlocksize;
}

pfUlong ieAALParameters :: getPartiallyFilled(void) const
{
    return _partiallyFilled;
}

bool ieAALParameters :: isSubtype(void) const
{
    return _subtypeSet;
}

bool ieAALParameters :: isMultiplier(void) const
{
    return _multiplierSet;
}

bool ieAALParameters :: isSourceClockRecovery(void) const
{
    return _sourceClockRecoverySet;
}

bool ieAALParameters :: isErrorCorrectionMethod(void) const
{
    return _errorCorrectionMethodSet;
}

bool ieAALParameters :: isDataTransferBlocksize(void) const
{
    return _dataTransferBlocksizeSet;
}

bool ieAALParameters :: isPartiallyFilled(void) const
{
    return _partiallyFilledSet;
}


// AAL3/4, AAL5
void ieAALParameters :: setForwardMaxSDUSize(pfUlong value_)
{
    _forwardMaxSDUSize = value_;
    _forwardMaxSDUSizeSet = true;
    return;
}

void ieAALParameters :: setBackwardMaxSDUSize(pfUlong value_)
{
    _backwardMaxSDUSize = value_;
    _backwardMaxSDUSizeSet = true;
    return;
}

void ieAALParameters :: setMIDRangeLow(pfUlong value_)
{
    _MIDRangeLow = value_;
    _MIDRangeLowSet = true;
    return;
}

void ieAALParameters :: setMIDRangeHigh(pfUlong value_)
{
    _MIDRangeHigh = value_;
    _MIDRangeHighSet = true;
    return;
}

void ieAALParameters :: setSSCSType(pfUlong value_)
{
    _SSCSType = value_;
    _SSCSTypeSet = true;
    return;
}

pfUlong ieAALParameters :: getForwardMaxSDUSize(void) const
{
    return _forwardMaxSDUSize;
}

pfUlong ieAALParameters :: getBackwardMaxSDUSize(void) const
{
    return _backwardMaxSDUSize;
}

pfUlong ieAALParameters :: getMIDRangeLow(void) const
{
    return _MIDRangeLow;
}

pfUlong ieAALParameters :: getMIDRangeHigh(void) const
{
    return _MIDRangeHigh;
}

pfUlong ieAALParameters :: getSSCSType(void) const
{
    return _SSCSType;
}

bool ieAALParameters :: isForwardMaxSDUSize(void) const
{
    return _forwardMaxSDUSizeSet;
}


bool ieAALParameters :: isBackwardMaxSDUSize(void) const
{
    return _backwardMaxSDUSizeSet;
}

bool ieAALParameters :: isMIDRangeLow(void) const
{
    return _MIDRangeLowSet;
}

bool ieAALParameters :: isMIDRangeHigh(void) const
{
    return _MIDRangeHighSet;
}

bool ieAALParameters :: isSSCSType(void) const
{
    return _SSCSTypeSet;
}


// user defined AAL
void ieAALParameters :: setUserDefinedInfo(pfUlong value_)
{
    _userDefinedInfo = value_;
    _userDefinedInfoSet = true;
    return;
}

pfUlong ieAALParameters :: getUserDefinedInfo(void) const
{
    return _userDefinedInfo;
}

bool ieAALParameters :: isUserDefinedInfo(void) const
{
    return _userDefinedInfoSet;
}
