lintel 0.2.0
Loading...
Searching...
No Matches
Serialization.h
Go to the documentation of this file.
1#ifndef LINTEL_SERIALIZATION_H
2#define LINTEL_SERIALIZATION_H
3
4#include <exception>
5#include <memory>
6
10
11namespace lintel {
12namespace db {
18 template<typename T> class Serialization
19 {
20 public:
28 static std::string serialize(T type, const std::shared_ptr<DatabaseConnectionEntry> &connectionEntry)
29 {
30 switch (connectionEntry->getType()) {
35 default:
36 throw std::runtime_error("not supported connection type");
37 }
38 }
39
47 static T deserialize(const std::string &value, const std::shared_ptr<DatabaseConnectionEntry> &connectionEntry)
48 {
49 switch (connectionEntry->getType()) {
54 default:
55 throw std::runtime_error("not supported connection type");
56 }
57 }
58 };
59}// namespace db
60
61}// namespace lintel
62#endif// LINTEL_SERIALIZATION_H
@ SQLite
Definition ConnectionType.h:18
@ PostgreSQL
Definition ConnectionType.h:18
Definition Serialization.h:19
static std::string serialize(T type, const std::shared_ptr< DatabaseConnectionEntry > &connectionEntry)
Definition Serialization.h:28
static T deserialize(const std::string &value, const std::shared_ptr< DatabaseConnectionEntry > &connectionEntry)
Definition Serialization.h:47
Definition Serialization.h:34
Definition Serialization.h:38
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9