Spicy
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
hilti::rt::type_info::struct_::Field Struct Reference

#include <type-info.h>

Public Types

using Accessor = const void *(*)(const Value &v)
 

Public Member Functions

 Field (const char *name, const TypeInfo *type, std::ptrdiff_t offset, bool internal, Accessor accessor=accessor_default)
 
bool isInternal () const
 

Static Public Member Functions

static const void * accessor_default (const Value &v)
 
template<typename T >
static Accessor accessor_optional ()
 

Public Attributes

const std::string name
 
const TypeInfotype
 

Friends

class type_info::Struct
 

Detailed Description

Auxiliary type information for type struct describing one field.

Member Typedef Documentation

◆ Accessor

using hilti::rt::type_info::struct_::Field::Accessor = const void* (*)(const Value& v)

Type of a function that, given a field value, returns a pointer to the contained value.

Constructor & Destructor Documentation

◆ Field()

hilti::rt::type_info::struct_::Field::Field ( const char *  name,
const TypeInfo type,
std::ptrdiff_t  offset,
bool  internal,
Accessor  accessor = accessor_default 
)
inline

Constructor.

Parameters
nameID of the field
typetype of the field
offsetoffset of the field in number bytes inside the struct
accessorfunction returning a pointer to a fields value

Member Function Documentation

◆ accessor_default()

static const void* hilti::rt::type_info::struct_::Field::accessor_default ( const Value v)
inlinestatic

Default accessor function suitable for non-optional fields.

◆ accessor_optional()

template<typename T >
static Accessor hilti::rt::type_info::struct_::Field::accessor_optional ( )
inlinestatic

Alternative accessor function for &optional fields.

Member Data Documentation

◆ name

const std::string hilti::rt::type_info::struct_::Field::name

ID of the field

◆ type

const TypeInfo* hilti::rt::type_info::struct_::Field::type

< type of the field


The documentation for this struct was generated from the following file: