//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project
//
//File: gsmptimeouts.cpp
//
//Version: $Revision: 1.5 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/12/16 16:57:24 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Harri Sunila
//
//Description:
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 

#include "gsmptimeouts.h"
#include "pf/error.h"

//
// Class: gsmpSYNCtimeout
//
// Description:
//     This class is used to create Adjacency Protocol
//     SYNC timeout messengers
//

//
// Function: gsmpSYNCtimeout
//
// Description:
//     Constructor
//

gsmpSYNCtimeout :: gsmpSYNCtimeout(void)
    : pfTimerMessenger()
{
    return;
}

//
// Function: gsmpSYNCtimeout
//
// Description:
//     Copy constructor
//

gsmpSYNCtimeout :: gsmpSYNCtimeout(const gsmpSYNCtimeout &other_)
    : pfTimerMessenger(other_)
{
    return;
}

//
// Function: ~gsmpSYNCtimeout 
//
// Description:
//     Destructor
//

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

//
// Function: apply
//
// Description:  
//

void gsmpSYNCtimeout :: apply(pfState *state_, pfProtocol *protocol_)
{
    gsmpAdjacencyState *state = dynamic_cast<gsmpAdjacencyState *>(state_);
    gsmpAdjacencyProtocol *protocol = dynamic_cast<gsmpAdjacencyProtocol *>(
        protocol_);
    THROW_IF_DYNAMIC_CAST_FAILED(state);
    THROW_IF_DYNAMIC_CAST_FAILED(protocol);
    state->gsmpAdjacencySYNCtimeoutAct(protocol);
    return;
}

//
// Function: clone 
//
// Description:  
//

pfTimerMessenger *gsmpSYNCtimeout :: clone(void) const
{
    pfTimerMessenger *messenger = new gsmpSYNCtimeout(*this);
    return messenger;
}

//
// Class: gsmpResyncTimeout
//
// Description:
//     This class is used to create Adjacency Protocol
//     Resync timeout messengers
//

//
// Function: gsmpResyncTimeout
//
// Description:
//     Constructor
//

gsmpResyncTimeout :: gsmpResyncTimeout(void)
    : pfTimerMessenger()
{
    return;
}

//
// Function: gsmpResyncTimeout
//
// Description:
//     Copy constructor
//

gsmpResyncTimeout :: gsmpResyncTimeout(const gsmpResyncTimeout &other_)
    : pfTimerMessenger(other_)
{
    return;
}

//
// Function: ~gsmpResyncTimeout 
//
// Description:
//     Destructor
//

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

//
// Function: apply
//
// Description:  
//

void gsmpResyncTimeout :: apply(pfState *state_, pfProtocol *protocol_)
{
    gsmpAdjacencyState *state = dynamic_cast<gsmpAdjacencyState *>(state_);
    gsmpAdjacencyProtocol *protocol = dynamic_cast<gsmpAdjacencyProtocol *>(
        protocol_);
    THROW_IF_DYNAMIC_CAST_FAILED(state);
    THROW_IF_DYNAMIC_CAST_FAILED(protocol);
    state->gsmpAdjacencyResyncTimeoutAct(protocol);
    return;
}

//
// Function: clone 
//
// Description:  
//

pfTimerMessenger *gsmpResyncTimeout :: clone(void) const
{
    pfTimerMessenger *messenger = new gsmpResyncTimeout(*this);
    return messenger;
}

//
// Class: gsmpRetryTimeout
//
// Description:
//     This class is used to create Adjacency Protocol
//     Retry timeout messengers
//

//
// Function: gsmpRetryTimeout
//
// Description:
//     Constructor
//

gsmpRetryTimeout :: gsmpRetryTimeout(void)
    : pfTimerMessenger()
{
    return;
}

//
// Function: gsmpRetryTimeout
//
// Description:
//     Copy constructor
//

gsmpRetryTimeout :: gsmpRetryTimeout(const gsmpRetryTimeout &other_)
    : pfTimerMessenger(other_)
{
    return;
}

//
// Function: ~gsmpRetryTimeout 
//
// Description:
//     Destructor
//

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

//
// Function: apply
//
// Description:  
//

void gsmpRetryTimeout :: apply(pfState *state_, pfProtocol *protocol_)
{
    gsmpAdjacencyState *state = dynamic_cast<gsmpAdjacencyState *>(state_);
    gsmpAdjacencyProtocol *protocol = dynamic_cast<gsmpAdjacencyProtocol *>(
        protocol_);
    THROW_IF_DYNAMIC_CAST_FAILED(state);
    THROW_IF_DYNAMIC_CAST_FAILED(protocol);
    state->gsmpAdjacencyRetryTimeoutAct(protocol);
    return;
}

//
// Function: clone 
//
// Description:  
//

pfTimerMessenger *gsmpRetryTimeout :: clone(void) const
{
    pfTimerMessenger *messenger = new gsmpRetryTimeout(*this);
    return messenger;
}

//
// Class: gsmpResponseTimeout
//
// Description: 
//

//
// Function: gsmpResponseTimeout
//
// Description:  
//

gsmpResponseTimeout :: gsmpResponseTimeout(void)
    : pfTimerMessenger(),
      _transactionIdentifier(0)
{
    return;
}

//
// Function: gsmpResponseTimeout
//
// Description:  
//

gsmpResponseTimeout :: gsmpResponseTimeout(pfUlong transactionIdentifier_)
    : pfTimerMessenger(),
      _transactionIdentifier(transactionIdentifier_)
{
    return;
}

//
// Function: gsmpResponseTimeout
//
// Description:  
//

gsmpResponseTimeout :: gsmpResponseTimeout(const gsmpResponseTimeout &other_)
    : pfTimerMessenger(other_),
      _transactionIdentifier(other_._transactionIdentifier)
{
    return;
}

//
// Function: gsmpResponseTimeout
//
// Description:  
//

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

//
// Function: apply
//
// Description:  
//

void gsmpResponseTimeout :: apply(pfState *state_, pfProtocol *protocol_)
{
    gsmpProtocolState *state = dynamic_cast<gsmpProtocolState *>(state_);
    gsmpProtocol *protocol = dynamic_cast<gsmpProtocol *>(protocol_);
    THROW_IF_DYNAMIC_CAST_FAILED(state);
    THROW_IF_DYNAMIC_CAST_FAILED(state);
    state->gsmpResponseTimeoutAct(this, protocol);
    return;
}

//
// Function: clone
//
// Description:  
//

gsmpResponseTimeout *gsmpResponseTimeout :: clone(void) const
{
    gsmpResponseTimeout *messenger = new gsmpResponseTimeout(*this);
    return messenger;
}

//
// Function: getTransactionIdenfifier
//
// Description:  
//

pfUlong gsmpResponseTimeout :: getTransactionIdentifier(void)
{
    return _transactionIdentifier;
}
