Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
dart::BoolField< position > Class Template Reference

#include <boolfield.h>

Static Public Member Functions

static uword encode (bool value)
 
static bool decode (uword value)
 
static uword update (bool value, uword original)
 

Detailed Description

template<int position>
class dart::BoolField< position >

Definition at line 16 of file boolfield.h.

Member Function Documentation

◆ decode()

template<int position>
static bool dart::BoolField< position >::decode ( uword  value)
inlinestatic

Definition at line 25 of file boolfield.h.

25 {
26 ASSERT(position < sizeof(uword));
27 return (value & (1U << position)) != 0;
28 }
#define ASSERT(E)
uint8_t value
uintptr_t uword
Definition: globals.h:501

◆ encode()

template<int position>
static uword dart::BoolField< position >::encode ( bool  value)
inlinestatic

Definition at line 19 of file boolfield.h.

19 {
20 ASSERT(position < sizeof(uword));
21 return static_cast<uword>((value ? 1U : 0) << position);
22 }

◆ update()

template<int position>
static uword dart::BoolField< position >::update ( bool  value,
uword  original 
)
inlinestatic

Definition at line 33 of file boolfield.h.

33 {
34 ASSERT(position < sizeof(uword));
35 const uword mask = 1U << position;
36 return value ? original | mask : original & ~mask;
37 }

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