//Editor-Info: -*- C++ -*-
//
//Subject: TOVE-project / AA interface
//
//File: aadownprimitives.h
//
//Version: $Revision: 1.13 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/10/19 18:15:57 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications and Multimedia
//
//Author:
//      Juhana Räsänen
//
//Description:
//      AA-xx.{request,response} primitive (from SSCF to SAAL SSCOP)
//      definitions as a OVOPS++ messenger classes.
//      Get/set methods for primitive parametes are defined; names of
//      the parameters correspond to those of Q.2110
//
//Copyright:
//
//
//Licence:
//
//
//History:
 

#ifndef __AADOWNPRIMITIVES_H__
#define __AADOWNPRIMITIVES_H__

#include "pf/transp.h"
#include "pf/types.h"
#include "pf/frame.h"


class pfProtocol;
class pfState;


//////////////////////////////////////////////////////////////////
// class aaESTABLISHreq
// class aaESTABLISHresp
// class aaRELEASEreq
// class aaDATAreq
// class aaRESYNCreq
// class aaRESYNCresp
// class aaRECOVERresp
// class aaUNITDATAreq
// class aaRETRIEVEreq
//
// AA primitive messenger classes: each class below represents one AA
// downward (request, response) primitive and its parameters as a
// conduit messenger. If primitive has parameters, get- and set
// methods for those are defined.

class aaESTABLISHreq : public pfMsgTransporter
{
    public:
        aaESTABLISHreq(void);
        virtual ~aaESTABLISHreq(void);
        
        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
        void setBufferRelease(bool bufferRelease_);
        bool getBufferRelease(void) const;
        void setSSCOP_UU(const pfFrame &SSCOP_UU_);
        pfFrame &getSSCOP_UU(void);
        
    private:
        bool _bufferRelease;
        pfFrame _SSCOP_UU;
};

//-----------------------------------------------------------------------

class aaESTABLISHresp : public pfMsgTransporter
{
    public:
        aaESTABLISHresp(void);
        virtual ~aaESTABLISHresp(void);
        
        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
        void setBufferRelease(bool bufferRelease_);
        bool getBufferRelease(void) const;
        void setSSCOP_UU(const pfFrame &SSCOP_UU_);
        pfFrame &getSSCOP_UU(void);

    private:
        bool _bufferRelease;
        pfFrame _SSCOP_UU;
};

//-----------------------------------------------------------------------

class aaRELEASEreq : public pfMsgTransporter
{
    public:
        aaRELEASEreq(void);
        virtual ~aaRELEASEreq(void);

        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
        void setSSCOP_UU(const pfFrame &SSCOP_UU_);
        pfFrame &getSSCOP_UU(void);

    private:
        pfFrame _SSCOP_UU;
};

//-----------------------------------------------------------------------

class aaDATAreq : public pfMsgTransporter
{
    public:
        aaDATAreq(void);
        virtual ~aaDATAreq(void);

        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
        void setMessageUnit(const pfFrame &frame_);
        pfFrame &getMessageUnit(void);

    private:
        pfFrame _messageUnit;
};

//-----------------------------------------------------------------------

class aaRESYNCreq : public pfMsgTransporter
{
    public:
        aaRESYNCreq(void);
        virtual ~aaRESYNCreq(void);

        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
        void setSSCOP_UU(const pfFrame &SSCOP_UU_);
        pfFrame &getSSCOP_UU(void);

    private:
        pfFrame _SSCOP_UU;
};

//-----------------------------------------------------------------------

class aaRESYNCresp : public pfMsgTransporter
{
    public:
        aaRESYNCresp(void);
        virtual ~aaRESYNCresp(void);

        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
};

//-----------------------------------------------------------------------

class aaRECOVERresp : public pfMsgTransporter
{
    public:
        aaRECOVERresp(void);
        virtual ~aaRECOVERresp(void);

        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
};

//-----------------------------------------------------------------------

class aaUNITDATAreq : public pfMsgTransporter
{
    public:
        aaUNITDATAreq(void);
        virtual ~aaUNITDATAreq(void);

        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
        void setMessageUnit(const pfFrame &frame_);
        pfFrame &getMessageUnit(void);

    private:
        pfFrame _messageUnit;
};

//-----------------------------------------------------------------------

class aaRETRIEVEreq : public pfMsgTransporter
{
    public:
        aaRETRIEVEreq(void);
        virtual ~aaRETRIEVEreq(void);
        
        virtual void atProtocol(pfProtocol *protocol_, pfState *state_);
        void setRetrievalNumber(pfUlong retrievalNumber_);
        pfUlong getRetrievalNumber(void) const;

    private:
        pfUlong _retrievalNumber;
};




//////////////////////////////////////////////////////////////////
// Class aaDownInputs
//
// Pure virtual interface class for all protocol states using
// AA-interface (between SSCOP and SSCFs) downward primitive
// messengers (requests and responses from SSCOP user) defined above

class aaDownInputs
{
    public:
        virtual void aaESTABLISHreqAct(aaESTABLISHreq *messenger_,
                                       pfProtocol *protocol_) const = 0;
        virtual void aaESTABLISHrespAct(aaESTABLISHresp *messenger_,
                                        pfProtocol *protocol_) const = 0;
        virtual void aaRELEASEreqAct(aaRELEASEreq *messenger_,
                                     pfProtocol *protocol_) const = 0;
        virtual void aaDATAreqAct(aaDATAreq *messenger_,
                                  pfProtocol *protocol_) const = 0;
        virtual void aaRESYNCreqAct(aaRESYNCreq *messenger_,
                                    pfProtocol *protocol_) const = 0;
        virtual void aaRESYNCrespAct(aaRESYNCresp *messenger_,
                                     pfProtocol *protocol_) const = 0;
        virtual void aaRECOVERrespAct(aaRECOVERresp *messenger_,
                                      pfProtocol *protocol_) const = 0;
        virtual void aaUNITDATAreqAct(aaUNITDATAreq *messenger_,
                                      pfProtocol *protocol_) const = 0;
        virtual void aaRETRIEVEreqAct(aaRETRIEVEreq *messenger_,
                                      pfProtocol *protocol_) const = 0;
};


#endif // __AADOWNPRIMITIVES_H__
