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