xgboost

Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
xgboost::BitFieldContainer< VT, Direction, IsConst > Struct Template Reference

A non-owning type with auxiliary methods defined for manipulating bits. More...

`#include <bitfield.h>`

Collaboration diagram for xgboost::BitFieldContainer< VT, Direction, IsConst >:

## Classes
struct | Pos

## Public Types
using | value_type = std::conditional_t< IsConst, VT const, VT >
using | index_type = size_t
using | pointer = value_type *

## Public Member Functions
| BitFieldContainer ()=default
XGBOOST_DEVICE | BitFieldContainer (common::Span< value_type > bits)
XGBOOST_DEVICE | BitFieldContainer (BitFieldContainer const &other)
BitFieldContainer & | operator= (BitFieldContainer const &that)=default
BitFieldContainer & | operator= (BitFieldContainer &&that)=default
XGBOOST_DEVICE common::Span< value_type > | Bits ()
XGBOOST_DEVICE common::Span< value_type const > | Bits () const
BitFieldContainer & | operator|= (BitFieldContainer const &rhs)
BitFieldContainer & | operator&= (BitFieldContainer const &rhs)
void | Set (index_type pos)
void | Clear (index_type pos)
XGBOOST_DEVICE bool | Check (Pos pos_v) const
XGBOOST_DEVICE bool | Check (index_type pos) const
XGBOOST_DEVICE size_t | Size () const
XGBOOST_DEVICE pointer | Data () const

## Static Public Member Functions
static XGBOOST_DEVICE Pos | ToBitPos (index_type pos)
static XGBOOST_DEVICE size_t | ComputeStorageSize (index_type size)

## Static Public Attributes
static constexpr index_type | kValueSize = sizeof(value_type) * 8
static constexpr index_type | kOne = 1

## Friends
std::ostream & | operator<< (std::ostream &os, BitFieldContainer< VT, Direction, IsConst > field)

## Detailed Description

### template<typename VT, typename Direction, bool IsConst = false>
struct xgboost::BitFieldContainer< VT, Direction, IsConst >

A non-owning type with auxiliary methods defined for manipulating bits.

Template Parameters

  Direction | Whether the bits start from left or from right.

## Member Typedef Documentation

## ◆ index_type

template<typename VT , typename Direction , bool IsConst = false>

using xgboost::BitFieldContainer< VT, Direction, IsConst >::index_type = size_t

## ◆ pointer

template<typename VT , typename Direction , bool IsConst = false>

using xgboost::BitFieldContainer< VT, Direction, IsConst >::pointer = value_type*

## ◆ value_type

template<typename VT , typename Direction , bool IsConst = false>

using xgboost::BitFieldContainer< VT, Direction, IsConst >::value_type = std::conditional_t<IsConst, VT const, VT>

## Constructor & Destructor Documentation

## ◆ BitFieldContainer() [1/3]

template<typename VT , typename Direction , bool IsConst = false>

xgboost::BitFieldContainer< VT, Direction, IsConst >::BitFieldContainer | ( |  | ) |
| default

## ◆ BitFieldContainer() [2/3]

template<typename VT , typename Direction , bool IsConst = false>

XGBOOST_DEVICE xgboost::BitFieldContainer< VT, Direction, IsConst >::BitFieldContainer | ( | common::Span< value_type > | bits | ) |
| inline explicit

## ◆ BitFieldContainer() [3/3]

template<typename VT , typename Direction , bool IsConst = false>

XGBOOST_DEVICE xgboost::BitFieldContainer< VT, Direction, IsConst >::BitFieldContainer | ( | BitFieldContainer< VT, Direction, IsConst > const & | other | ) |
| inline

## Member Function Documentation

## ◆ Bits() [1/2]

template<typename VT , typename Direction , bool IsConst = false>

XGBOOST_DEVICE common::Span<value_type> xgboost::BitFieldContainer< VT, Direction, IsConst >::Bits | ( |  | ) |
| inline

## ◆ Bits() [2/2]

template<typename VT , typename Direction , bool IsConst = false>

