Botan 3.9.0
Crypto and TLS for C&
Botan::TPM2::AttributeWrapper< UnderlyingT, AttributeWrapperT, props > Class Template Reference

#include <tpm2_util.h>

Static Public Member Functions

static constexpr AttributeWrapperT read (UnderlyingT attributes)
static constexpr UnderlyingT render (AttributeWrapperT attributes)

Detailed Description

template<std::unsigned_integral UnderlyingT, typename AttributeWrapperT, PropMap< bool AttributeWrapperT::*, UnderlyingT >... props>
class Botan::TPM2::AttributeWrapper< UnderlyingT, AttributeWrapperT, props >

This is an internal helper structure to wrap TPMA_* attribute bit fields.

Template Parameters
UnderlyingTthe TPMA_* bit field type
AttributeWrapperTthe C++ struct type that wraps the TPMA_* bit field
propsa bunch of std::pair mappping boolean members of AttributeWrapperT to the bit masks of the TPMA_* type

Definition at line 259 of file tpm2_util.h.

Member Function Documentation

◆ read()

template<std::unsigned_integral UnderlyingT, typename AttributeWrapperT, PropMap< bool AttributeWrapperT::*, UnderlyingT >... props>
constexpr AttributeWrapperT Botan::TPM2::AttributeWrapper< UnderlyingT, AttributeWrapperT, props >::read ( UnderlyingT attributes)
inlinestaticconstexpr

Definition at line 285 of file tpm2_util.h.

285 {
287 for_all([&](auto&& prop) { prop(result) = (attributes & prop.mask) != 0; });
288 return result;
289 }

◆ render()

template<std::unsigned_integral UnderlyingT, typename AttributeWrapperT, PropMap< bool AttributeWrapperT::*, UnderlyingT >... props>
constexpr UnderlyingT Botan::TPM2::AttributeWrapper< UnderlyingT, AttributeWrapperT, props >::render ( AttributeWrapperT attributes)
inlinestaticconstexpr

Definition at line 275 of file tpm2_util.h.

275 {
277 for_all([&](auto&& prop) {
278 if(prop(attributes)) {
279 result |= prop.mask;
280 }
281 });
282 return result;
283 }

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