//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project/CC
//
//File: cctstate_exception.cpp
//
//Version: $Revision: 1.5 $
//
//State: $State: Exp $
//
//Date: $Date: 1997/12/08 16:27:24 $
//
//Organisation:
//      University of Technology
// 
//Author:
//      Pasi Nummisalo
//
//Description:
//     
//
//Copyright:
//     University of Technology
//     Laboratory of Telecommunications and Multimedia 
//      
//Licence:
//     
//
//History:
//

#include "protocol/cc/ccprotocol.h"
#include "cctstate_null.h"
#include "cctstate_exception.h"

ccTstateException *ccTstateException :: _only = 0;

ccTstateException :: ccTstateException(void)
    : ccTstate()
{
    return;
}

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

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

//
//Function: proceed
//
//Description:  
//    Entry event: An exception condition is encountered.
//
//

void ccTstateException :: proceed(ccProtocol *protocol_)
{
#if CC_DEBUG
traceState(ccCCT,"Exception");
#endif

    // ++TODO++
    // Default handling of the exception condition is being provided
    // This includes general actions necassary to ensure no resources
    // remain inappropriately allocated.

    // Handling completed
    exitAction(protocol_, ccTstateNull::instance()); 
    
    return;
}


