//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project/CC
//
//File: ccindications.cpp
//
//Version: $Revision: 1.17 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/12/03 11:31:52 $
//
//Organisation:
//      University of Technology
// 
//Author:
//      Pasi Nummisalo
//
//Description:
//     
//
//Copyright:
//     University of Technology
//     Laboratory of Telecommunications and Multimedia 
//      
//Licence:
//     
//
//History:
//


#include "ccindications.h"
#include "ccostate.h"
#include "ccdpstate.h"


ccIndications :: ccIndications(void)
    : pfMessenger()
{
    return;
}

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

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

ccSETUPpdu :: ccSETUPpdu(pfStorage &data_)
    : ccIndications()
{
    fetch(data_);

    return;
}

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


void ccSETUPpdu :: apply(pfState *state_, pfProtocol *protocol_)
{
    ccInputs *input = dynamic_cast<ccInputs*>(state_);
    assert(input != 0);

    ccProtocol *ccprotocol = dynamic_cast<ccProtocol*>(protocol_);
    assert(ccprotocol != 0);
    
    input->ccSETUPpduAct(this, ccprotocol);

    return;
}

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

void ccALERTINGpdu :: apply(pfState *state_, pfProtocol *protocol_)
{
    ccInputs *input = dynamic_cast<ccInputs*>(state_);
    assert(input != 0);

    ccProtocol *ccprotocol = dynamic_cast<ccProtocol*>(protocol_);
    assert(ccprotocol != 0);
    
    input->ccALERTINGpduAct(this, ccprotocol);

    return;
}

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

void ccRELEASEpdu :: apply(pfState *state_, pfProtocol *protocol_)
{
    ccInputs *input = dynamic_cast<ccInputs*>(state_);
    assert(input != 0);

    ccProtocol *ccprotocol = dynamic_cast<ccProtocol*>(protocol_);
    assert(ccprotocol != 0);
    
    input->ccRELEASEpduAct(this, ccprotocol);

    return;
}

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

void ccRELEASE_ACTIVEpdu :: apply(pfState *state_, pfProtocol *protocol_)
{
    ccInputs *input = dynamic_cast<ccInputs*>(state_);
    assert(input != 0);

    ccProtocol *ccprotocol = dynamic_cast<ccProtocol*>(protocol_);
    assert(ccprotocol != 0);
    
    input->ccRELEASE_ACTIVEpduAct(this, ccprotocol);

    return;
}

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

string  const ccTimerSSFtimeout :: timerName("SSF");
pfUlong const ccTimerSSFtimeout :: value1 = 4000;
pfUlong const ccTimerSSFtimeout :: value2 = 2000;


pfTimerMessenger *ccTimerSSFtimeout :: create(void)
{
    ccTimerSSFtimeout *messenger = new ccTimerSSFtimeout;
    return messenger;
}

ccTimerSSFtimeout :: ccTimerSSFtimeout(void)
    : pfTimerMessenger()
{
    return;
}

ccTimerSSFtimeout :: ccTimerSSFtimeout(const ccTimerSSFtimeout &other_)
    : pfTimerMessenger(other_)
{
    return;
}

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

pfTimerMessenger *ccTimerSSFtimeout :: clone(void) const
{
    ccTimerSSFtimeout *messenger = new ccTimerSSFtimeout(*this);
    return messenger;
}

void ccTimerSSFtimeout :: apply(pfState *state_, pfProtocol *protocol_)
{
    ccDpState *input = dynamic_cast<ccDpState*>(state_);
    assert(input != 0);
    
    input->ccTimerSSFtimeoutAct(protocol_);
    return;
}


