//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / MTP3 protocol 
//
//File: mtp3protocol.cpp
//
//Version: $Revision: 1.16 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/08/10 07:50:27 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Timo Pärnänen
//      Petteri Koponen
//
//Description:
//      See the corresponding header file.
//
//Copyright:
//
//
//Licence:
//
//
//History:

#include "pf/messenge.h"
#include "common/ss7configure.h"
#include "mtp3state_protocol.h"
#include "mtp3protocol.h"

//
//Function: createProtocol
//      
//Description:
//    Static create method creates implementation of MTP3
//    protocol and returns a pointer to implementation.
//

mtp3Protocol *mtp3Protocol :: createProtocol(ss7Configure &configure_)
{
    mtp3Protocol *newProtocol = new mtp3Protocol(configure_);
    return newProtocol;
}

//
//Functions: constructor and destructor
//
//Description:
//    Implements default constructor and destructor.
//

mtp3Protocol :: mtp3Protocol(ss7Configure &configure_)
    : pfProtocol(),
      _HMDC(this, configure_),
      _HMDT(this, configure_),
      _HMRT(this, configure_)
{
    changeState(mtp3ProtocolState::instance());
    return;
}

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

//
//Functions: toLevelx
//
//Description:
//    These methods sends messages asynchronously to
//    neighboring levels.
//

void mtp3Protocol :: toLevel2(pfMessenger *messenger_)
{
    toA(messenger_);
    return;
}

void mtp3Protocol :: toLevel4(pfMessenger *messenger_)
{
    toB(messenger_);    
    return;
}

//
//Functions: to[Block]
//
//Description:
//    These methods sends messages synchronously to
//    functional blocks inside MTP3 protocol hierarchy.
//

void mtp3Protocol :: toHMDC(pfMessenger *messenger_)
{
    _HMDC.accept(messenger_);
    return;
}

void mtp3Protocol :: toHMDT(pfMessenger *messenger_)
{
    _HMDT.accept(messenger_);
    return;
}

void mtp3Protocol :: toHMRT(pfMessenger *messenger_)
{
    _HMRT.accept(messenger_);    
    return;
}

//
//Functions: connect methods
//
//Description:
//    These are used by mtpConfigTransporter to connect
//    AAL connections to AAL mux or user parts to userPart mux.

void mtp3Protocol :: connectSideAtoConduit(pfConduit &conduit_)
{
    conduit_.connectToB(_sideA);
    return;
}

void mtp3Protocol :: connectSideBtoConduit(pfConduit &conduit_)
{
    conduit_.connectToA(_sideB);
    return;
}






