ztsdb
Classes | Public Types | Public Member Functions | List of all members
cfgyy::parser::semantic_type Class Reference

#include <cfgparser.hpp>

Public Types

typedef semantic_type self_type
 Type of *this.
 

Public Member Functions

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

Detailed Description

A 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 parser state.

Member Function Documentation

◆ build() [1/2]

template<typename T >
T& cfgyy::parser::semantic_type::build ( )
inline

Instantiate an empty T in here. Obsolete, use emplace.

◆ build() [2/2]

template<typename T >
T& cfgyy::parser::semantic_type::build ( const T &  t)
inline

Instantiate a T in here from t. Obsolete, use emplace.

◆ move()

template<typename T >
void cfgyy::parser::semantic_type::move ( self_type that)
inline

Move the content of that to this.

Destroys that.

◆ swap()

template<typename T >
void cfgyy::parser::semantic_type::swap ( self_type that)
inline

Swap the content with that, 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 self_type::move ().


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