//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project/CC
//
//File: ccmanagementadapter.cpp
//
//Version: $Revision: 1.8 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/11/24 12:57:33 $
//
//Organisation:
//      University of Technology
// 
//Author:
//      Pasi Nummisalo
//
//Description:
//     TDP management adapter. Triggers can be set on/off etc. through
//     this CORBA interface.Implements managementServer interface from ccIf IDL file.
//
//Copyright:
//     University of Technology
//     Laboratory of Telecommunications and Multimedia 
//      
//Licence:
//     
//
//History:
//

#ifndef CC_MANAGEMENT_ADAPTER_H
#define CC_MANAGEMENT_ADAPTER_H

#include "ccif_skel.h"
#include "pf/adapter.h"
#include "dp.h"

class ccManagementAdapter : public ccIf_managementServer_skel,
                            public pfAdapter
{
    private:
        typedef less< toveinap_EventTypeBCSMType > ccLessType;
        typedef map< toveinap_EventTypeBCSMType, ccDp, ccLessType > ccMapType;
        typedef ccMapType::iterator ccMapIterType;
                
    public:
        static ccManagementAdapter *instance(void);

        void cloneDPsForSideO(ccMapType &dps_);
        void cloneDPsForSideT(ccMapType &dps_);
        
        virtual void setMessageType(ccIf_Side side,
                                    const char* dpType,
                                    const char* messageType);

        virtual void addTrigger(ccIf_Side side,
                                const char* dpType,
                                const ccIf_TriggerType& newTrigger);

        virtual void deleteTrigger(ccIf_Side side,
                                   const char* dpType,
                                   const ccIf_TriggerType& oldTrigger);
        
        virtual void requestTDPreport(ccIf_Side side,
                                      ccIf_TDPsType*& TDPs);
        
        virtual void test();       
                        
    protected:
        ccManagementAdapter(void);
        virtual ~ccManagementAdapter(void);

    private:
        static ccManagementAdapter *_only;

        ccMapType _dpDataSideO;
        ccMapType _dpDataSideT;
        ccMapIterType _dpIter;
        string _pointCodeString;
                         
};


#endif // CC_MANAGEMENT_ADAPTER_H


