GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::ProfileFormats Class Reference

Set of formats to save profile data in. More...

#include <GREM/core/profiling.hpp>

Public Member Functions

constexpr ProfileFormats () noexcept=default
 Construct an empty format set.
constexpr ProfileFormats (ProfileFormat format) noexcept
 Construct a format set containing only one specific format.
constexpr bool operator== (const ProfileFormats &other) const noexcept=default
 Compare this format set to another for equality.
constexpr bool empty () const noexcept
 Check if the format set is empty.
constexpr bool contains (ProfileFormat format) const noexcept
 Check if the format set contains the given format.
constexpr bool containsAnyOf (ProfileFormats formats) const noexcept
 Check if the format set contains at least one of the given formats.
constexpr bool containsAllOf (ProfileFormats formats) const noexcept
 Check if the format set contains all of the given formats.

Static Public Attributes

static const ProfileFormats ALL = ~ProfileFormats{}
 Set containing all possible object formats.

Friends

constexpr ProfileFormats operator~ (ProfileFormats a) noexcept
 Get the complement of a format set.
constexpr ProfileFormats operator& (ProfileFormats a, ProfileFormats b) noexcept
 Get the intersection of two format sets.
constexpr ProfileFormats operator| (ProfileFormats a, ProfileFormats b) noexcept
 Get the union of two format sets.
constexpr ProfileFormats operator^ (ProfileFormats a, ProfileFormats b) noexcept
 Get the symmetric difference of two format sets.
constexpr ProfileFormats & operator&= (ProfileFormats &a, ProfileFormats b) noexcept
 Assign the intersection of two format sets to the first set.
constexpr ProfileFormats & operator|= (ProfileFormats &a, ProfileFormats b) noexcept
 Assign the union of two format sets to the first set.
constexpr ProfileFormats & operator^= (ProfileFormats &a, ProfileFormats b) noexcept
 Assign the symmetric difference of two format sets to the first set.

Detailed Description

Set of formats to save profile data in.

Constructor & Destructor Documentation

◆ ProfileFormats() [1/2]

grem::ProfileFormats::ProfileFormats ( )
constexprdefaultnoexcept

Construct an empty format set.

◆ ProfileFormats() [2/2]

grem::ProfileFormats::ProfileFormats ( ProfileFormat format)
inlineconstexprnoexcept

Construct a format set containing only one specific format.

Parameters
formatformat identifier to include.
Note
Format sets can be combined using operator|(ProfileFormats, ProfileFormats).

Member Function Documentation

◆ operator==()

bool grem::ProfileFormats::operator== ( const ProfileFormats & other) const
nodiscardconstexprdefaultnoexcept

Compare this format set to another for equality.

Parameters
otherthe format set to compare this one to.
Returns
true if the format sets are equal, false otherwise.

◆ empty()

bool grem::ProfileFormats::empty ( ) const
inlinenodiscardconstexprnoexcept

Check if the format set is empty.

Returns
true if the set contains no formats, false otherwise.

◆ contains()

bool grem::ProfileFormats::contains ( ProfileFormat format) const
inlinenodiscardconstexprnoexcept

Check if the format set contains the given format.

Parameters
formatformat identifier to check for.
Returns
true if the set contains the given format, false otherwise.

◆ containsAnyOf()

bool grem::ProfileFormats::containsAnyOf ( ProfileFormats formats) const
inlinenodiscardconstexprnoexcept

Check if the format set contains at least one of the given formats.

Parameters
formatsformat set to check for.
Returns
true if the set contains at least one of the given formats, false otherwise.

◆ containsAllOf()

bool grem::ProfileFormats::containsAllOf ( ProfileFormats formats) const
inlinenodiscardconstexprnoexcept

Check if the format set contains all of the given formats.

Parameters
formatsformat set to check for.
Returns
true if the set contains all of the given formats, false otherwise.

◆ operator~

ProfileFormats operator~ ( ProfileFormats a)
friend

Get the complement of a format set.

Parameters
athe set to invert.
Returns
a set containing all possible formats except those in the given set.

◆ operator&

ProfileFormats operator& ( ProfileFormats a,
ProfileFormats b )
friend

Get the intersection of two format sets.

Parameters
afirst format set.
bsecond format set.
Returns
a set containing all formats contained in both a and b.

◆ operator|

ProfileFormats operator| ( ProfileFormats a,
ProfileFormats b )
friend

Get the union of two format sets.

Parameters
afirst format set.
bsecond format set.
Returns
a set containing all formats contained in a or b or both.

◆ operator^

ProfileFormats operator^ ( ProfileFormats a,
ProfileFormats b )
friend

Get the symmetric difference of two format sets.

Parameters
afirst format set.
bsecond format set.
Returns
a set containing all formats contained in either a or b, but not both.

◆ operator&=

ProfileFormats & operator&= ( ProfileFormats & a,
ProfileFormats b )
friend

Assign the intersection of two format sets to the first set.

Parameters
afirst format set.
bsecond format set.
Returns
a reference to the first set, which was assigned to.

◆ operator|=

ProfileFormats & operator|= ( ProfileFormats & a,
ProfileFormats b )
friend

Assign the union of two format sets to the first set.

Parameters
afirst format set.
bsecond format set.
Returns
a reference to the first set, which was assigned to.

◆ operator^=

ProfileFormats & operator^= ( ProfileFormats & a,
ProfileFormats b )
friend

Assign the symmetric difference of two format sets to the first set.

Parameters
afirst format set.
bsecond format set.
Returns
a reference to the first set, which was assigned to.

Member Data Documentation

◆ ALL

ProfileFormats grem::ProfileFormats::ALL = ~ProfileFormats{}
inlinestaticconstexpr

Set containing all possible object formats.


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