Edit-conf changes for CLA use case.
[o-du/l2.git] / src / o1 / NrCellInfo.cpp
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2020-2021] [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 parameters list of a cell for CLA use case*/
20
21 #include "NrCellInfo.hpp"
22
23 using namespace std;
24
25 /*******************************************************************
26  *
27  * @brief convert admin state to enum
28  *
29  * @details
30  *
31  *    Function : adminStateToEnum
32  *
33  *    Functionality:
34  *      - convert admin state to enum
35  *
36  *
37  * @params[in] admin state in string form
38  * @return admin state in enum form
39  ******************************************************************/
40
41 AdminState NrCellInfo::adminStateToEnum(string val)
42 {
43    AdminState ret=LOCKED;
44    if( val == "LOCKED")
45       ret = LOCKED;
46    else if(val == "UNLOCKED")
47       ret = UNLOCKED;
48    else if(val ==  "SHUTTING_DOWN")
49       ret = SHUTTING_DOWN;
50    else
51       O1_LOG("O1 NrCellInfo : %s admin state not handled\n", \
52               val.c_str());
53
54    return ret;
55 }
56
57 /*******************************************************************
58  *
59  * @brief convert enum of cell state to string
60  *
61  * @details
62  *
63  *    Function : enumToCellStateString
64  *
65  *    Functionality:
66  *      - convert enum of cell state to string
67  *
68  *
69  * @params[in] enum of cell state
70  * @return cell state in string form
71  ******************************************************************/
72
73
74 string NrCellInfo::enumToCellStateString(CellState val)
75 {
76    string ret = "IDLE";
77    switch(val)
78    {
79       case INACTIVE:
80          ret = "INACTIVE";
81          break;
82       case ACTIVE:
83          ret = "ACTIVE";
84          break;
85       case IDLE:
86          ret = "IDLE";
87          break;
88       default :
89          O1_LOG("O1 NrCellInfo : %d cell state not handled\n", val);
90
91    }
92    return ret;
93 }
94
95 /*******************************************************************
96  *
97  * @brief convert enum of operational state to string
98  *
99  * @details
100  *
101  *    Function : enumToOperationalStateString
102  *
103  *    Functionality:
104  *      - convert enum of operational state to string
105  *
106  *
107  * @params[in] enum of operational state
108  * @return cell operational in string form
109  ******************************************************************/
110
111 string NrCellInfo::enumToOperationalStateString(OpState val)
112 {
113    string ret = "DISABLED";
114    switch(val)
115    {
116       case DISABLED:
117          ret = "DISABLED";
118          break;
119       case ENABLED:
120          ret = "ENABLED";
121          break;
122       default :
123          O1_LOG("O1 NrCellInfo : %d operational state not handled\n", val);
124
125    }
126    return ret;
127 }
128
129 /**********************************************************************
130          End of file
131 **********************************************************************/
132