Restructure O1 module to run as a thread in O-DU High binary [Issue-Id: ODUHIGH-297]
[o-du/l2.git] / src / o1 / Alarm.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 Alarm class defining Netconf Yang based alarm fields */
20
21 #ifndef __ALARM_HPP__
22 #define __ALARM_HPP__
23
24 #include <string>
25 #include <string.h>
26 #include "AlarmMessages.h"
27
28 using std::string; 
29
30
31 class Alarm
32 {
33
34    private:
35    EventType mEventType;
36    string mObjectClassObjectInstance;
37    uint16_t mAlarmId;
38    string mAlarmRaiseTime;
39    string mAlarmChangeTime;
40    string mAlarmClearTime;
41    string mProbableCause;
42    SeverityLevel mPerceivedSeverity;
43    string mRootCauseIndicator;  
44    string mAdditionalText;
45    string mAdditionalInfo;
46    string mSpecificProblem;
47
48    public:
49    Alarm(){};
50    ~Alarm(){};
51    /* Getter functions */
52    inline const EventType& getEventType()const 
53    { 
54       return mEventType; 
55    }
56    inline const string& getObjectClassObjectInstance()const 
57    { 
58       return mObjectClassObjectInstance; 
59    }
60    inline const uint16_t& getAlarmId()const 
61    { 
62       return mAlarmId; 
63    }
64    inline const string& getAlarmRaiseTime()const 
65    { 
66       return mAlarmRaiseTime; 
67    }
68    inline const string& getAlarmChangeTime()const 
69    { 
70       return mAlarmChangeTime; 
71    }
72    inline const string& getAlarmClearTime()const 
73    { 
74       return mAlarmClearTime; 
75    }
76    inline const string& getProbableCause()const 
77    { 
78       return mProbableCause; 
79    }
80    inline const SeverityLevel getPerceivedSeverity()const 
81    { 
82       return mPerceivedSeverity; 
83    }
84    inline const string getRootCauseIndicator()const 
85    { 
86       return mRootCauseIndicator; 
87    }
88    inline const string getAdditionalText()const 
89    { 
90       return mAdditionalText; 
91    }
92    inline const string getAdditionalInfo()const 
93    { 
94       return mAdditionalInfo; 
95    }
96    inline const string getSpecificProblem()const 
97    { 
98       return mSpecificProblem; 
99    }
100    
101    /* Setter functions */
102    inline void setEventType(const EventType& eventType) 
103    { 
104       mEventType = eventType; 
105    }
106    inline void setObjectClassObjectInstance(const string& objectClassObjectInstance )
107    { 
108       mObjectClassObjectInstance = objectClassObjectInstance; 
109    }
110    inline void setObjectClassObjectInstance(const char* objectClassObjectInstance )
111    { 
112       mObjectClassObjectInstance = objectClassObjectInstance; 
113    }
114    inline void setAlarmId(const uint16_t& alarmId) 
115    {  
116       mAlarmId = alarmId; 
117    }
118    inline void setAlarmRaiseTime(const string& alarmRaiseTime) 
119    { 
120       mAlarmRaiseTime = alarmRaiseTime; 
121    }
122    inline void setAlarmRaiseTime(const char* alarmRaiseTime)
123    { 
124       mAlarmRaiseTime = alarmRaiseTime; 
125    }
126    inline void setAlarmChangeTime(const string& alarmChangeTime) 
127    { 
128       mAlarmChangeTime = alarmChangeTime; 
129    }
130    inline void setAlarmChangeTime(const char* alarmChangeTime) 
131    { 
132       mAlarmChangeTime = alarmChangeTime; 
133    }
134    inline void setAlarmClearTime(const string& alarmClearTime) 
135    { 
136       mAlarmClearTime = alarmClearTime; 
137    }
138    inline void setAlarmClearTime(const char* alarmClearTime) 
139    { 
140       mAlarmClearTime = alarmClearTime; 
141    }
142    inline void setProbableCause(const string& probableCause) 
143    { 
144       mProbableCause = probableCause; 
145    }
146    inline void setProbableCause(const char* probableCause) 
147    { 
148       mProbableCause = probableCause; 
149    }
150    inline void setPerceivedSeverity(const SeverityLevel& perceivedSeverity) 
151    { 
152       mPerceivedSeverity = perceivedSeverity; 
153    }
154    inline void setRootCauseIndicator(const string& rootCauseIndicator) 
155    { 
156       mRootCauseIndicator = rootCauseIndicator; 
157    }
158    inline void setRootCauseIndicator(const char* rootCauseIndicator) 
159    { 
160       mRootCauseIndicator = rootCauseIndicator; 
161    }
162    inline void setAdditionalText(const string& additionalText) 
163    { 
164       mAdditionalText = additionalText; 
165    }
166    inline void setAdditionalText(const char* additionalText) 
167    { 
168       mAdditionalText = additionalText; 
169    }
170    inline void setAdditionalInfo(const string& additionalInfo) 
171    { 
172       mAdditionalInfo = additionalInfo; 
173    }
174    inline void setAdditionalInfo(const char* additionalInfo) 
175    { 
176       mAdditionalInfo = additionalInfo; 
177    }
178    inline void setSpecificProblem(const string& specificProblem) 
179    { 
180       mSpecificProblem = specificProblem; 
181    }
182    inline void setSpecificProblem(const char* specificProblem) 
183    { 
184       mSpecificProblem = specificProblem; 
185    }
186   
187
188 };
189
190 #endif
191
192 /**********************************************************************
193          End of file
194 **********************************************************************/