wex v24.04.0
Classes | Public Types | Public Member Functions | List of all members
wex::reflection Class Reference

This class offers reflection for any kind of class members, as long as you add a conversion from / to std::any. More...

#include <wex/core/reflection.h>

Classes

struct  reflection_t
 The reflection type, as a struct of name and callback. More...
 

Public Types

enum class  log_t { ALL , SKIP_EMPTY }
 Determines what to log. More...
 
typedef std::function< std::any()> function_t
 Callback for functions.
 
typedef struct wex::reflection::reflection_t reflection_t
 The reflection type, as a struct of name and callback.
 

Public Member Functions

 reflection (const std::vector< reflection_t > &v, log_t=log_t::ALL)
 Constructor, sets all reflection items and log_t.
 
std::stringstream log () const
 Logs all items to a std::stringstream.
 

Detailed Description

This class offers reflection for any kind of class members, as long as you add a conversion from / to std::any.

Member Typedef Documentation

◆ function_t

typedef std::function<std::any()> wex::reflection::function_t

Callback for functions.

Just return your class member, as an std::any type.

Member Enumeration Documentation

◆ log_t

enum class wex::reflection::log_t
strong

Determines what to log.

Enumerator
ALL 

log empty values as well

SKIP_EMPTY 

do not log empty values