Files
reflect-cpp/docs
..
2023-10-08 11:49:21 +02:00
2023-10-03 17:49:47 +02:00
2023-10-07 14:08:07 +02:00
2023-10-04 20:07:32 +02:00
2023-10-08 11:50:47 +02:00
2023-10-07 13:19:01 +02:00
2023-10-04 20:22:01 +02:00
2023-10-04 23:01:36 +02:00
2023-10-04 20:12:11 +02:00

Documentation

image

1) The basics

1.1) Structs - Recaps the motivating example in the README. A struct is the equivalent of an AND statement or a product type in type theory.

1.2) Optional fields - For defining fields in your serialized format that might be absent in some cases.

1.3) Struct flattening - For making struct A "inherit" the fields of struct B.

1.4) String literals - For representing strings that can only assume a limited number of enumerated values.

1.5) std::variant and rfl::TaggedUnion - For structs that can be one of several formats. This is the equivalent of an OR statement or a sum type in type theory.

1.6) rfl::Box and rfl::Ref - For defining recursive structures.

1.7) rfl::Timestamp - For serializing and deserializing timestamps.

2) Custom classes

2.1) Custom classes - For custom classes with private fields.

2.2) Custom parsers for your classes - For custom classes with private fields that you want to leave absolutely untouched.

3) Useful helper functions and classes

3.1) rfl::replace - For replacing one or several fields in a struct.

3.2) rfl::as - For casting structs as other structs.