//Editor-Info: -*- C++ -*-
//
//Subject: TOVE-project / UNI-AAL interface
//
//File: lapddownprimitives.cpp
//
//Version: $Revision: 1.2 $
//
//State: $State: Exp $
//
//Date: $Date: 1999/02/26 06:38:48 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications and Multimedia
//
//Author:
//	Teemu Tynjälä
//
//Description:
//	Codes the primitives that are passed down from the 
//      DSS1 Coordprotocol to LAPD protocol.
//
//Copyright:
//
//
//Licence:
//
//
//History: 
//


#include <assert.h>
#include "lapddownprimitives.h"
#include "pf/state.h"


//
// Index of Code
//
// 1. lapdESTABLISHreq
//    1.1. apply
// 2. lapdDATAreq
//    2.1. apply()
//    2.2. setMessageUnit()
//    2.3. getMessageUnit()
//



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

lapdESTABLISHreq :: lapdESTABLISHreq(void)
    : pfMsgTransporter(0)
{
    return;
}

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

const lapdESTABLISHreq& lapdESTABLISHreq :: operator=(
                             const lapdESTABLISHreq &other_)
{
    return *this;
}
    

void lapdESTABLISHreq :: atProtocol(pfProtocol *protocol_, pfState *state_)
{
    lapdDownInputs *downInput = dynamic_cast<lapdDownInputs *>(state_);
    assert(downInput != 0);
    downInput->lapdESTABLISHreqAct(this, protocol_);
    return;
}


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

lapdDATAreq :: lapdDATAreq(void)
    : pfMsgTransporter(0),
      _messageUnit()
{
    return;
}

lapdDATAreq :: lapdDATAreq(const pfFrame &frame_)
  : pfMsgTransporter(0),
    _messageUnit(frame_)
{
    return;
}

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

const lapdDATAreq& lapdDATAreq :: operator=(
                          const lapdDATAreq &other_)
{
    if (&other_ != this)
    {
      _messageUnit=other_._messageUnit;
    }
    return *this;
}

void lapdDATAreq :: atProtocol(pfProtocol *protocol_, pfState *state_)
{
    lapdDownInputs *downInput = dynamic_cast<lapdDownInputs *>(state_);
    assert(downInput != 0);
    downInput->lapdDATAreqAct(this, protocol_);
    return;
}

void lapdDATAreq :: setMessageUnit(const pfFrame &frame_)
{
    _messageUnit = frame_;
    return;
}

pfFrame lapdDATAreq :: getMessageUnit(void) const
{
    return _messageUnit;
}
 


