Kea  1.5.0
isc::eval::variant< S > Struct Template Reference

A char[S] buffer to store and retrieve objects. More...

#include <parser.h>

Public Types

typedef variant< S > self_type
 Type of *this. More...
 

Public Member Functions

 variant ()
 Empty construction. More...
 
template<typename T >
 variant (YY_RVREF(T) t)
 Construct and fill. More...
 
 ~variant ()
 Destruction, allowed only if empty. More...
 
template<typename T >
T & as ()
 Accessor to a built T. More...
 
template<typename T >
const T & as () const
 Const accessor to a built T (for printer). More...
 
template<typename T >
T & build ()
 Instantiate an empty T in here. More...
 
template<typename T >
T & build (const T &t)
 Instantiate a T in here from t. More...
 
template<typename T >
void copy (const self_type &other)
 Copy the content of other to this. More...
 
template<typename T >
void destroy ()
 Destroy the stored T. More...
 
template<typename T >
T & emplace ()
 Instantiate an empty T in here. More...
 
template<typename T >
T & emplace (const T &t)
 Instantiate a T in here from t. More...
 
template<typename T >
void move (self_type &other)
 Move the content of other to this. More...
 
template<typename T >
void swap (self_type &other)
 Swap the content with other, of same type. More...
 

Detailed Description

template<size_t S>
struct isc::eval::variant< S >

A char[S] buffer to store and retrieve objects.

Sort of a variant, but does not keep track of the nature of the stored data, since that knowledge is available via the current state.

Definition at line 295 of file parser.h.

Member Typedef Documentation

◆ self_type

template<size_t S>
typedef variant<S> isc::eval::variant< S >::self_type

Type of *this.

Definition at line 298 of file parser.h.

Constructor & Destructor Documentation

◆ variant() [1/2]

template<size_t S>
isc::eval::variant< S >::variant ( )
inline

Empty construction.

Definition at line 301 of file parser.h.

◆ variant() [2/2]

template<size_t S>
template<typename T >
isc::eval::variant< S >::variant ( YY_RVREF(T)  t)
inline

Construct and fill.

Definition at line 308 of file parser.h.

◆ ~variant()

template<size_t S>
isc::eval::variant< S >::~variant ( )
inline

Destruction, allowed only if empty.

Definition at line 316 of file parser.h.

Member Function Documentation

◆ as() [1/2]

template<size_t S>
template<typename T >
T& isc::eval::variant< S >::as ( )
inline

◆ as() [2/2]

template<size_t S>
template<typename T >
const T& isc::eval::variant< S >::as ( ) const
inline

Const accessor to a built T (for printer).

Definition at line 388 of file parser.h.

◆ build() [1/2]

template<size_t S>
template<typename T >
T& isc::eval::variant< S >::build ( )
inline

Instantiate an empty T in here.

Obsolete, use emplace.

Definition at line 360 of file parser.h.

◆ build() [2/2]

template<size_t S>
template<typename T >
T& isc::eval::variant< S >::build ( const T &  t)
inline

Instantiate a T in here from t.

Obsolete, use emplace.

Definition at line 369 of file parser.h.

◆ copy()

template<size_t S>
template<typename T >
void isc::eval::variant< S >::copy ( const self_type other)
inline

Copy the content of other to this.

Definition at line 443 of file parser.h.

◆ destroy()

template<size_t S>
template<typename T >
void isc::eval::variant< S >::destroy ( )
inline

Destroy the stored T.

Definition at line 451 of file parser.h.

Referenced by isc::eval::variant< sizeof(union_type)>::move().

◆ emplace() [1/2]

template<size_t S>
template<typename T >
T& isc::eval::variant< S >::emplace ( )
inline

Instantiate an empty T in here.

Definition at line 324 of file parser.h.

◆ emplace() [2/2]

template<size_t S>
template<typename T >
T& isc::eval::variant< S >::emplace ( const T &  t)
inline

Instantiate a T in here from t.

Definition at line 347 of file parser.h.

◆ move()

template<size_t S>
template<typename T >
void isc::eval::variant< S >::move ( self_type other)
inline

Move the content of other to this.

Destroys other.

Definition at line 418 of file parser.h.

◆ swap()

template<size_t S>
template<typename T >
void isc::eval::variant< S >::swap ( self_type other)
inline

Swap the content with other, of same type.

Both variants must be built beforehand, because swapping the actual data requires reading it (with as()), and this is not possible on unconstructed variants: it would require some dynamic testing, which should not be the variant's responsibility. Swapping between built and (possibly) non-built is done with variant::move ().

Definition at line 406 of file parser.h.

Member Data Documentation

◆ yyalign_me

template<size_t S>
long double isc::eval::variant< S >::yyalign_me

Strongest alignment constraints.

Definition at line 483 of file parser.h.

◆ yyraw

template<size_t S>
char isc::eval::variant< S >::yyraw[S]

A buffer large enough to store any of the semantic values.

Definition at line 485 of file parser.h.


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