//Editor-Info: -*- C++ -*-
//
//Subject: TOVE-project / UNI-AAL interface
//
//File: uaaldownprimitives.cpp
//
//Version: $Revision: 1.9 $
//
//State: $State: Exp $
//
//Date: $Date: 1997/07/18 14:45:13 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications and Multimedia
//
//Author:
//	Vesa-Matti Puro
//
//Description:
//	See corresponding header file.
//
//Copyright:
//
//
//Licence:
//
//
//History: 
//


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


//
// Index of Code
//
// 1. uaalESTABLISHreq
//    1.1. apply
// 2. uaalRELEASEreq
//    2.1. apply()
// 3. uaalDATAreq
//    3.1. apply()
//    3.2. setMessageUnit()
//    3.3. getMessageUnit()
// 4. uaalUNITDATAreq
//    4.1. apply()
//    4.2. setMessageUnit()
//    4.3. getMessageUnit()
//



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

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

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

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


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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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