Bond
bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr > Struct Template Reference

Field description in compile-time schema. More...

Public Types

typedef Struct struct_type
 Type of the field's parent struct. More...
 
typedef FieldType Struct::* field_pointer
 Type of the field pointer. More...
 
typedef remove_maybe< FieldType >::type field_type
 Type of the field. More...
 
typedef FieldType value_type
 Type of the field value. More...
 
typedef ModifierTag field_modifier
 Modifier tag for the field. More...
 

Static Public Member Functions

static const value_typeGetVariable (const struct_type &object)
 Static method returning const reference to the field value for a particular object. More...
 
static value_typeGetVariable (struct_type &object)
 Static method returning reference to the field value for a particular object. More...
 

Public Attributes

BOND_STATIC_CONSTEXPR uint16_t id = field_id
 Static data member equal to the field ordinal. More...
 

Static Public Attributes

static const Metadata & metadata = *metadata_ptr
 Static data member describing field metadata. More...
 
static const field_pointer field = field_ptr
 Static data member representing the field pointer. More...
 

Detailed Description

template<uint16_t field_id, typename ModifierTag, typename Struct, typename FieldType, FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
struct bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >

Field description in compile-time schema.

Member Typedef Documentation

◆ field_modifier

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
typedef ModifierTag bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::field_modifier

Modifier tag for the field.

Can be one of:

  • bond::reflection::optional_field_modifier
  • bond::reflection::required_field_modifier
  • bond::reflection::required_optional_field_modifier

◆ field_pointer

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
typedef FieldType Struct::* bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::field_pointer

Type of the field pointer.

◆ field_type

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
typedef remove_maybe<FieldType>::type bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::field_type

Type of the field.

◆ struct_type

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
typedef Struct bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::struct_type

Type of the field's parent struct.

◆ value_type

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
typedef FieldType bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::value_type

Type of the field value.

Member Function Documentation

◆ GetVariable() [1/2]

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
static const value_type & bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::GetVariable ( const struct_type object)
static

Static method returning const reference to the field value for a particular object.

◆ GetVariable() [2/2]

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
static value_type & bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::GetVariable ( struct_type object)
static

Static method returning reference to the field value for a particular object.

Member Data Documentation

◆ field

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const Metadata * metadata_ptr>
const FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::field_pointer bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::field = field_ptr
static

Static data member representing the field pointer.

◆ id

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const bond::Metadata * metadata_ptr>
BOND_STATIC_CONSTEXPR uint16_t bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::id = field_id

Static data member equal to the field ordinal.

◆ metadata

template<uint16_t field_id, typename ModifierTag , typename Struct , typename FieldType , FieldType Struct::* field_ptr, const Metadata * metadata_ptr>
const bond::Metadata & bond::reflection::FieldTemplate< field_id, ModifierTag, Struct, FieldType, field_ptr, metadata_ptr >::metadata = *metadata_ptr
static

Static data member describing field metadata.