Monado OpenXR Runtime
xrt::auxiliary::util::ExtensionList Class Reference

An immutable collection of strings, like a list of extensions to enable. More...

#include <util/u_extension_list.hpp>

Public Member Functions

 ExtensionList ()=default
 Default constructor - creates an empty list. More...
 
 ExtensionList (ExtensionList &&)=default
 Move constructor. More...
 
 ExtensionList (ExtensionList const &other)
 Copy constructor, makes sure to do a deep copy. More...
 
ExtensionListoperator= (ExtensionList &&)=default
 Move assignment. More...
 
ExtensionListoperator= (ExtensionList const &other)
 Copy assignment. More...
 
uint32_t size () const noexcept
 Get the size of the array (the number of strings) More...
 
const char *const * data () const noexcept
 Get the data pointer of the array (array of const char*) More...
 
bool contains (std::string_view str) const
 Check if the string is in the list. More...
 

Friends

class ExtensionListBuilder
 

Detailed Description

An immutable collection of strings, like a list of extensions to enable.

This class stores copies of strings internally and provides read-only access.

Size is limited to one less than the max value of uint32_t which shouldn't be a problem, the size really should be much smaller.

Constructor & Destructor Documentation

◆ ExtensionList() [1/3]

xrt::auxiliary::util::ExtensionList::ExtensionList ( )
default

Default constructor - creates an empty list.

Referenced by operator=().

◆ ExtensionList() [2/3]

xrt::auxiliary::util::ExtensionList::ExtensionList ( ExtensionList &&  )
default

Move constructor.

◆ ExtensionList() [3/3]

xrt::auxiliary::util::ExtensionList::ExtensionList ( ExtensionList const &  other)
inline

Copy constructor, makes sure to do a deep copy.

Member Function Documentation

◆ contains()

bool xrt::auxiliary::util::ExtensionList::contains ( std::string_view  str) const
inline

Check if the string is in the list.

(Comparing string contents)

Parameters
stra string view to search for.
Returns
true if the string is in the list.

Referenced by u_extension_list::u_extension_list_contains().

◆ data()

const char *const * xrt::auxiliary::util::ExtensionList::data ( ) const
inlinenoexcept

Get the data pointer of the array (array of const char*)

Referenced by u_extension_list::u_extension_list_get_data().

◆ operator=() [1/2]

ExtensionList & xrt::auxiliary::util::ExtensionList::operator= ( ExtensionList &&  )
default

Move assignment.

◆ operator=() [2/2]

ExtensionList & xrt::auxiliary::util::ExtensionList::operator= ( ExtensionList const &  other)
inline

Copy assignment.

References ExtensionList().

◆ size()

uint32_t xrt::auxiliary::util::ExtensionList::size ( ) const
inlinenoexcept

Get the size of the array (the number of strings)

Referenced by u_extension_list::u_extension_list_get_size().


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