Struct item_value

Struct Documentation

struct item_value

the internal storage for items in a category

Internal storage, strictly forward linked list with minimal space requirements. Strings of size 7 or shorter are stored internally. Typically, more than 99% of the strings in an mmCIF file are less than 8 bytes in length.

Public Functions

inline item_value(std::string_view text)

constructor

inline explicit operator bool() const

operator bool, allows easy checking for empty items

inline constexpr std::string_view text() const

Return the content of the item as a std::string_view

Public Members

size_t m_length = 0

Length of the data.

char m_local_data[8]

Storage area for small strings (strings smaller than kBufferSize)

char *m_data

Pointer to a string stored in the heap.

uint64_t m_storage

Alternative storage of the data, used in move operations.

union cif::item_value::[anonymous] [anonymous]

Public Static Attributes

static constexpr size_t kBufferSize = sizeof(m_local_data)

The maximum length of locally stored strings