OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
CrowReturnable.h
Go to the documentation of this file.
1#pragma once
2
3#include "crow_win.h"
4
5namespace Utils
6{
7 template <typename T>
8 class CrowReturnable : public crow::returnable
9 {
10 public:
11 CrowReturnable(const T& t, const std::string& contentType)
12 : crow::returnable(contentType)
13 , m_t(t)
14 {}
15
16 protected:
17 const T& m_t;
18
19 // Inherited via returnable
20 std::string dump() const override;
21
22 virtual std::string to_string() const = 0;
23
24 };
25
26 template<typename T>
27 inline std::string CrowReturnable<T>::dump() const
28 {
29 return to_string();
30 }
31}
CrowReturnable(const T &t, const std::string &contentType)
std::string dump() const override
virtual std::string to_string() const =0