Initial commit of source directory
[ric-app/hw.git] / src / xapp-utils / xapp_sdl.cc
1 /*
2 ==================================================================================
3
4         Copyright (c) 2018-2019 AT&T Intellectual Property.
5
6    Licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8    You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing, software
13    distributed under the License is distributed on an "AS IS" BASIS,
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    See the License for the specific language governing permissions and
16    limitations under the License.
17 ==================================================================================
18  */
19
20 /*
21  * xapp_sdl.cc
22  *
23  *  Created on: Mar, 2020
24  *  Author: Shraboni Jana
25  */
26 #include "xapp_sdl.hpp"
27 /*need to work on the SDL FLow.
28 As per Matti
29 An xApp can use the SDL for two things:
30 - persisting state for itself (in case it fails and recovers)
31 - making information available for other xApps. The xApp would typically write using SDL directly. The consumer of the data could also use SDL directly or use an access library like in the case of the R-NIB.
32 */
33 void XappSDL::insert_data(){
34         //connecting to the Redis and generating a random key for namespace "hwxapp"
35
36                  DataMap dmap;
37                  char key[4]={'a','b','c'};
38                  std::cout << "KEY: "<< key << std::endl;
39                  Key k = key;
40                  Data d;
41                  uint8_t num = 101;
42                  d.push_back(num);
43                  dmap.insert({k,d});
44                  sdl->set(ns, dmap);
45 }
46
47