Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
meta_info.h
1#ifndef META_INFO_H
2#define META_INFO_H
3
4#include <stdint.h>
5#include <map>
6#include <string>
7#include "../core/optional.h"
8
9namespace ara
10{
12 namespace diag
13 {
15 enum class Context : uint32_t
16 {
19 kDoIP
20 };
21
23 class MetaInfo final
24 {
25 private:
26 Context mContext;
27 std::map<std::string, std::string> mValues;
28
29 public:
30 MetaInfo() noexcept = delete;
31 MetaInfo(const MetaInfo &) = delete;
32 MetaInfo(MetaInfo &&) noexcept = default;
33
36 MetaInfo(Context context);
37
38 MetaInfo &operator=(const MetaInfo &) = delete;
39 MetaInfo &operator=(MetaInfo &&) & = default;
40
45
50 void SetValue(std::string key, std::string value);
51
54 Context GetContext() const noexcept;
55
56 ~MetaInfo() = default;
57 };
58 }
59}
60
61#endif
A wrapper around a possible value.
Definition: optional.h:16
Diagnostic metainfo in different context.
Definition: meta_info.h:24
Context GetContext() const noexcept
Get metainfo context.
Definition: meta_info.cpp:32
core::Optional< std::string > GetValue(std::string key)
Get an entry value within the metainfo.
Definition: meta_info.cpp:12
void SetValue(std::string key, std::string value)
Add a key-value pair to the metainfo.
Definition: meta_info.cpp:26
Context
Diagnostic metainfo context.
Definition: meta_info.h:16
@ kFaultMemory
For Data IDentifier (DID) according to ISO 14229-1 in diagnostic snapshots.
@ kDiagnosticCommunication
For service request in classic platform Diagnostic Communication Manager (DCM)
@ kDoIP
For reading Vehicle Identifier Number (VIN) according to ISO 3779.