//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project/CC
//
//File: cctdp_noanswer.cpp
//
//Version: $Revision: 1.7 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/11/11 14:56:17 $
//
//Organisation:
//      University of Technology
// 
//Author:
//      Pasi Nummisalo
//
//Description:
//      See header.
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//      
//Licence:
//     
//
//History:

#include "cctstate_selectfacility.h"
#include "cctstate_exception.h"
#include "ccprotocol.h"
#include "cctdp_noanswer.h"

ccTdpNoAnswer *ccTdpNoAnswer :: _only = 0;

ccTdpNoAnswer :: ccTdpNoAnswer(void)
{
    return;
}

ccTdpNoAnswer :: ~ccTdpNoAnswer(void)
{
    _only = 0;
    return;
}

ccTdpNoAnswer *ccTdpNoAnswer :: instance(void)
{
    if(_only == 0)
    {
        _only = new ccTdpNoAnswer;
        assert(_only != 0);
    }
    return _only;
}

toveinap_EventTypeBCSMType ccTdpNoAnswer :: getInapType(void) const
{
    return toveinap_tNoAnswer;
}

//
//Function: proceed
//
//Description:
//   This function is called from PIC when it is time
//   to check DP criteria. Function reads the right
//   dp object from protocol and passes it to common
//   process function in base class.
//
//

void ccTdpNoAnswer :: proceed(ccProtocol *protocol_)
{
#if CC_DEBUG
traceDp(ccCCT,"No Answer");
#endif
    
    process(protocol_->getDpValueObject(ccDpNoAnswer), protocol_);

    return;
}

//
//Function: toNextState
//
//Description:
//
//

void ccTdpNoAnswer :: toNextState(ccDp &, ccProtocol *protocol_)
{
    exitAction(protocol_, ccTstateException::instance());
    
    return;
}


//
//Functions: binap-inputs
//
//Description:
//
//

void ccTdpNoAnswer :: binapSELECT_FACILITYpduAct(
    binapSELECT_FACILITYpdu *,
    ccProtocol *protocol_)
{
    exitAction(protocol_, ccTstateSelectFacility::instance());
    
    return;
}

