//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project
//
//File: unitestccstate.cpp
//
//Version: $Revision: 1.6 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/10/16 05:10:56 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Jari Pusa
//
//Description:
//
//
//Copyright:
//
//
//Licence:
//
//
//History: 

#include "unitestccstate.h"

uniTestCCState *uniTestCCState :: _only = 0;

uniTestCCState :: uniTestCCState(void)
    : sigUpInputs(),
      pfState()
{
    return;
}

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

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

    return _only;
}

void uniTestCCState :: sigSETUPindAct(sigSETUPind *message_,
                                      pfProtocol *protocol_)
{
    cout << "Tester : sigSETUPind" << endl; 
    message_->print();

    uniTestCCProtocol *protocol = (uniTestCCProtocol*)protocol_;
    protocol->sendPROCEEDINGreq();
    protocol->connectCCs();
    protocol->sendSETUPreqToCC(message_);
    return;
}

void uniTestCCState :: sigPROCEEDINGindAct(sigPROCEEDINGind *message_,
                                           pfProtocol *)
{
    cout << "Tester : sigPROCEEDINGind" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigSETUPconfAct(sigSETUPconf *message_,
                                       pfProtocol *protocol_)
{
    cout << "Tester : sigSETUPconf" << endl;
    message_->print();

    uniTestCCProtocol *protocol = (uniTestCCProtocol*)protocol_;
    protocol->sendSETUPrespToCC(message_);
    protocol->sendSETUP_COMPLETEreq();
    return;
}

void uniTestCCState :: sigSETUP_COMPLETEindAct(sigSETUP_COMPLETEind *message_,
                                               pfProtocol *)
{
    cout << "Tester : sigSETUP_COMPLETEind" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigRELEASEindAct(sigRELEASEind *message_,
                                        pfProtocol *protocol_)
{
    uniTestCCProtocol *protocol = (uniTestCCProtocol *)protocol_;
    
    cout << "Tester : sigRELEASEind" << endl;
    message_->print();

    protocol->sendRELEASEreqToCC(message_);
    protocol->sendRELEASEresp();
    
    return;
}

void uniTestCCState :: sigRELEASEconfAct(sigRELEASEconf *message_,
                                         pfProtocol *)
{
    cout << "Tester : sigRELEASEconf" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigRESETindAct(sigRESETind *message_,
                                      pfProtocol *)
{
    cout << "Tester : sigRESETind" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigRESETconfAct(sigRESETconf *message_,
                                       pfProtocol *)
{
    cout << "Tester : sigRESETconf" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigRESET_ERRORindAct(sigRESET_ERRORind *message_,
                                            pfProtocol *)
{
    cout << "Tester : sigRESET_ERRORind" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigSETUPreqAct(sigSETUPreq *message_,
                                      pfProtocol *protocol_)
{
    cout << "Tester : sigSETUPreq" << endl;
    message_->print();

    uniTestCCProtocol *protocol = (uniTestCCProtocol*)protocol_;    
    protocol->sendSETUPreq(message_);
    return;
}

void uniTestCCState :: sigPROCEEDINGreqAct(sigPROCEEDINGreq *message_,
                                           pfProtocol *)
{
    cout << "Tester : sigPROCEEDINGreq" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigSETUPrespAct(sigSETUPresp *message_,
                                       pfProtocol *protocol_)
{
    cout << "Tester : sigSETUPresp" << endl;
    message_->print();

    uniTestCCProtocol *protocol = (uniTestCCProtocol*)protocol_;    
    protocol->sendSETUPresp(message_);
    return;
}

void uniTestCCState :: sigSETUP_COMPLETEreqAct(sigSETUP_COMPLETEreq *message_,
                                               pfProtocol *)
{
    cout << "Tester : sigSETUP_COMPLETEreq" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigRELEASEreqAct(sigRELEASEreq *message_,
                                        pfProtocol *protocol_)
{
    uniTestCCProtocol *protocol = (uniTestCCProtocol *)protocol_;

    cout << "Tester : sigRELEASEreq" << endl;
    message_->print();

    protocol->sendRELEASEreq(message_);
    
    return;
}

void uniTestCCState :: sigRELEASErespAct(sigRELEASEresp *message_,
                                         pfProtocol *)
{
    cout << "Tester : sigRELEASEresp" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigRESETreqAct(sigRESETreq *message_,
                                      pfProtocol *)
{
    cout << "Tester : sigRESETreq" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigRESETrespAct(sigRESETresp *message_,
                                       pfProtocol *)
{
    cout << "Tester : sigRESETresp" << endl;
    message_->print();

    return;
}

void uniTestCCState :: sigRESET_ERRORrespAct(sigRESET_ERRORresp *message_,
                                             pfProtocol *)
{
    cout << "Tester : sigRESET_ERRORresp" << endl;
    message_->print();

    return;
}

void uniTestCCState :: uniTESTtimeoutAct(pfProtocol *)
{
    cout << "TEST timeout" << endl;

    return;
}



















