Spicy
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
hilti::rt::Bitfield< Ts > Struct Template Reference

#include <bitfield.h>

Inheritance diagram for hilti::rt::Bitfield< Ts >:
hilti::rt::trait::isBitfield

Public Types

using value_type = Tuple< Ts... >
 

Public Member Functions

 Bitfield (value_type v, const hilti::rt::TypeInfo *ti)
 
 Bitfield (const hilti::rt::TypeInfo *ti=nullptr)
 
template<typename... Us>
 Bitfield (Bitfield< Us... > other)
 

Static Public Member Functions

template<size_t Idx>
static ptrdiff_t elementOffset ()
 

Public Attributes

value_type value = value_type()
 
const hilti::rt::TypeInfoti
 

Detailed Description

template<typename... Ts>
struct hilti::rt::Bitfield< Ts >

A bitfield is just a type wrapper around a tuple of the corresponding field values (including the hidden additional element storing the bitfield's original integer value). We wrap it so that we can customize the printing.

Constructor & Destructor Documentation

◆ Bitfield() [1/3]

template<typename... Ts>
hilti::rt::Bitfield< Ts >::Bitfield ( value_type  v,
const hilti::rt::TypeInfo ti 
)
inline

Construct a bitfield from a tuple.

◆ Bitfield() [2/3]

template<typename... Ts>
hilti::rt::Bitfield< Ts >::Bitfield ( const hilti::rt::TypeInfo ti = nullptr)
inline

Construct an entirely unset bitfield.

◆ Bitfield() [3/3]

template<typename... Ts>
template<typename... Us>
hilti::rt::Bitfield< Ts >::Bitfield ( Bitfield< Us... >  other)
inline

Support instantiation from another bitfield type as long as all types convert over.

Member Function Documentation

◆ elementOffset()

template<typename... Ts>
template<size_t Idx>
static ptrdiff_t hilti::rt::Bitfield< Ts >::elementOffset ( )
inlinestatic

Returns the binary offset of a particular bit range inside the bitfield's storage. The offset refers is to the start of the bitfield.

Template Parameters
Idxindex of the bit range to return

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