//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / mgmt module
//
//File: mgmtdelegationbase.h
//
//Version: $Revision: 1.11 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/10/19 08:24:22 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Timo Kokkonen
//
//Description:
//      Base class for using toveSwitch interface. If sendPtr
//      is null then class throws mgmt_sendPtrErrorException.
//
//      Possible exceptions: pfNullPointerException(PF_EX_INFO,
//                           pfException(uniCauseValue_NWOutOfOrder)
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History:
//
#ifndef __MGMT_DELEGATIONBASE_H__
#define __MGMT_DELEGATIONBASE_H__

#include <typeinfo>
#include <string>
#include "pf/types.h"

class mgmtCommand;
class mgmtSend;

class mgmtDelegationBase
{
    public:
        virtual ~mgmtDelegationBase(void);

        virtual void receiveRegister(void);
        virtual void receiveUnRegister(void);        
        virtual string receiveGet(const string &name_) = 0;
        virtual void receiveSet(const string &name_, const string &value_) = 0;
        virtual void receiveExecute(mgmtCommand &command_) = 0;

        string sendGet(const string &name_);
        void sendSet(const string &name_, const string &value_);
        void sendExecute(mgmtCommand &command_);

    protected:
        mgmtDelegationBase(void);
        
        void createOB(void);

        void registerToNameService(const string &name_);
        void unRegisterToNameService(void);
        void registerToOther(const string &name_);
        void unRegisterToOther(void);

    private:
        mgmtSend *_sendPtr;
};

#endif // __MGMT_DELEGATIONBASE_H__
