RIC:1060: Change in PTL
[ric-plt/sdl.git] / include / private / asyncconnection.hpp
1 /*
2    Copyright (c) 2018-2019 Nokia.
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  * This source code is part of the near-RT RIC (RAN Intelligent Controller)
19  * platform project (RICP).
20 */
21
22 #ifndef SHAREDDATALAYER_ASYNCCONNECTION_HPP_
23 #define SHAREDDATALAYER_ASYNCCONNECTION_HPP_
24
25 #include <cstdint>
26 #include <functional>
27 #include <map>
28 #include <memory>
29 #include <set>
30 #include <string>
31 #include <system_error>
32 #include <utility>
33 #include <vector>
34 #include <sdl/errorqueries.hpp>
35
36 namespace shareddatalayer
37 {
38     /**
39      * @brief Deprecated API, some type definitions left because still used by other classes in SDL implementation.
40      */
41     class AsyncConnection
42     {
43     public:
44         /**
45          * Separator defines the character that API uses to logically separate the namespace
46          * and the key when forming an SDL key. Thus, the separator character cannot be part
47          * of the namespace string. Also namespace identifier cannot be an empty string.
48          *
49          * The character used as separator is <code>,</code>
50          *
51          * API otherwise does not impose additional restrictions to used characters, though
52          * excessive and unnecessary usage of special characters is strongly discouraged.
53          */
54         static const char SEPARATOR;
55
56         using Key = std::string;
57
58         using Data = std::vector<uint8_t>;
59
60         using DataMap = std::map<Key, Data>;
61
62         using Keys = std::set<Key>;
63
64         using Namespace = std::string;
65
66         /**
67          * publisherId: Identification that can be set by a publisher to identify the source of
68          *              the modification. Process that is modifying data in a namespace and is
69          *              also subscribed to the same namespace can utilize the publisherId to
70          *              distinguish events that it published itself.
71          */
72         using PublisherId = std::string;
73     };
74 }
75
76 #endif