#include <chrono>
#include <string>
#include <type_traits>
#include "lintel/core/utils/DateTimeFormat.h"
Go to the source code of this file.
◆ IMPLEMENT_SERIALIZE
| #define IMPLEMENT_SERIALIZE |
( |
|
type, |
|
|
|
convertToString, |
|
|
|
convertToValue |
|
) |
| |
Value: template<> class Serialization<type> \
{ \
public: \
static std::string serialize(const type &value) { return convertToString(value); } \
static type deserialize(const std::string &value) { return convertToValue(value); } \
};
Macro that generates a full specialization of Serialization for a given type with the provided serialization and deserialization lambdas or functions.
- Parameters
-
| type | the type to specialize for |
| convertToString | expression/lambda to convert the type to std::string |
| convertToValue | expression/lambda to convert std::string to the type |