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 | |
Timo Tietavainen | a0745d2 | 2019-11-28 09:55:22 +0200 | [diff] [blame^] | 17 | /* |
| 18 | * This source code is part of the near-RT RIC (RAN Intelligent Controller) |
| 19 | * platform project (RICP). |
| 20 | */ |
| 21 | |
Rolf Badorek | ef2bf51 | 2019-08-20 11:17:15 +0300 | [diff] [blame] | 22 | #ifndef SHAREDDATALAYER_REDIS_CONTENTSBUILDER_HPP_ |
| 23 | #define SHAREDDATALAYER_REDIS_CONTENTSBUILDER_HPP_ |
| 24 | |
| 25 | #include "private/asyncconnection.hpp" |
| 26 | |
| 27 | namespace shareddatalayer |
| 28 | { |
| 29 | namespace redis |
| 30 | { |
| 31 | struct Contents; |
| 32 | |
| 33 | class ContentsBuilder |
| 34 | { |
| 35 | public: |
| 36 | ContentsBuilder(const char nsKeySeparator); |
| 37 | |
| 38 | ContentsBuilder(const ContentsBuilder&) = delete; |
| 39 | |
| 40 | ContentsBuilder& operator = (const ContentsBuilder&) = delete; |
| 41 | |
| 42 | virtual ~ContentsBuilder(); |
| 43 | |
| 44 | virtual Contents build(const std::string& string) const; |
| 45 | |
| 46 | virtual Contents build(const std::string& string, |
| 47 | const std::string& string2) const; |
| 48 | |
| 49 | virtual Contents build(const std::string& string, |
| 50 | const std::string& string2, |
| 51 | const std::string& string3) const; |
| 52 | |
| 53 | virtual Contents build(const std::string& string, |
| 54 | const AsyncConnection::Namespace& ns, |
| 55 | const AsyncConnection::DataMap& dataMap) const; |
| 56 | |
| 57 | virtual Contents build(const std::string& string, |
| 58 | const AsyncConnection::Namespace& ns, |
| 59 | const AsyncConnection::DataMap& dataMap, |
| 60 | const std::string& string2, |
| 61 | const std::string& string3) const; |
| 62 | |
| 63 | virtual Contents build(const std::string& string, |
| 64 | const AsyncConnection::Namespace& ns, |
| 65 | const AsyncConnection::Key& key, |
| 66 | const AsyncConnection::Data& data) const; |
| 67 | |
| 68 | virtual Contents build(const std::string& string, |
| 69 | const AsyncConnection::Namespace& ns, |
| 70 | const AsyncConnection::Key& key, |
| 71 | const AsyncConnection::Data& data, |
| 72 | const std::string& string2, |
| 73 | const std::string& string3) const; |
| 74 | |
| 75 | virtual Contents build(const std::string& string, |
| 76 | const AsyncConnection::Namespace& ns, |
| 77 | const AsyncConnection::Key& key, |
| 78 | const AsyncConnection::Data& data, |
| 79 | const AsyncConnection::Data& data2) const; |
| 80 | |
| 81 | virtual Contents build(const std::string& string, |
| 82 | const AsyncConnection::Namespace& ns, |
| 83 | const AsyncConnection::Key& key, |
| 84 | const AsyncConnection::Data& data, |
| 85 | const AsyncConnection::Data& data2, |
| 86 | const std::string& string2, |
| 87 | const std::string& string3) const; |
| 88 | |
| 89 | virtual Contents build(const std::string& string, |
| 90 | const AsyncConnection::Namespace& ns, |
| 91 | const AsyncConnection::Keys& keys) const; |
| 92 | |
| 93 | virtual Contents build(const std::string& string, |
| 94 | const AsyncConnection::Namespace& ns, |
| 95 | const AsyncConnection::Keys& keys, |
| 96 | const std::string& string2, |
| 97 | const std::string& string3) const; |
| 98 | |
| 99 | private: |
| 100 | const char nsKeySeparator; |
| 101 | |
| 102 | void addString(Contents& contents, |
| 103 | const std::string& string) const; |
| 104 | |
| 105 | void addDataMap(Contents& contents, |
| 106 | const AsyncConnection::Namespace& ns, |
| 107 | const AsyncConnection::DataMap& dataMap) const; |
| 108 | |
| 109 | void addKey(Contents& contents, |
| 110 | const AsyncConnection::Namespace& ns, |
| 111 | const AsyncConnection::Key& key) const; |
| 112 | |
| 113 | void addData(Contents& contents, |
| 114 | const AsyncConnection::Data& data) const; |
| 115 | |
| 116 | void addKeys(Contents& contents, |
| 117 | const AsyncConnection::Namespace& ns, |
| 118 | const AsyncConnection::Keys& keys) const; |
| 119 | }; |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | #endif |