Merge "Cell down alarm notification [Issue-Id: ODUHIGH-430]"
[o-du/l2.git] / src / o1 / AlarmManager.hpp
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2020-2022] [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 #include "Observer.hpp"
34
35 using std::map;
36
37 class AlarmManager : public Singleton<AlarmManager> ,public Observer
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
51    void update(char* recvBuf);
52    bool raiseAlarm(const Alarm& alarm);
53    bool clearAlarm(const uint16_t& alarmId);
54    bool clearAlarm(const Alarm& alarm );
55    const map<uint16_t, Alarm>& getAlarmList()const;
56
57 };
58
59
60 #endif
61
62 /**********************************************************************
63          End of file
64 **********************************************************************/