Blender V5.3
lexit::PaddedString< Size > Struct Template Reference

#include <identifier.hh>

Public Member Functions

 PaddedString ()=default
 PaddedString (std::string_view str)
 operator std::string_view () const

Public Attributes

uint64_t data [Size]
uint32_t size

Detailed Description

template<int Size>
struct lexit::PaddedString< Size >

Copy of a small string onto aligned bytes. This avoids the cost of calling memcmp during comparison. For performance reason, this needs to be constructed on string whose size falls into the ((Size-1) * 8, Size * 8] range. IMPORTANT: The string view given to the constructor MUST point to at least Size * 8 addressable byte region regardless of the string size.

Definition at line 43 of file identifier.hh.

Constructor & Destructor Documentation

◆ PaddedString() [1/2]

template<int Size>
lexit::PaddedString< Size >::PaddedString ( )
default

◆ PaddedString() [2/2]

template<int Size>
lexit::PaddedString< Size >::PaddedString ( std::string_view str)
inlineexplicit

Definition at line 50 of file identifier.hh.

References assert, data, lexit::padded_string_masks, size, and str.

Member Function Documentation

◆ operator std::string_view()

template<int Size>
lexit::PaddedString< Size >::operator std::string_view ( ) const
inline

Definition at line 61 of file identifier.hh.

References data, and size.

Member Data Documentation

◆ data

template<int Size>
uint64_t lexit::PaddedString< Size >::data[Size]

Definition at line 44 of file identifier.hh.

Referenced by operator std::string_view(), and PaddedString().

◆ size

template<int Size>
uint32_t lexit::PaddedString< Size >::size

Definition at line 45 of file identifier.hh.

Referenced by operator std::string_view(), and PaddedString().


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