Botan 3.8.1
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 258 of file tpm2_util.h.

Member Function Documentation

◆ read()

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

Definition at line 284 of file tpm2_util.h.

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

◆ render()

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

Definition at line 274 of file tpm2_util.h.

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

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