Botan 3.7.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 257 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 283 of file tpm2_util.h.

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

◆ 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 273 of file tpm2_util.h.

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

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