Cogs.Core
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Cogs::Reflection Namespace Reference

Contains reflection support. More...

Namespaces

namespace  detail
 Resepy from: https://developercommunity.visualstudio.com/t/C2607-after-upgrading-to-Visual-Studio-1/1666785.
 

Classes

struct  Attribute
 An attribute containing metadata or describing behavior of a structure. More...
 
struct  Attributes
 Attribute storage for structures. More...
 
struct  Enumerator
 Single integral constant enumerator. More...
 
struct  EnumeratorDef
 
class  Field
 Field definition describing a single data member of a data structure. More...
 
struct  FieldWrapper
 Convenience wrapper for adding attributes during field creation in a type safe manner. More...
 
struct  GenericAttribute
 Base attribute type for generic attributes. More...
 
class  Method
 Simple method definition. More...
 
struct  Name
 Represents an unique name. More...
 
struct  RegularAttribute
 Base attribute type for regular attributes. More...
 
class  Type
 Represents a discrete type definition, describing a native type class. More...
 
class  TypeDatabase
 Manages all Type instances currently created in the system. More...
 
struct  TypeFlags
 Type flags controlling type behavior. More...
 
class  TypeStore
 Storage class for registered types. More...
 

Typedefs

using CreateInstance = void *(*)()
 Object creation function type. Comparable to regular new.
 
using ConstructInstance = void *(*)(void *)
 Object construction function type. Comparable to placement new.
 
using DestroyInstance = void(*)(void *)
 Object destroy function type. Comparable to regular delete.
 
using DestructInstance = void(*)(void *)
 Object destruction function type. Comparable to calling the destructor.
 
using TypeId = uint16_t
 Built in type used to uniquely identify a single type instance.
 
using FieldId = uint16_t
 Type used to index fields.
 
using MethodId = uint16_t
 Type used to index methods.
 

Enumerations

enum struct  FieldFlags : uint16_t { Default = 0 , Pointer = 0x1 , Array = 0x2 , NoSerialize = 0x4 }
 Field flags. More...
 

Functions

FieldFlags operator| (FieldFlags lhs, FieldFlags rhs)
 Or operator.
 
FieldFlags operator& (FieldFlags lhs, FieldFlags rhs)
 And operator.
 
FieldFlagsoperator|= (FieldFlags &lhs, FieldFlags rhs)
 Or assignment operator.
 

Variables

constexpr size_t kMaxMethodArguments = 4
 Max number of method arguments supported.
 
constexpr TypeId NoType = 0xFFFF
 Definition of no type.
 
constexpr FieldId NoField = 0xFFFF
 No field id.
 
constexpr MethodId NoMethod = 0xFFFF
 No method id.
 

Detailed Description

Contains reflection support.

Typedef Documentation

◆ ConstructInstance

using Cogs::Reflection::ConstructInstance = typedef void* (*)(void*)

Object construction function type. Comparable to placement new.

Definition at line 39 of file Name.h.

◆ CreateInstance

using Cogs::Reflection::CreateInstance = typedef void* (*)()

Object creation function type. Comparable to regular new.

Definition at line 36 of file Name.h.

◆ DestroyInstance

using Cogs::Reflection::DestroyInstance = typedef void (*)(void*)

Object destroy function type. Comparable to regular delete.

Definition at line 42 of file Name.h.

◆ DestructInstance

using Cogs::Reflection::DestructInstance = typedef void (*)(void *)

Object destruction function type. Comparable to calling the destructor.

Definition at line 45 of file Name.h.

◆ FieldId

using Cogs::Reflection::FieldId = typedef uint16_t

Type used to index fields.

Definition at line 54 of file Name.h.

◆ MethodId

using Cogs::Reflection::MethodId = typedef uint16_t

Type used to index methods.

Definition at line 57 of file Name.h.

◆ TypeId

using Cogs::Reflection::TypeId = typedef uint16_t

Built in type used to uniquely identify a single type instance.

Definition at line 48 of file Name.h.

Enumeration Type Documentation

◆ FieldFlags

enum struct Cogs::Reflection::FieldFlags : uint16_t
strong

Field flags.

Enumerator
Default 

Standard field.

Pointer 

Field is a pointer.

Array 

Field is an array.

NoSerialize 

Skip Serialize field.

Definition at line 41 of file Field.h.

Function Documentation

◆ operator&()

FieldFlags Cogs::Reflection::operator& ( FieldFlags  lhs,
FieldFlags  rhs 
)
inline

And operator.

Definition at line 59 of file Field.h.

◆ operator|()

FieldFlags Cogs::Reflection::operator| ( FieldFlags  lhs,
FieldFlags  rhs 
)
inline

Or operator.

Definition at line 55 of file Field.h.

◆ operator|=()

FieldFlags & Cogs::Reflection::operator|= ( FieldFlags lhs,
FieldFlags  rhs 
)
inline

Or assignment operator.

Definition at line 62 of file Field.h.

Variable Documentation

◆ kMaxMethodArguments

constexpr size_t Cogs::Reflection::kMaxMethodArguments = 4
constexpr

Max number of method arguments supported.

Definition at line 25 of file Method.h.

Referenced by Cogs::Reflection::Method::compareSizes(), and Cogs::Reflection::Method::setSizes().

◆ NoField

constexpr FieldId Cogs::Reflection::NoField = 0xFFFF
constexpr

No field id.

Definition at line 60 of file Name.h.

Referenced by Cogs::Reflection::Type::getField(), and Cogs::Reflection::Type::getFieldId().

◆ NoMethod

constexpr MethodId Cogs::Reflection::NoMethod = 0xFFFF
constexpr

No method id.

Definition at line 63 of file Name.h.

◆ NoType

constexpr TypeId Cogs::Reflection::NoType = 0xFFFF
constexpr