Remove unused directories and files in video_in_hal
[staging/basesystem.git] / service / native / framework_unified / client / include / native_service / ns__CWORD77__data_pool_table.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 ////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_HMI_CWORD77_Controller
19 /// \brief
20 ///
21 ////////////////////////////////////////////////////////////////////////////////
22 //@{
23 /**
24  * @file ns__CWORD77__data_pool_table.h
25  * @brief \~english This file provides API for convert and C_CWORD77_DataPool class
26  *
27  */
28 /** @addtogroup BaseSystem
29  *  @{
30  */
31 /** @addtogroup native_service
32  *  @ingroup BaseSystem
33  *  @{
34  */
35 /** @addtogroup framework_unified
36  *  @ingroup native_service
37  *  @{
38  */
39 /** @addtogroup _CWORD77_
40  *  @ingroup framework_unified
41  *  @{
42  */
43 #ifndef _CWORD77__DATA_POOL_TABLE_H_  // NOLINT  (build/header_guard)
44 #define _CWORD77__DATA_POOL_TABLE_H_
45
46 #include <native_service/ns__CWORD77__common.h>
47 #include <sstream>
48 #include <map>
49 #include <string>
50 #include <vector>
51
52 /// Enumeration for Type of Table
53 typedef enum _ETableType {
54   REQUEST_TABLE = 1,
55   RESPONSE_TABLE
56 } ETableType, *PETableType;
57
58 /// Enumeration for Data Type
59 typedef enum _EDataType {
60   UNKNOWNTYPE = -1,
61   SIGNEDINT,
62   UNSIGNEDINT,
63   FLOAT,
64   DOUBLE,
65   CHARACTER,
66   BOOLEAN,
67   STRING,
68 } EDataType, *PEDataType;
69
70 /// _CWORD77_ Data structure
71 typedef struct __CWORD77_Data {
72   EDataType DataType;
73   std::string DataValue;
74 } _CWORD77_Data, *P_CWORD77_Data;
75
76 typedef std::map< _CWORD77_DataPoolKey, std::vector< CHAR > > T_CWORD77_DataPool;
77
78
79 ////////////////////////////////////////////////////////////////////////////////////////////
80 ///   NoOfElementsinData
81 /// Function to get number of elements for given string
82 ///
83 /// \param  [in] Input
84 ///     string - string
85 ///
86 /// \return UI_32 - Number of elements
87 ///
88 ////////////////////////////////////////////////////////////////////////////////////////////
89 UI_32 NoOfElementsinData(std::string Input);
90
91 /// Template to Convert Number to String
92
93 template <typename T>
94 std::string NumberToString(T Number) {
95   std::ostringstream ss;
96   ss << Number;
97   return ss.str();
98 }
99
100 /// Template to convert String to Number
101
102 template <typename T>
103 T StringToNumber(const std::string &Text) {
104   std::istringstream ss(Text);
105   T result;
106   ss >> result;
107   return result;
108 }
109
110 /// Template to Convert an Array To String
111
112 template<class T>
113 std::string ConvertArrayToString(T *Array, int Arraysize) {
114   int length = 0;
115   std::string Result = "";
116   while (length < Arraysize) {
117     Result.append(NumberToString<T>(Array[length]));
118     Result.append(",");
119     length++;
120   }
121   Result.append("");
122   return Result;
123 }
124
125 /// Template to Convert String To Array
126 template<class T>
127 void ConvertStringToArray(std::string Input, std::vector<T> &Array, UI_32 &Arraysize) {  // NOLINT  (readability/nolint)
128   int i = 0;
129   std::string first = "";
130   std::istringstream ss(Input);
131   int Size = NoOfElementsinData(Input);
132   // T Arr[Size];
133   while (!ss.eof()) {
134     getline(ss, first, ',');
135     if (first != "") {
136       Array[i] = StringToNumber<T>(first);
137       i++;
138     }
139   }
140   Arraysize = i;
141   // memcpy(Array,(void *)Arr,Arraysize*sizeof(T));
142 }
143
144 ////////////////////////////////////////////////////////////////////////////////////////////
145 ///   ConvertArrayStringsToString
146 /// Function to convert array of strings to string
147 ///
148 /// \param  [in] strArr
149 ///     string * - pointer to array of strings
150 /// \param  [in] Size
151 ///     SI_32 - Number of strings
152 ///
153 /// \return string
154 ///
155 ////////////////////////////////////////////////////////////////////////////////////////////
156 std::string ConvertArrayStringsToString(std::string *strArr, SI_32 Size);
157
158
159 ////////////////////////////////////////////////////////////////////////////////////////////
160 ///   ConvertArrayStringsToString
161 /// Function to convert string to array of strings
162 ///
163 /// \param  [in] Input
164 ///     string - string contains array of strings
165 /// \param  [out] strArr
166 ///     string * - Pointer to Array of strings
167 /// \param  [out] ArraySize
168 ///     UI_32 - No of elements in Array
169 ///
170 /// \return None
171 ///
172 ////////////////////////////////////////////////////////////////////////////////////////////
173 void ConvertStringToArrString(std::string Input, std::string *strArr, UI_32 &ArraySize);  // NOLINT  (readability/nolint)
174
175 ///////////////////////////////////////////////////////////////////////////
176 /// class: C_CWORD77_DataPool
177 /// Description: This is interface class to _CWORD77_ Data base.
178 /// It provides APIs to set and get data from _CWORD77_ Data base
179 ///
180 ////////////////////////////////////////////////////////////////////////////
181 class C_CWORD77_DataPool {
182  private:
183   std::map<UI_32, _CWORD77_Data> m__CWORD77_DataRequestTable;   ///< Request Data Table
184   std::map<UI_32, _CWORD77_Data> m__CWORD77_DataResponseTable;  ///< Response Data Table
185
186   static C_CWORD77_DataPool *m_p_CWORD77_DataPoolInstance;  ///< Static instance to C_CWORD77_DataPool
187
188   ////////////////////////////////////////////////////////////////////////////////////////////
189   ///   GetData
190   /// Templatized Function to get data from _CWORD77_ Data base
191   ///
192   /// \param  [in] TableType
193   ///     ETableType - Table Type (Request or Response)
194   /// \param  [in] VarName
195   ///     string  - Variable Name or key value
196   /// \param  [out] Array
197   ///     T * - Pointer to an array of given type
198   /// \param  [out] ArraySize
199   ///     UI_32 - No of elements of Array
200   ///
201   /// \return None
202   ///
203   ////////////////////////////////////////////////////////////////////////////////////////////
204
205   template<class T>
206   void GetData(ETableType TableType, UI_32 VarName, T *Array, UI_32 &ArraySize) {  // NOLINT  (readability/nolint)
207     EDataType DataType = SIGNEDINT;
208     std::string DataValue;
209     GetValueFromMap(TableType, VarName, DataType, DataValue);
210     UI_32 Num = NoOfElementsinData(DataValue);
211     std::vector<T> Temp;
212     Temp.resize(Num);
213     ConvertStringToArray<T>(DataValue, Temp, ArraySize);
214     for (unsigned int i = 0; i < Num; i++) {
215       Array[i] = Temp[i];
216     }
217   }
218   ////////////////////////////////////////////////////////////////////////////////////////////
219   ///   SetData
220   /// Templatized Function to set data into _CWORD77_ Data base
221   ///
222   /// \param  [in] TableType
223   ///     ETableType - Table Type (Request or Response)
224   /// \param  [in] VarName
225   ///     string  - Variable Name or key value
226   /// \param  [in] DataType
227   ///     EDataType  - Data Type of key
228   /// \param  [in] Array
229   ///     T * - Pointer to an array of given type
230   /// \param  [in] ArraySize
231   ///     UI_32 - No of elements of Array
232   ///
233   /// \return None
234   ///
235   ////////////////////////////////////////////////////////////////////////////////////////////
236   template<class T>
237   void SetData(ETableType TableType, UI_32 VarName, EDataType DataType, T *Array, UI_32 ArraySize) {
238     std::string Result = ConvertArrayToString(Array, ArraySize);
239     SetValueinMap(TableType, VarName, DataType, Result);
240   }
241
242   ////////////////////////////////////////////////////////////////////////////////////////////
243   ///   GetValueFromMap
244   /// Function to get data from _CWORD77_ map
245   ///
246   /// \param  [in] TableType
247   ///     ETableType - Table Type (Request or Response)
248   /// \param  [in] VarName
249   ///     string  - Variable Name or key value
250   /// \param  [out] DataType
251   ///     EDataType  - Data Type of key
252   /// \param  [out] Strvalue
253   ///     string - Output in the form of string
254   ///
255   /// \return None
256   ///
257   ////////////////////////////////////////////////////////////////////////////////////////////
258   void GetValueFromMap(ETableType TableType, UI_32 VarName, EDataType &DataType, std::string &Strvalue);  // NOLINT  (readability/nolint)
259
260   ////////////////////////////////////////////////////////////////////////////////////////////
261   ///   SetValueinMap
262   /// Function to set data in _CWORD77_ map
263   ///
264   /// \param  [in] TableType
265   ///     ETableType - Table Type (Request or Response)
266   /// \param  [in] VarName
267   ///     string  - Variable Name or key value
268   /// \param  [in] VarType
269   ///     EDataType  - Data Type of key
270   /// \param  [in] Result
271   ///     string - input in the form of string
272   ///
273   /// \return None
274   ///
275   ////////////////////////////////////////////////////////////////////////////////////////////
276   void SetValueinMap(ETableType TableType, UI_32 VarName, EDataType VarType, std::string Result);
277
278   ////////////////////////////////////////////////////////////////////////////////////////////
279   ///   SetArrayStringData
280   /// Function to set string data in _CWORD77_ map
281   ///
282   /// \param  [in] TableType
283   ///     ETableType - Table Type (Request or Response)
284   /// \param  [in] VarName
285   ///     string  - Variable Name or key value
286   /// \param  [in] VarType
287   ///     EDataType  - Data Type of key
288   /// \param  [in] DataValue
289   ///     string [] - Array of strings
290   /// \param  [in] Size
291   ///     UI_32  - No of elements in Array
292   ///
293   /// \return None
294   ///
295   ////////////////////////////////////////////////////////////////////////////////////////////
296   void SetArrayStringData(ETableType TableType,
297                           UI_32 VarName,
298                           EDataType VarType,
299                           std::string DataValue[],
300                           UI_32 size);
301   ////////////////////////////////////////////////////////////////////////////////////////////
302   ///   GetArrayStringData
303   /// Function to get string data in _CWORD77_ map
304   ///
305   /// \param  [in] TableType
306   ///     ETableType - Table Type (Request or Response)
307   /// \param  [in] VarName
308   ///     UI_32  - key
309   /// \param  [out] DataValue
310   ///     string [] - Array of strings
311   /// \param  [out] Size
312   ///     UI_32  - No of elements in Array
313   ///
314   /// \return None
315   ///
316   ////////////////////////////////////////////////////////////////////////////////////////////
317   void GetArrayStringData(ETableType TableType, UI_32 VarName, std::string DataValue[], UI_32 &size);  // NOLINT  (readability/nolint)
318
319   ////////////////////////////////////////////////////////////////////////////////////////////
320   ///   GetNoofElementsofData
321   /// Function to get Number of elements in data item
322   ///
323   /// \param  [in] TableType
324   ///     ETableType - Table Type (Request or Response)
325   /// \param  [in] VarName
326   ///     UI_32  - key
327
328   ///
329   /// \return UI_32 - Number of elements
330   ///
331   ////////////////////////////////////////////////////////////////////////////////////////////
332   UI_32 GetNoofElementsofData(ETableType TableType, UI_32 Key);
333   ////////////////////////////////////////////////////////////////////////////////////////////
334   ///   GetDataType
335   /// Function to get data type of given key Name
336   ///
337   /// \param  [in] TableType
338   ///     ETableType - Table Type (Request or Response)
339   /// \param  [in] VarName
340   ///     UI_32  - key
341
342   ///
343   /// \return EDataType - Data type of variable
344   ///
345   ////////////////////////////////////////////////////////////////////////////////////////////
346
347   EDataType GetDataType(ETableType TableType, UI_32 Key);
348
349  public:
350   ////////////////////////////////////////////////////////////////////////////////////////////
351   ///   C_CWORD77_DataPool
352   /// Constructor for C_CWORD77_DataPool
353   /// \param  None
354   /// \return None
355   ///
356   ////////////////////////////////////////////////////////////////////////////////////////////
357   C_CWORD77_DataPool();
358   ////////////////////////////////////////////////////////////////////////////////////////////
359   ///   ~C_CWORD77_DataPool
360   /// Destructor for C_CWORD77_DataPool
361   /// \param  None
362   /// \return None
363   ///
364   ////////////////////////////////////////////////////////////////////////////////////////////
365   ~C_CWORD77_DataPool();
366   ////////////////////////////////////////////////////////////////////////////////////////////
367   ///   GetInstance
368   /// API to get single instance of C_CWORD77_DataPool
369   /// \param  None
370   /// \return Pointer to single instance of C_CWORD77_Controller
371   ///
372   ////////////////////////////////////////////////////////////////////////////////////////////
373   static C_CWORD77_DataPool *GetInstance();
374   ////////////////////////////////////////////////////////////////////////////////////////////
375   ///   DeleteInstance
376   /// API to delete single instance of C_CWORD77_DataPool
377   /// \param  None
378   /// \return None
379   ///
380   ////////////////////////////////////////////////////////////////////////////////////////////
381   static void DeleteInstance();
382
383   ////////////////////////////////////////////////////////////////////////////////////////////
384   ///   SetRequestArrayData
385   /// Templatized Function to set array data into Request _CWORD77_ Data base
386   ///
387   /// \param  [in] VarName
388   ///     UI_32  - key
389   /// \param  [in] DataType
390   ///     EDataType  - Data Type of key
391   /// \param  [in] Array
392   ///     T * - Pointer to an array of given type
393   /// \param  [in] ArraySize
394   ///     UI_32 - No of elements of Array
395   ///
396   /// \return None
397   ///
398   ////////////////////////////////////////////////////////////////////////////////////////////
399   template<class T>
400   void SetReqArrayData(UI_32 VarName, EDataType DataType, T *Array, UI_32 ArraySize) {
401     SetData<T>(REQUEST_TABLE, VarName, DataType, Array, ArraySize);
402   }
403   ////////////////////////////////////////////////////////////////////////////////////////////
404   ///   SetRequestArrayData
405   /// Templatized Function to set array data into Response _CWORD77_ Data base
406   ///
407   /// \param  [in] VarName
408   ///     UI_32  - key
409   /// \param  [in] DataType
410   ///     EDataType  - Data Type of key
411   /// \param  [in] Array
412   ///     T * - Pointer to an array of given type
413   /// \param  [in] ArraySize
414   ///     UI_32 - No of elements of Array
415   ///
416   /// \return None
417   ///
418   ////////////////////////////////////////////////////////////////////////////////////////////
419   template<class T>
420   void SetRespArrayData(UI_32 VarName, EDataType DataType, T *Array, UI_32 ArraySize) {
421     SetData<T>(RESPONSE_TABLE, VarName, DataType, Array, ArraySize);
422   }
423   ////////////////////////////////////////////////////////////////////////////////////////////
424   ///   GetRequestArrayData
425   /// Templatized Function to get array data from Request _CWORD77_ Data base
426   ///
427   /// \param  [in] VarName
428   ///     UI_32  - key
429   /// \param  [out] Array
430   ///     T * - Pointer to an array of given type
431   /// \param  [out] ArraySize
432   ///     UI_32 - No of elements of Array
433   ///
434   /// \return None
435   ///
436   ////////////////////////////////////////////////////////////////////////////////////////////
437   template<class T>
438   void GetReqArrayData(UI_32 VarName, T *Array, UI_32 &ArraySize) {  // NOLINT  (readability/nolint)
439     GetData<T>(REQUEST_TABLE, VarName, Array, ArraySize);
440   }
441   ////////////////////////////////////////////////////////////////////////////////////////////
442   ///   GetRequestArrayData
443   /// Templatized Function to get array data from Response _CWORD77_ Data base
444   ///
445   /// \param  [in] VarName
446   ///     UI_32  - key
447   /// \param  [out] Array
448   ///     T * - Pointer to an array of given type
449   /// \param  [out] ArraySize
450   ///     UI_32 - No of elements of Array
451   ///
452   /// \return None
453   ///
454   ////////////////////////////////////////////////////////////////////////////////////////////
455   template<class T>
456   void GetRespArrayData(UI_32 VarName, T *Array, UI_32 &ArraySize) {  // NOLINT  (readability/nolint)
457     GetData<T>(RESPONSE_TABLE, VarName, Array, ArraySize);
458   }
459
460   ////////////////////////////////////////////////////////////////////////////////////////////
461   ///   SetRequestData
462   /// Templatized Function to set data into Request _CWORD77_ Data base
463   ///
464   /// \param  [in] VarName
465   ///     UI_32  - key
466   /// \param  [in] DataType
467   ///     EDataType  - Data Type of key
468   /// \param  [in] Array
469   ///     T  - Data type of key
470   ///
471   /// \return None
472   ///
473   ////////////////////////////////////////////////////////////////////////////////////////////
474   template<class T>
475   void SetReqData(UI_32 VarName, EDataType DataType, T Array) {
476     SetData<T>(REQUEST_TABLE, VarName, DataType, &Array, 1);
477   }
478   ////////////////////////////////////////////////////////////////////////////////////////////
479   ///   SetRequestData
480   /// Templatized Function to set data into Response _CWORD77_ Data base
481   ///
482   /// \param  [in] VarName
483   ///     UI_32  - key
484   /// \param  [in] DataType
485   ///     EDataType  - Data Type of key
486   /// \param  [in] Array
487   ///     T  - Data type of key
488   ///
489   /// \return None
490   ///
491   ////////////////////////////////////////////////////////////////////////////////////////////
492   template<class T>
493   void SetRespData(UI_32 VarName, EDataType DataType, T Array) {
494     SetData<T>(RESPONSE_TABLE, VarName, DataType, &Array, 1);
495   }
496   ////////////////////////////////////////////////////////////////////////////////////////////
497   ///   GetRequestData
498   /// Templatized Function to get data from Resquest _CWORD77_ Data base
499   ///
500   /// \param  [in] VarName
501   ///     UI_32  - key
502   ///
503   /// \return T - value belong to type T
504   ///
505   ////////////////////////////////////////////////////////////////////////////////////////////
506   template<class T>
507   T GetReqData(UI_32 VarName) {
508     T Data;
509     UI_32 ArraySize = 0;
510     GetData<T>(REQUEST_TABLE, VarName, &Data, ArraySize);
511     return Data;
512   }
513   ////////////////////////////////////////////////////////////////////////////////////////////
514   ///   GetResponseData
515   /// Templatized Function to get data from Response _CWORD77_ Data base
516   ///
517   /// \param  [in] VarName
518   ///     UI_32  - key
519   ///
520   /// \return T - value belong to type T
521   ///
522   ////////////////////////////////////////////////////////////////////////////////////////////
523   template<class T>
524   T GetRespData(UI_32 VarName) {
525     T Data;
526     UI_32 ArraySize = 0;
527     GetData<T>(RESPONSE_TABLE, VarName, &Data, ArraySize);
528     return Data;
529   }
530
531   ////////////////////////////////////////////////////////////////////////////////////////////
532   ///   SetRequestArrayStringData
533   /// API to set array of string data into Request _CWORD77_ Data base
534   ///
535   /// \param  [in] VarName
536   ///     UI_32  - key
537   /// \param  [in] DataType
538   ///     EDataType  - Data Type of key
539   /// \param  [in] DataValue
540   ///     string [] - array of strings
541   /// \param  [in] ArraySize
542   ///     UI_32 - No of elements of Array
543   ///
544   /// \return None
545   ///
546   ////////////////////////////////////////////////////////////////////////////////////////////
547
548   void SetReqArrayStringData(UI_32 VarName, EDataType VarType,  std::string DataValue[], UI_32 size) {
549     SetArrayStringData(REQUEST_TABLE, VarName, VarType,  DataValue, size);
550   }
551   ////////////////////////////////////////////////////////////////////////////////////////////
552   ///   SetRequestArrayStringData
553   /// API to set array of string data into Response _CWORD77_ Data base
554   ///
555   /// \param  [in] VarName
556   ///     UI_32  - key
557   /// \param  [in] DataType
558   ///     EDataType  - Data Type of key
559   /// \param  [in] DataValue
560   ///     string [] - array of strings
561   /// \param  [in] ArraySize
562   ///     UI_32 - No of elements of Array
563   ///
564   /// \return None
565   ///
566   ////////////////////////////////////////////////////////////////////////////////////////////
567   void SetRespArrayStringData(UI_32 VarName, EDataType VarType,  std::string DataValue[], UI_32 size) {
568     SetArrayStringData(RESPONSE_TABLE, VarName, VarType,  DataValue, size);
569   }
570   ////////////////////////////////////////////////////////////////////////////////////////////
571   ///   GetRequestArrayStringData
572   /// API to get array of string data from Request _CWORD77_ Data base
573   ///
574   /// \param  [in] VarName
575   ///     UI_32  - key
576   /// \param  [out] DataValue
577   ///     string [] - array of strings
578   /// \param  [out] ArraySize
579   ///     UI_32 - No of elements of Array
580   ///
581   /// \return None
582   ///
583   ////////////////////////////////////////////////////////////////////////////////////////////
584
585   void GetReqArrayStringData(UI_32 VarName, std::string DataValue[], UI_32 &size) {  // NOLINT  (readability/nolint)
586     GetArrayStringData(REQUEST_TABLE, VarName, DataValue, size);
587   }
588
589   ////////////////////////////////////////////////////////////////////////////////////////////
590   ///   GetResponseArrayStringData
591   /// API to get array of string data from Response _CWORD77_ Data base
592   ///
593   /// \param  [in] VarName
594   ///     UI_32  - key
595   /// \param  [out] DataValue
596   ///     string [] - array of strings
597   /// \param  [out] ArraySize
598   ///     UI_32 - No of elements of Array
599   ///
600   /// \return None
601   ///
602   ////////////////////////////////////////////////////////////////////////////////////////////
603   void GetRespArrayStringData(UI_32 VarName, std::string DataValue[], UI_32 &size) {  // NOLINT  (readability/nolint)
604     GetArrayStringData(RESPONSE_TABLE, VarName, DataValue, size);
605   }
606
607
608   ////////////////////////////////////////////////////////////////////////////////////////////
609   ///   SetRequestStringData
610   /// API to set string data into Request _CWORD77_ Data base
611   ///
612   /// \param  [in] VarName
613   ///     UI_32  - key
614   /// \param  [in] DataType
615   ///     EDataType  - Data Type of key
616   /// \param  [in] DataValue
617   ///     string [] - array of strings
618   ///
619   /// \return None
620   ///
621   ////////////////////////////////////////////////////////////////////////////////////////////
622   void SetReqStringData(UI_32 VarName, EDataType VarType,  std::string DataValue) {
623     UI_32 size = 1;
624     SetArrayStringData(REQUEST_TABLE, VarName, VarType,  &DataValue, size);
625   }
626   ////////////////////////////////////////////////////////////////////////////////////////////
627   ///   SetResponseStringData
628   /// API to set string data into Response _CWORD77_ Data base
629   ///
630   /// \param  [in] VarName
631   ///     UI_32  - key
632   /// \param  [in] DataType
633   ///     EDataType  - Data Type of key
634   /// \param  [in] DataValue
635   ///     string [] - array of strings
636   ///
637   /// \return None
638   ///
639   ////////////////////////////////////////////////////////////////////////////////////////////
640   void SetRespStringData(UI_32 VarName, EDataType VarType,  std::string DataValue) {
641     UI_32 size = 1;
642     SetArrayStringData(RESPONSE_TABLE, VarName, VarType, &DataValue, size);
643   }
644   ////////////////////////////////////////////////////////////////////////////////////////////
645   ///   GetRequestStringData
646   /// API to get string data from Request _CWORD77_ Data base
647   ///
648   /// \param  [in] VarName
649   ///     UI_32  - key
650   ///
651   /// \return string - value of data
652   ///
653   ////////////////////////////////////////////////////////////////////////////////////////////
654   std::string GetReqStringData(UI_32 VarName) {
655     UI_32 size = 0;
656     std::string DataValue = "";
657     GetArrayStringData(REQUEST_TABLE, VarName, &DataValue, size);
658     return DataValue;
659   }
660
661   ////////////////////////////////////////////////////////////////////////////////////////////
662   ///   GetNoofElementsFromRequestTable
663   /// API to get No of elements in a key from request data base
664   ///
665   /// \param  [in] VarName
666   ///     UI_32  - key
667   ///
668   /// \return UI_32 - No of elements
669   ///
670   ////////////////////////////////////////////////////////////////////////////////////////////
671   UI_32 GetReqDataSize(UI_32 Key) {
672     return GetNoofElementsofData(REQUEST_TABLE, Key);
673   }
674   ////////////////////////////////////////////////////////////////////////////////////////////
675   ///   GetNoofElementsFromResponseTable
676   /// API to get No of elements in a key from response data base
677   ///
678   /// \param  [in] VarName
679   ///     UI_32  - key
680   ///
681   /// \return UI_32 - No of elements
682   ///
683   ////////////////////////////////////////////////////////////////////////////////////////////
684
685   UI_32 GetRespDataSize(UI_32 Key) {
686     return GetNoofElementsofData(RESPONSE_TABLE, Key);
687   }
688   ////////////////////////////////////////////////////////////////////////////////////////////
689   ///   GetDataTypeFromRequestTable
690   /// API to get data type of key from request data base
691   ///
692   /// \param  [in] VarName
693   ///     UI_32  - key
694   ///
695   /// \return EDataType - Data type of key
696   ///
697   ////////////////////////////////////////////////////////////////////////////////////////////
698
699   EDataType GetReqDataType(UI_32 Key) {
700     return GetDataType(REQUEST_TABLE, Key);
701   }
702   ////////////////////////////////////////////////////////////////////////////////////////////
703   ///   GetDataTypeFromResponseTable
704   /// API to get data type of key from response data base
705   ///
706   /// \param  [in] VarName
707   ///     UI_32  - key
708   ///
709   /// \return EDataType - Data type of key
710   ///
711   ////////////////////////////////////////////////////////////////////////////////////////////
712   EDataType GetRespDataType(UI_32 Key) {
713     return GetDataType(RESPONSE_TABLE, Key);
714   }
715 };
716
717 extern C_CWORD77_DataPool g__CWORD77_DataPool;
718
719
720 ////////////////////////////////////////////////////////////////////////////////////////////
721 ///   SetRequestArrayData
722 /// Templatized Function to set array data into Response _CWORD77_ Data base
723 ///
724 /// \param  [in] VarName
725 ///     UI_32  - key
726 /// \param  [in] DataType
727 ///     EDataType  - Data Type of key
728 /// \param  [in] Array
729 ///     T * - Pointer to an array of given type
730 /// \param  [in] ArraySize
731 ///     UI_32 - No of elements of Array
732 ///
733 /// \return None
734 ///
735 ////////////////////////////////////////////////////////////////////////////////////////////
736 template<class T>
737 void SetRequestArrayData(UI_32 VarName, EDataType DataType, T *Array, UI_32 ArraySize) {
738   g__CWORD77_DataPool.SetReqArrayData(VarName, DataType, Array, ArraySize);
739 }
740
741
742 ////////////////////////////////////////////////////////////////////////////////////////////
743 ///   SetRequestArrayData
744 /// Templatized Function to set array data into Response _CWORD77_ Data base
745 ///
746 /// \param  [in] VarName
747 ///     UI_32  - key
748 /// \param  [in] DataType
749 ///     EDataType  - Data Type of key
750 /// \param  [in] Array
751 ///     T * - Pointer to an array of given type
752 /// \param  [in] ArraySize
753 ///     UI_32 - No of elements of Array
754 ///
755 /// \return None
756 ///
757 ////////////////////////////////////////////////////////////////////////////////////////////
758 template<class T>
759 void SetResponseArrayData(UI_32 VarName, EDataType DataType, T *Array, UI_32 ArraySize) {
760   g__CWORD77_DataPool.SetRespArrayData<T>(VarName, DataType, Array, ArraySize);
761 }
762 ////////////////////////////////////////////////////////////////////////////////////////////
763 ///   GetRequestArrayData
764 /// Templatized Function to get array data from Request _CWORD77_ Data base
765 ///
766 /// \param  [in] VarName
767 ///     UI_32  - key
768 /// \param  [out] Array
769 ///     T * - Pointer to an array of given type
770 /// \param  [out] ArraySize
771 ///     UI_32 - No of elements of Array
772 ///
773 /// \return None
774 ///
775 ////////////////////////////////////////////////////////////////////////////////////////////
776 template<class T>
777 void GetRequestArrayData(UI_32 VarName, T *Array, UI_32 &ArraySize) {  // NOLINT  (readability/nolint)
778   g__CWORD77_DataPool.GetReqArrayData<T>(VarName, Array, ArraySize);
779 }
780 ////////////////////////////////////////////////////////////////////////////////////////////
781 ///   GetRequestArrayData
782 /// Templatized Function to get array data from Response _CWORD77_ Data base
783 ///
784 /// \param  [in] VarName
785 ///     UI_32  - key
786 /// \param  [out] Array
787 ///     T * - Pointer to an array of given type
788 /// \param  [out] ArraySize
789 ///     UI_32 - No of elements of Array
790 ///
791 /// \return None
792 ///
793 ////////////////////////////////////////////////////////////////////////////////////////////
794 template<class T>
795 void GetResponseArrayData(UI_32 VarName, T *Array, UI_32 &ArraySize) {  // NOLINT  (readability/nolint)
796   g__CWORD77_DataPool.GetRespArrayData<T>(VarName, Array, ArraySize);
797 }
798
799 ////////////////////////////////////////////////////////////////////////////////////////////
800 ///   SetRequestData
801 /// Templatized Function to set data into Request _CWORD77_ Data base
802 ///
803 /// \param  [in] VarName
804 ///     UI_32  - key
805 /// \param  [in] DataType
806 ///     EDataType  - Data Type of key
807 /// \param  [in] Array
808 ///     T  - Data type of key
809 ///
810 /// \return None
811 ///
812 ////////////////////////////////////////////////////////////////////////////////////////////
813 template<class T>
814 void SetRequestData(UI_32 VarName, EDataType DataType, T Array) {
815   g__CWORD77_DataPool.SetReqData<T>(VarName, DataType, Array);
816 }
817 ////////////////////////////////////////////////////////////////////////////////////////////
818 ///   SetRequestData
819 /// Templatized Function to set data into Response _CWORD77_ Data base
820 ///
821 /// \param  [in] VarName
822 ///     UI_32  - key
823 /// \param  [in] DataType
824 ///     EDataType  - Data Type of key
825 /// \param  [in] Array
826 ///     T  - Data type of key
827 ///
828 /// \return None
829 ///
830 ////////////////////////////////////////////////////////////////////////////////////////////
831 template<class T>
832 void SetResponseData(UI_32 VarName, EDataType DataType, T Array) {
833   g__CWORD77_DataPool.SetRespData<T>(VarName, DataType, Array);
834 }
835 ////////////////////////////////////////////////////////////////////////////////////////////
836 ///   GetRequestData
837 /// Templatized Function to get data from Resquest _CWORD77_ Data base
838 ///
839 /// \param  [in] VarName
840 ///     UI_32  - key
841 ///
842 /// \return T - value belong to type T
843 ///
844 ////////////////////////////////////////////////////////////////////////////////////////////
845 template<class T>
846 T GetRequestData(UI_32 VarName) {
847   return g__CWORD77_DataPool.GetReqData<T>(VarName);
848 }
849 ////////////////////////////////////////////////////////////////////////////////////////////
850 ///   GetResponseData
851 /// Templatized Function to get data from Response _CWORD77_ Data base
852 ///
853 /// \param  [in] VarName
854 ///     UI_32  - key
855 ///
856 /// \return T - value belong to type T
857 ///
858 ////////////////////////////////////////////////////////////////////////////////////////////
859 template<class T>
860 T GetResponseData(UI_32 VarName) {
861   return g__CWORD77_DataPool.GetRespData<T>(VarName);
862 }
863
864 ////////////////////////////////////////////////////////////////////////////////////////////
865 ///   SetRequestArrayStringData
866 /// API to set array of string data into Request _CWORD77_ Data base
867 ///
868 /// \param  [in] VarName
869 ///     UI_32  - key
870 /// \param  [in] DataType
871 ///     EDataType  - Data Type of key
872 /// \param  [in] DataValue
873 ///     string [] - array of strings
874 /// \param  [in] ArraySize
875 ///     UI_32 - No of elements of Array
876 ///
877 /// \return None
878 ///
879 ////////////////////////////////////////////////////////////////////////////////////////////
880
881 void SetRequestArrayStringData(UI_32 VarName, EDataType VarType,  std::string DataValue[], UI_32 size);
882
883
884 ////////////////////////////////////////////////////////////////////////////////////////////
885 ///   SetRequestArrayStringData
886 /// API to set array of string data into Response _CWORD77_ Data base
887 ///
888 /// \param  [in] VarName
889 ///     UI_32  - key
890 /// \param  [in] DataType
891 ///     EDataType  - Data Type of key
892 /// \param  [in] DataValue
893 ///     string [] - array of strings
894 /// \param  [in] ArraySize
895 ///     UI_32 - No of elements of Array
896 ///
897 /// \return None
898 ///
899 ////////////////////////////////////////////////////////////////////////////////////////////
900 void SetResponseArrayStringData(UI_32 VarName, EDataType VarType,  std::string DataValue[], UI_32 size);
901
902 ////////////////////////////////////////////////////////////////////////////////////////////
903 ///   GetRequestArrayStringData
904 /// API to get array of string data from Request _CWORD77_ Data base
905 ///
906 /// \param  [in] VarName
907 ///     UI_32  - key
908 /// \param  [out] DataValue
909 ///     string [] - array of strings
910 /// \param  [out] ArraySize
911 ///     UI_32 - No of elements of Array
912 ///
913 /// \return None
914 ///
915 ////////////////////////////////////////////////////////////////////////////////////////////
916
917 void GetRequestArrayStringData(UI_32 VarName, std::string DataValue[], UI_32 &size);  // NOLINT  (readability/nolint)
918
919
920 ////////////////////////////////////////////////////////////////////////////////////////////
921 ///   GetResponseArrayStringData
922 /// API to get array of string data from Response _CWORD77_ Data base
923 ///
924 /// \param  [in] VarName
925 ///     UI_32  - key
926 /// \param  [out] DataValue
927 ///     string [] - array of strings
928 /// \param  [out] ArraySize
929 ///     UI_32 - No of elements of Array
930 ///
931 /// \return None
932 ///
933 ////////////////////////////////////////////////////////////////////////////////////////////
934 void GetResponseArrayStringData(UI_32 VarName, std::string DataValue[], UI_32 &size);  // NOLINT  (readability/nolint)
935
936
937 ////////////////////////////////////////////////////////////////////////////////////////////
938 ///   SetRequestStringData
939 /// API to set string data into Request _CWORD77_ Data base
940 ///
941 /// \param  [in] VarName
942 ///     UI_32  - key
943 /// \param  [in] DataType
944 ///     EDataType  - Data Type of key
945 /// \param  [in] DataValue
946 ///     string [] - array of strings
947 ///
948 /// \return None
949 ///
950 ////////////////////////////////////////////////////////////////////////////////////////////
951 void SetRequestStringData(UI_32 VarName, EDataType VarType,  std::string DataValue);
952
953 ////////////////////////////////////////////////////////////////////////////////////////////
954 ///   SetResponseStringData
955 /// API to set string data into Response _CWORD77_ Data base
956 ///
957 /// \param  [in] VarName
958 ///     UI_32  - key
959 /// \param  [in] DataType
960 ///     EDataType  - Data Type of key
961 /// \param  [in] DataValue
962 ///     string [] - array of strings
963 ///
964 /// \return None
965 ///
966 ////////////////////////////////////////////////////////////////////////////////////////////
967 void SetResponseStringData(UI_32 VarName, EDataType VarType,  std::string DataValue);
968
969 ////////////////////////////////////////////////////////////////////////////////////////////
970 ///   GetRequestStringData
971 /// API to get string data from Request _CWORD77_ Data base
972 ///
973 /// \param  [in] VarName
974 ///     UI_32  - key
975 ///
976 /// \return string - value of data
977 ///
978 ////////////////////////////////////////////////////////////////////////////////////////////
979 std::string GetRequestStringData(UI_32 VarName);
980
981 ////////////////////////////////////////////////////////////////////////////////////////////
982 ///   GetRequestDataLength
983 /// API to get No of elements in a key from request data base
984 ///
985 /// \param  [in] VarName
986 ///     UI_32  - key
987 ///
988 /// \return UI_32 - No of elements
989 ///
990 ////////////////////////////////////////////////////////////////////////////////////////////
991 UI_32 GetRequestDataLength(UI_32 Key);
992
993 ////////////////////////////////////////////////////////////////////////////////////////////
994 ///   GetResponseDataLength
995 /// API to get No of elements in a key from response data base
996 ///
997 /// \param  [in] VarName
998 ///     UI_32  - key
999 ///
1000 /// \return UI_32 - No of elements
1001 ///
1002 ////////////////////////////////////////////////////////////////////////////////////////////
1003
1004 UI_32 GetResponseDataLength(UI_32 Key);
1005
1006 ////////////////////////////////////////////////////////////////////////////////////////////
1007 ///   GetDataTypeFromRequestTable
1008 /// API to get data type of key from request data base
1009 ///
1010 /// \param  [in] VarName
1011 ///     UI_32  - key
1012 ///
1013 /// \return EDataType - Data type of key
1014 ///
1015 ////////////////////////////////////////////////////////////////////////////////////////////
1016
1017 EDataType GetRequestDataType(UI_32 Key);
1018
1019 ////////////////////////////////////////////////////////////////////////////////////////////
1020 ///   GetDataTypeFromResponseTable
1021 /// API to get data type of key from response data base
1022 ///
1023 /// \param  [in] VarName
1024 ///     UI_32  - key
1025 ///
1026 /// \return EDataType - Data type of key
1027 ///
1028 ////////////////////////////////////////////////////////////////////////////////////////////
1029 EDataType GetResponseDataType(UI_32 Key);
1030
1031
1032
1033 class C_CWORD77_Data {
1034  private:
1035   T_CWORD77_DataPool m__CWORD77_RequestDataTable;   ///< Request Data Table
1036   T_CWORD77_DataPool m__CWORD77_ResponseDataTable;    ///< Response Data Table
1037
1038   // Original data pool
1039   // Depricated. Remove once all modules migrates to new API's for accessing data pool
1040   std::map< UI_32, std::vector<CHAR> > m__CWORD77_RequestDataTableOrig;   ///< Request Data Table
1041   std::map< UI_32, std::vector<CHAR> > m__CWORD77_ResponseDataTableOrig;  ///< Response Data Table
1042
1043   static C_CWORD77_Data *m_p_CWORD77_DataInstance;          /// instance to C_CWORD77_Data
1044
1045  public:
1046   ////////////////////////////////////////////////////////////////////////////////////////////
1047   ///   C_CWORD77_Data
1048   /// Constructor for C_CWORD77_Data
1049   /// \param  None
1050   /// \return None
1051   ///
1052   ////////////////////////////////////////////////////////////////////////////////////////////
1053   C_CWORD77_Data();
1054   ////////////////////////////////////////////////////////////////////////////////////////////
1055   ///   C_CWORD77_Data
1056   /// Destructor for C_CWORD77_Data
1057   /// \param  None
1058   /// \return None
1059   ///
1060   ////////////////////////////////////////////////////////////////////////////////////////////
1061   ~C_CWORD77_Data();
1062   ////////////////////////////////////////////////////////////////////////////////////////////
1063   ///   GetInstance
1064   /// API to get single instance of C_CWORD77_Data
1065   /// \param  None
1066   /// \return Pointer to single instance of C_CWORD77_Data
1067   ///
1068   ////////////////////////////////////////////////////////////////////////////////////////////
1069   static C_CWORD77_Data *GetInstance();
1070   ////////////////////////////////////////////////////////////////////////////////////////////
1071   ///   DeleteInstance
1072   /// API to delete single instance of C_CWORD77_DataPool
1073   /// \param  None
1074   /// \return None
1075   ///
1076   ////////////////////////////////////////////////////////////////////////////////////////////
1077   static void DeleteInstance();
1078   ////////////////////////////////////////////////////////////////////////////////////////////
1079   ///   SetReqDataIn_CWORD77_DataPool
1080   /// API to set data associated with request into _CWORD77_ Data Pool
1081   ///
1082   /// \param  [in] f_DataPoolKey
1083   ///     _CWORD77_DataPoolKey  - Data pool key
1084   /// \param  [in] f_uiSize
1085   ///     UI_32  - size of the data
1086   /// \param  [in] f_pData
1087   ///     PVOID  - void pointer to data
1088   ///
1089   /// \return VOID - None
1090   ///
1091   ////////////////////////////////////////////////////////////////////////////////////////////
1092   VOID SetRequData(const _CWORD77_DataPoolKey &f_DataPoolKey, UI_32 f_uiSize, PVOID f_pData);  // NOLINT  (readability/nolint)
1093
1094   ////////////////////////////////////////////////////////////////////////////////////////////
1095   ///   SetReqDataIn_CWORD77_DataPool
1096   /// API to set data associated with request into _CWORD77_ Data Pool
1097   /// Depricated. Do not use.
1098   ///
1099   /// \param  [in] f_uiMsgId
1100   ///     UI_32  - MsgId
1101   /// \param  [in] f_uiSize
1102   ///     UI_32  - size of the data
1103   /// \param  [in] f_pData
1104   ///     PVOID  - void pointer to data
1105   ///
1106   /// \return VOID - None
1107   ///
1108   ////////////////////////////////////////////////////////////////////////////////////////////
1109   VOID SetRequData(UI_32 f_uiMsgId, UI_32 f_uiSize, PVOID f_pData);
1110   ////////////////////////////////////////////////////////////////////////////////////////////
1111   ///   SetRespDataIn_CWORD77_DataPool
1112   /// API to set data associated with response into _CWORD77_ Data Pool
1113   ///
1114   /// \param  [in] f_DataPoolKey
1115   ///     _CWORD77_DataPoolKey  - Data pool key
1116   /// \param  [in] f_uiSize
1117   ///     UI_32  - size of the data
1118   /// \param  [in] f_pData
1119   ///     PVOID  - void pointer to data
1120   ///
1121   /// \return VOID - None
1122   ///
1123   ////////////////////////////////////////////////////////////////////////////////////////////
1124   VOID SetRespoData(const _CWORD77_DataPoolKey &f_DataPoolKey,  // NOLINT  (readability/nolint)
1125                     UI_32 f_uiSize, const PVOID f_pData);
1126
1127   ////////////////////////////////////////////////////////////////////////////////////////////
1128   ///   SetRespDataIn_CWORD77_DataPool
1129   /// API to set data associated with response into _CWORD77_ Data Pool
1130   /// Depricated. Do not use.
1131   ///
1132   /// \param  [in] f_uiMsgId
1133   ///     UI_32  - MsgId
1134   /// \param  [in] f_uiSize
1135   ///     UI_32  - size of the data
1136   /// \param  [in] f_pData
1137   ///     PVOID  - void pointer to data
1138   ///
1139   /// \return VOID - None
1140   ///
1141   ////////////////////////////////////////////////////////////////////////////////////////////
1142   VOID SetRespoData(UI_32 f_uiMsgId, UI_32 f_uiSize, const PVOID f_pData);  // NOLINT  (readability/nolint)
1143   ////////////////////////////////////////////////////////////////////////////////////////////
1144   ///   GetReqDataIn_CWORD77_DataPool
1145   /// API to get data associated with request from _CWORD77_ Data Pool
1146   ///
1147   /// \param  [in] f_DataPoolKey
1148   ///     _CWORD77_DataPoolKey  - Data pool key
1149   /// \param  [in] f_uiSize
1150   ///     UI_32  - size of the data
1151   /// \param  [in] f_pData
1152   ///     PVOID  - void pointer to data
1153   ///
1154   /// \return EFrameworkunifiedStatus - Succes or Error
1155   ///
1156   ////////////////////////////////////////////////////////////////////////////////////////////
1157   EFrameworkunifiedStatus GetRequData(const _CWORD77_DataPoolKey &f_DataPoolKey, UI_32 &f_uiSize,  // NOLINT  (readability/nolint)
1158                          PVOID &f_pData);  // NOLINT  (readability/nolint)
1159
1160   ////////////////////////////////////////////////////////////////////////////////////////////
1161   ///   GetReqDataIn_CWORD77_DataPool
1162   /// API to get data associated with request from _CWORD77_ Data Pool
1163   /// Depricated. Do not use.
1164   ///
1165   /// \param  [in] f_uiMsgId
1166   ///     UI_32  - MsgId
1167   /// \param  [in] f_uiSize
1168   ///     UI_32  - size of the data
1169   /// \param  [in] f_pData
1170   ///     PVOID  - void pointer to data
1171   ///
1172   /// \return EFrameworkunifiedStatus - Succes or Error
1173   ///
1174   ////////////////////////////////////////////////////////////////////////////////////////////
1175   EFrameworkunifiedStatus GetRequData(UI_32 f_uiMsgId, UI_32 &f_uiSize, PVOID &f_pData);  // NOLINT  (readability/nolint)
1176   ////////////////////////////////////////////////////////////////////////////////////////////
1177   ///   GetRespDataFrom_CWORD77_DataPool
1178   /// API to get data associated with response from _CWORD77_ Data Pool
1179   ///
1180   /// \param  [in] f_DataPoolKey
1181   ///     _CWORD77_DataPoolKey  - Data pool key
1182   /// \param  [in] f_uiSize
1183   ///     UI_32  - size of the data
1184   /// \param  [in] f_pData
1185   ///     PVOID  - void pointer to data
1186   ///
1187   /// \return EFrameworkunifiedStatus - Succes or Error
1188   ///
1189   ////////////////////////////////////////////////////////////////////////////////////////////
1190   EFrameworkunifiedStatus GetRespoData(const _CWORD77_DataPoolKey &f_DataPoolKey,  // NOLINT  (readability/nolint)
1191                           UI_32 &f_uiSize,  // NOLINT  (readability/nolint)
1192                           PVOID &f_pData);  // NOLINT  (readability/nolint)
1193
1194   ////////////////////////////////////////////////////////////////////////////////////////////
1195   ///   GetRespDataFrom_CWORD77_DataPool
1196   /// API to get data associated with response from _CWORD77_ Data Pool
1197   /// Depricated. Do not use.
1198   ///
1199   /// \param  [in] f_uiMsgId
1200   ///     UI_32  - MsgId
1201   /// \param  [in] f_uiSize
1202   ///     UI_32  - size of the data
1203   /// \param  [in] f_pData
1204   ///     PVOID  - void pointer to data
1205   ///
1206   /// \return EFrameworkunifiedStatus - Succes or Error
1207   ///
1208   ////////////////////////////////////////////////////////////////////////////////////////////
1209   EFrameworkunifiedStatus GetRespoData(UI_32 f_uiMsgId, UI_32 &f_uiSize, PVOID &f_pData);  // NOLINT  (readability/nolint)
1210 };
1211
1212 #endif /* _CWORD77__DATA_POOL_TABLE_H_ */  // NOLINT  (build/header_guard)
1213 /** @}*/
1214 /** @}*/
1215 /** @}*/
1216 /** @}*/
1217 //@}