Botan 3.6.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 249 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 275 of file tpm2_util.h.

275 {
276 AttributeWrapperT result;
277 for_all([&](auto&& prop) { prop(result) = (attributes & prop.mask) != 0; });
278 return result;
279 }

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

265 {
266 UnderlyingT result = 0;
267 for_all([&](auto&& prop) {
268 if(prop(attributes)) {
269 result |= prop.mask;
270 }
271 });
272 return result;
273 }

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