Sane C++ Libraries
C++ Platform Abstraction Libraries
Reflection

🟩 Describe C++ types at compile time for serialization (see Reflection for more details) More...

Classes

struct  SC::Reflection::TypeInfo
 [reflectionSnippet3] More...
 
struct  SC::Reflection::ArrayWithSize< T, N >
 A constexpr array. More...
 
struct  SC::Reflection::WritableRange< Type >
 A writable span of objects. More...
 
struct  SC::Reflection::Sv
 A minimal ASCII StringView with shortened name to be used in TypeToString. More...
 
struct  SC::Reflection::TypeToString< T >
 Strips down class name produced by ClNm to reduce binary size (from C++17 going forward) More...
 
struct  SC::Reflection::SchemaCompiler< SchemaBuilder >
 Creates a schema linking a series of SchemaType. More...
 
struct  SC::Reflection::SchemaType< TypeVisitor >
 Holds together a TypeInfo, a StringView and a type-erased builder function pointer. More...
 
struct  SC::Reflection::SchemaBuilder< TypeVisitor >
 Common code for derived class to create a SchemaBuilder suitable for SC::Reflection::SchemaCompiler. More...
 
struct  SC::Reflection::FlatSchemaBuilder
 A schema builder that doesn't build any virtual table. More...
 

Typedefs

using SC::Reflection::TypeStringView = Sv
 
using SC::Reflection::Schema = Reflection::SchemaCompiler< FlatSchemaBuilder >
 Default schema not building any virtual table. More...
 

Enumerations

enum class  SC::Reflection::TypeCategory : uint8_t {
  SC::Reflection::TypeCategory::TypeInvalid = 0 ,
  SC::Reflection::TypeCategory::TypeBOOL = 1 ,
  SC::Reflection::TypeCategory::TypeUINT8 = 2 ,
  SC::Reflection::TypeCategory::TypeUINT16 = 3 ,
  SC::Reflection::TypeCategory::TypeUINT32 = 4 ,
  SC::Reflection::TypeCategory::TypeUINT64 = 5 ,
  SC::Reflection::TypeCategory::TypeINT8 = 6 ,
  SC::Reflection::TypeCategory::TypeINT16 = 7 ,
  SC::Reflection::TypeCategory::TypeINT32 = 8 ,
  SC::Reflection::TypeCategory::TypeINT64 = 9 ,
  SC::Reflection::TypeCategory::TypeFLOAT32 = 10 ,
  SC::Reflection::TypeCategory::TypeDOUBLE64 = 11 ,
  SC::Reflection::TypeCategory::TypeStruct = 12 ,
  SC::Reflection::TypeCategory::TypeArray = 13 ,
  SC::Reflection::TypeCategory::TypeVector = 14
}
 Enumeration of possible category types recognized by Reflection. More...
 

Detailed Description

🟩 Describe C++ types at compile time for serialization (see Reflection for more details)

Reflection generates compile time information of fields in a structure or class.
Typically this library is used with one of the serialization libraries ( Serialization Binary or Serialization Text).

Note
Reflection uses more complex C++ constructs compared to other libraries in this repository. To limit the issue, effort has been spent trying not to use obscure C++ meta-programming techniques. The library uses only template partial specialization and constexpr.

Typedef Documentation

◆ Schema

#include <ReflectionSchemaCompiler.h>

Default schema not building any virtual table.

Enumeration Type Documentation

◆ TypeCategory

#include <Reflection.h>

Enumeration of possible category types recognized by Reflection.

Note
We can use only 7 of the 8 bits here, as in TypeInfo we're stealing 1 bit for TypeInfo::hasLink [reflectionSnippet3]
Enumerator
TypeInvalid 

Invalid type sentinel.

TypeBOOL 

Type is bool

TypeUINT8 

Type is uint8_t

TypeUINT16 

Type is uint16_t

TypeUINT32 

Type is uint32_t

TypeUINT64 

Type is uint64_t

TypeINT8 

Type is int8_t

TypeINT16 

Type is int16_t

TypeINT32 

Type is int32_t

TypeINT64 

Type is int64_t

TypeFLOAT32 

Type is float

TypeDOUBLE64 

Type is double

TypeStruct 

Type is a struct type.

TypeArray 

Type is an array type.

TypeVector 

Type is a vector type.