Skip to content

Commit

Permalink
Updated style
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed May 27, 2022
1 parent efb0802 commit b455e90
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/depthai-shared/utility/Serialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,18 @@ inline bool deserialize(const std::vector<std::uint8_t>& data, T& obj) {
#define DEPTHAI_NLOHMANN_JSON_OPTIONAL_TO(v1) nlohmann::to_json(nlohmann_json_j[#v1], nlohmann_json_t.v1);
#define DEPTHAI_NLOHMANN_JSON_OPTIONAL_FROM(v1) \
if(nlohmann_json_j.contains(#v1)) nlohmann_json_j[#v1].get_to(nlohmann_json_t.v1);
#define DEPTHAI_NLOHMANN_DEFINE_TYPE_OPTIONAL_NON_INTRUSIVE(Type, ...) \
inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { \
#define DEPTHAI_NLOHMANN_DEFINE_TYPE_OPTIONAL_NON_INTRUSIVE(Type, ...) \
inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { \
DEPTHAI_NLOHMANN_JSON_EXPAND(DEPTHAI_NLOHMANN_JSON_PASTE(DEPTHAI_NLOHMANN_JSON_OPTIONAL_TO, __VA_ARGS__)) \
} \
inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { \
} \
inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { \
DEPTHAI_NLOHMANN_JSON_EXPAND(DEPTHAI_NLOHMANN_JSON_PASTE(DEPTHAI_NLOHMANN_JSON_OPTIONAL_FROM, __VA_ARGS__)) \
}
#define DEPTHAI_NLOHMANN_DEFINE_TYPE_OPTIONAL_INTRUSIVE(Type, ...) \
friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { \
#define DEPTHAI_NLOHMANN_DEFINE_TYPE_OPTIONAL_INTRUSIVE(Type, ...) \
friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { \
DEPTHAI_NLOHMANN_JSON_EXPAND(DEPTHAI_NLOHMANN_JSON_PASTE(DEPTHAI_NLOHMANN_JSON_OPTIONAL_TO, __VA_ARGS__)) \
} \
friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { \
} \
friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { \
DEPTHAI_NLOHMANN_JSON_EXPAND(DEPTHAI_NLOHMANN_JSON_PASTE(DEPTHAI_NLOHMANN_JSON_OPTIONAL_FROM, __VA_ARGS__)) \
}

Expand Down

0 comments on commit b455e90

Please sign in to comment.