libcluon  0.0.148
EnvelopeConverter.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017-2018 Christian Berger
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 
9 #ifndef CLUON_ENVELOPECONVERTER_HPP
10 #define CLUON_ENVELOPECONVERTER_HPP
11 
12 #include "cluon/MetaMessage.hpp"
13 #include "cluon/cluon.hpp"
14 #include "cluon/cluonDataStructures.hpp"
15 
16 #include <cstdint>
17 #include <map>
18 #include <string>
19 #include <vector>
20 
21 namespace cluon {
26  private:
27  EnvelopeConverter(const EnvelopeConverter &) = delete;
29  EnvelopeConverter &operator=(const EnvelopeConverter &) = delete;
30  EnvelopeConverter &operator=(EnvelopeConverter &&) = delete;
31 
32  public:
33  EnvelopeConverter() = default;
34 
43  int32_t setMessageSpecification(const std::string &ms) noexcept;
44 
53  std::string getJSONFromProtoEncodedEnvelope(const std::string &protoEncodedEnvelope) noexcept;
54 
61  std::string getJSONFromEnvelope(cluon::data::Envelope &envelope) noexcept;
62 
73  std::string getProtoEncodedEnvelopeFromJSONWithoutTimeStamps(const std::string &json, int32_t messageIdentifier, uint32_t senderStamp) noexcept;
74 
85  std::string getProtoEncodedEnvelopeFromJSON(const std::string &json, int32_t messageIdentifier, uint32_t senderStamp) noexcept;
86 
87  private:
88 // clang-format off
89  std::string getProtoEncodedEnvelopeFromJSON(const std::string &json, int32_t messageIdentifier, uint32_t senderStamp, cluon::data::TimeStamp sampleTimeStamp) noexcept;
90 // clang-format on
91 
92  private:
93  std::vector<cluon::MetaMessage> m_listOfMetaMessages{};
94  std::map<int32_t, cluon::MetaMessage> m_scopeOfMetaMessages{};
95 };
96 } // namespace cluon
97 #endif
Definition: cluon.hpp:65
Definition: EnvelopeConverter.hpp:25
#define LIBCLUON_API
Definition: cluon.hpp:56