//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / SCCP protocol
//
//File: sccpstate_protocol.cpp
//
//Version: $Revision: 1.4 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/02/04 19:06:26 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Timo Pärnänen
//
//Description:
//      See corresponding header file.
//
//Copyright:
//
//
//Licence:
//
//
//History: 

#include "sccpprotocol.h"
#include "sccpstate_protocol.h"

// Implementation of the singleton pattern

sccpProtocolState *sccpProtocolState::_only = 0;

sccpProtocolState *sccpProtocolState :: instance(void)
{
    if (_only == 0)
    {
        _only = new sccpProtocolState;
    }
    return _only;
}

sccpProtocolState :: sccpProtocolState(void)
{
    return;
}

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

// primitives from upper layer

void sccpProtocolState :: sccpN_UNITDATAreqAct(sccpN_UNITDATAreq *messenger_,
                                               pfProtocol *protocol_)
{
    ((sccpProtocol *) protocol_)->toSCLC(messenger_);
    return;
}
        
// primitives from lower layer

void sccpProtocolState :: mtpTRANSFERindAct(mtpTRANSFERind *messenger_,
                                            pfProtocol *protocol_)
{
    ((sccpProtocol *) protocol_)->toSCRC(messenger_);
    return;
}