XGBOOST_DEVICE common::Span<value_type const> xgboost::BitFieldContainer< VT, Direction, IsConst >::Bits | ( |  | ) | const
| inline

## ◆ Check() [1/2]

template<typename VT , typename Direction , bool IsConst = false>

XGBOOST_DEVICE bool xgboost::BitFieldContainer< VT, Direction, IsConst >::Check | ( | index_type | pos | ) | const
| inline

## ◆ Check() [2/2]

template<typename VT , typename Direction , bool IsConst = false>

XGBOOST_DEVICE bool xgboost::BitFieldContainer< VT, Direction, IsConst >::Check | ( | Pos | pos_v | ) | const
| inline

## ◆ Clear()

template<typename VT , typename Direction , bool IsConst = false>

void xgboost::BitFieldContainer< VT, Direction, IsConst >::Clear | ( | index_type | pos | ) |
| inline

## ◆ ComputeStorageSize()

template<typename VT , typename Direction , bool IsConst = false>

static XGBOOST_DEVICE size_t xgboost::BitFieldContainer< VT, Direction, IsConst >::ComputeStorageSize | ( | index_type | size | ) |
| inline static

## ◆ Data()

template<typename VT , typename Direction , bool IsConst = false>

XGBOOST_DEVICE pointer xgboost::BitFieldContainer< VT, Direction, IsConst >::Data | ( |  | ) | const
| inline

## ◆ operator&=()

template<typename VT , typename Direction , bool IsConst = false>

BitFieldContainer& xgboost::BitFieldContainer< VT, Direction, IsConst >::operator&= | ( | BitFieldContainer< VT, Direction, IsConst > const & | rhs | ) |
| inline

## ◆ operator=() [1/2]

template<typename VT , typename Direction , bool IsConst = false>

BitFieldContainer& xgboost::BitFieldContainer< VT, Direction, IsConst >::operator= | ( | BitFieldContainer< VT, Direction, IsConst > && | that | ) |
| default

## ◆ operator=() [2/2]

template<typename VT , typename Direction , bool IsConst = false>

BitFieldContainer& xgboost::BitFieldContainer< VT, Direction, IsConst >::operator= | ( | BitFieldContainer< VT, Direction, IsConst > const & | that | ) |
| default

## ◆ operator|=()

template<typename VT , typename Direction , bool IsConst = false>

BitFieldContainer& xgboost::BitFieldContainer< VT, Direction, IsConst >::operator|= | ( | BitFieldContainer< VT, Direction, IsConst > const & | rhs | ) |
| inline

## ◆ Set()

template<typename VT , typename Direction , bool IsConst = false>

void xgboost::BitFieldContainer< VT, Direction, IsConst >::Set | ( | index_type | pos | ) |
| inline

## ◆ Size()

template<typename VT , typename Direction , bool IsConst = false>

XGBOOST_DEVICE size_t xgboost::BitFieldContainer< VT, Direction, IsConst >::Size | ( |  | ) | const
| inline

## ◆ ToBitPos()

template<typename VT , typename Direction , bool IsConst = false>

static XGBOOST_DEVICE Pos xgboost::BitFieldContainer< VT, Direction, IsConst >::ToBitPos | ( | index_type | pos | ) |
| inline static

## Friends And Related Function Documentation

## ◆ operator<<

template<typename VT , typename Direction , bool IsConst = false>

std::ostream& operator<< | ( | std::ostream & | os,
|  | BitFieldContainer< VT, Direction, IsConst > | field
| ) |  |
| friend

## Member Data Documentation

## ◆ kOne

template<typename VT , typename Direction , bool IsConst = false>

constexpr index_type xgboost::BitFieldContainer< VT, Direction, IsConst >::kOne = 1
| static constexpr

## ◆ kValueSize

template<typename VT , typename Direction , bool IsConst = false>

constexpr index_type xgboost::BitFieldContainer< VT, Direction, IsConst >::kValueSize = sizeof(value_type) * 8
| static constexpr

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

- /home/runner/work/xgboost/xgboost/src/common/bitfield.h