Ark Server API (ASA) - Wiki
|
#include "CoreTypes.h"
Go to the source code of this file.
Namespaces | |
namespace | NEnumRangePrivate |
namespace | UE |
namespace | UE::EnumFlags |
namespace | UE::EnumFlags::Private |
Macros | |
#define | ENUM_RANGE_BY_COUNT(EnumType, Count) ENUM_RANGE_BY_FIRST_AND_LAST(EnumType, 0, (__underlying_type(EnumType))(Count) - 1) |
#define | ENUM_RANGE_BY_FIRST_AND_LAST(EnumType, First, Last) |
#define | ENUM_RANGE_BY_VALUES(EnumType, ...) |
Functions | |
template<typename EnumType > | |
UE::EnumFlags::Private::TRange< EnumType > | MakeFlagsRange (EnumType Flags) |
#define ENUM_RANGE_BY_COUNT | ( | EnumType, | |
Count ) ENUM_RANGE_BY_FIRST_AND_LAST(EnumType, 0, (__underlying_type(EnumType))(Count) - 1) |
Defines a contiguous enum range containing Count values, starting from zero:
Example:
enum class ECountedThing { First, Second, Third,
Count };
// Defines iteration over ECountedThing to be: First, Second, Third ENUM_RANGE_BY_COUNT(ECountedThing, ECountedThing::Count)
Definition at line 24 of file EnumRange.h.
Defines a contiguous enum range with specific start and end values:
Example:
enum class EDoubleEndedThing { Invalid,
First, Second, Third,
Count };
// Defines iteration over EDoubleEndedThing to be: First, Second, Third ENUM_RANGE_BY_FIRST_AND_LAST(EDoubleEndedThing, EDoubleEndedThing::First, EDoubleEndedThing::Third)
Definition at line 46 of file EnumRange.h.
#define ENUM_RANGE_BY_VALUES | ( | EnumType, | |
... ) |
Defines a non-contiguous enum range with specific individual values:
Example:
enum class ERandomValuesThing { First = 2, Second = 3, Third = 5, Fourth = 7, Fifth = 11 };
// Defines iteration over ERandomValuesThing to be: First, Second, Third, Fourth, Fifth ENUM_RANGE_BY_VALUES(ERandomValuesThing, ERandomValuesThing::First, ERandomValuesThing::Second, ERandomValuesThing::Third, ERandomValuesThing::Fourth, ERandomValuesThing::Fifth)
Definition at line 73 of file EnumRange.h.
UE::EnumFlags::Private::TRange< EnumType > MakeFlagsRange | ( | EnumType | Flags | ) |
Make a range for iterating over set flags in a flags enum.
Example:
EFlagThing Flags = EFlagThing::A | EFlagThing::B; for (EFlagThing Flag : MakeFlagsRange(Flags)) { // Loop is run twice, once with Flag = EFlagThing::A, once with Flag = EFlagThing::B ... }
Definition at line 250 of file EnumRange.h.