0562f63bf0f42d0553452c9825fe418da95915fc
[o-du/l2.git] / src / o1 / AlarmManager.hpp
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2020] [HCL Technologies Ltd.]                               #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /* This file contains AlarmManager singleton class responsible for 
20    storing and managing alarms. 
21 */ 
22
23 #ifndef __ALARM_MANAGER_HPP__
24 #define __ALARM_MANAGER_HPP__
25
26 #include <map>
27 #include "Alarm.hpp"
28 #include "Singleton.hpp"
29
30 #include "PnfRegistrationThread.hpp"
31 #include "VesUtils.hpp"
32 #include "VesEventHandler.hpp"
33
34 using std::map;
35
36
37 class AlarmManager : public Singleton<AlarmManager>
38 {
39
40    friend Singleton<AlarmManager>;
41
42    private:
43    map<uint16_t,Alarm> mAlarmList;          
44
45    protected:
46    AlarmManager();    
47    ~AlarmManager();
48
49    public:
50    bool raiseAlarm(const Alarm& alarm);
51    bool clearAlarm(const uint16_t& alarmId);
52    bool clearAlarm(const Alarm& alarm );
53    const map<uint16_t, Alarm>& getAlarmList()const;
54
55 };
56
57
58 #endif
59
60 /**********************************************************************
61          End of file
62 **********************************************************************/