Evo core types and primitives.
More...
|
| evo |
| Evo C++ Library namespace.
|
|
|
static const EndT | ALL |
| Special integer value for indicating all items or all remaining items. More...
|
|
static const EndT | END |
| Special integer value for indicating end of items or no item. More...
|
|
static const EndT | NONE |
| Special integer value for indicating no item or unknown item. More...
|
|
Evo core types and primitives.
◆ EVO_ALLOCATORS
Enable container allocators – NOT YET SUPPORTED.
◆ EVO_CATCH_DEBUG
#define EVO_CATCH_DEBUG 0 |
Enable additional debug info when printing exceptions from EVO_CATCH() and EVO_CATCH_MT().
- Default: 0
- Enabling this changes the EVO_CATCH() helpers to include source file path and line number in the exception error message
◆ EVO_CNULL
#define EVO_CNULL ((const char*)0) |
Shortcut for NULL as const-char pointer.
◆ EVO_EXCEPTIONS
Whether to throw exceptions on error by default.
- Default: 1
- Disabling exceptions can help performance when critical, however error codes should then be checked directly
◆ EVO_LIST_OPT_EXTREF
#define EVO_LIST_OPT_EXTREF 1 |
List: Enable optimization for referencing external lists rather than copying.
- When enabled, each String variable uses a little more memory
- Disabling this also disables EVO_LIST_OPT_LAZYBUF and EVO_LIST_OPT_EXTREF (?)
- Default: 1
◆ EVO_LIST_OPT_LAZYBUF
#define EVO_LIST_OPT_LAZYBUF 1 |
List: Enable lazy buffer optimization for keeping buffer when not used.
- When enabled, list buffer is not immediately freed when unused in case it's needed again
- Default: 1
◆ EVO_LIST_OPT_LAZYREM
#define EVO_LIST_OPT_LAZYREM 0 |
List: Enable lazy removal optimization when removing items.
- When enabled, List::remove() will trim begining/end items, to be actually removed later
- Can improve performance when beginning and/or end items are added and removed a lot
- Default: 0
◆ EVO_LIST_OPT_REFTERM
#define EVO_LIST_OPT_REFTERM 0 |
List: Enable optimization when referencing terminated lists.
- When enabled, each String variable uses a little more memory (4 bytes)
- Can improve performance when list referencing external terminated list and using cstr()
- Default: 1
◆ EVO_LIST_REALLOC
#define EVO_LIST_REALLOC 1 |
List: Enable using realloc to resize buffer.
- This could improve performance in some systems
- Default: 1
◆ EVO_MAX
#define EVO_MAX |
( |
|
A, |
|
|
|
B |
|
) |
| ((B) > (A) ? (B) : (A)) |
Macro returning highest argument.
- Parameters
-
A | First number |
B | Second number |
- Returns
- Max number
◆ EVO_MIN
#define EVO_MIN |
( |
|
A, |
|
|
|
B |
|
) |
| ((B) < (A) ? (B) : (A)) |
Macro returning lowest argument.
- Parameters
-
A | First number |
B | Second number |
- Returns
- Max number
◆ EVO_PDEFAULT
#define EVO_PDEFAULT ((T*)IntegerT<std::size_t>::MAX) |
Special pointer value for default initialization (used in containers).
- This only works inside container classes with item type "T" defined
◆ EVO_PEMPTY
#define EVO_PEMPTY ((T*)1) |
Special pointer value for empty but not NULL (used in containers).
- This only works inside container classes with item type "T" defined
◆ EVO_PPEMPTY
#define EVO_PPEMPTY ((T**)1) |
Special pointer value for empty but not NULL (used in containers).
- This only works inside container classes with item type "T" defined
◆ EVO_SIZE_TYPE
#define EVO_SIZE_TYPE uint32 |
Sets default size type for Evo containers.
- Default: uint32
- Always unsigned
- This becomes type: SizeT
◆ EVO_STD_STRING
Whether to support std::string
compatibility in Evo string classes (String, SubString).
- Default: 0 (auto-detect, enable if
std::string
include detected)
- By default this will try to auto-detect whether STL
string
has been included already, and if so enable std::string
support
- Set to 1 to explicitly enable (and auto-include for
std::string
), -1 to explicitly disable and skip auto-detect
- Set this BEFORE including any Evo headers
- When enabled, any function that takes "const StringBase&" will automatically support "const std::string&" and "const std::string*"
- See also: EVO_STD_STRING and String Passing
◆ EVO_STD_STRING_VIEW
#define EVO_STD_STRING_VIEW 0 |
Whether to support std::string_view
compatibility in Evo string classes (String, SubString).
- Default: 0 (auto-detect, enable if
std::string_view
include detected)
- By default this will try to auto-detect whether STL
string_view
has been included already, and if so enable std::string_view
support
- Set to 1 to explicitly enable (and auto-include for
std::string_view
), -1 to explicitly disable and skip auto-detect
- Set this BEFORE including any Evo headers
- When enabled, any function that takes "const StringBase&" will automatically support "const std::string_view&" and "const std::string_view*"
- This is ignored if C++17 (or
string_view
) is not supported
- See also: EVO_STD_STRING and String Passing
◆ EVO_STR_SIZE_TYPE
#define EVO_STR_SIZE_TYPE uint32 |
Sets default string size type for Evo string containers.
- Default: uint32
- Always unsigned
- This becomes type: StrSizeT
◆ EVO_VERSION
Evo version number (major.minor).
◆ EVO_VERSION_PATCH
#define EVO_VERSION_PATCH 1 |
Evo version patch number.
◆ EVO_VERSION_STRING
#define EVO_VERSION_STRING "0.5.1" |
Evo version string (major.minor.patch).
◆ EVO_VNULL
#define EVO_VNULL ((void*)0) |
Shortcut for NULL as void-pointer.
◆ Float
Basic single-precision floating-point type (float) – see FloatT.
A basic Evo container for floating-point values.
◆ FloatD
Basic double-precision floating-point type (double) – see FloatT.
A basic Evo container for floating-point values.
◆ FloatL
Basic long-double floating-point type (long double) – see FloatT.
A basic Evo container for floating-point values.
◆ Int
Basic integer type (int) – see IntegerT.
A basic Evo container for integer values.
◆ Int16
Basic integer type (int16) – see IntegerT.
A basic Evo container for integer values.
◆ Int32
Basic integer type (int32) – see IntegerT.
A basic Evo container for integer values.
◆ Int64
Basic integer type (int64) – see IntegerT.
A basic Evo container for integer values.
◆ Int8
Basic integer type (int8) – see IntegerT.
A basic Evo container for integer values.
◆ Long
Basic integer type (long) – see IntegerT.
A basic Evo container for integer values.
◆ LongL
Basic integer type (long long) – see IntegerT.
A basic Evo container for integer values.
◆ Short
Basic integer type (short) – see IntegerT.
A basic Evo container for integer values.
◆ UInt
Basic integer type (unsigned int) – see IntegerT.
A basic Evo container for integer values.
◆ UInt16
Basic integer type (uint16) – see IntegerT.
A basic Evo container for integer values.
◆ UInt32
Basic integer type (uint32) – see IntegerT.
A basic Evo container for integer values.
◆ UInt64
Basic integer type (uint64) – see IntegerT.
A basic Evo container for integer values.
◆ UInt8
Basic integer type (uint8) – see IntegerT.
A basic Evo container for integer values.
◆ ULong
Basic integer type (unsigned long) – see IntegerT.
A basic Evo container for integer values.
◆ ULongL
Basic integer type (unsigned long long) – see IntegerT.
A basic Evo container for integer values.
◆ UShort
Basic integer type (unsigned short) – see IntegerT.
A basic Evo container for integer values.
◆ is_pow2()
bool evo::is_pow2 |
( |
T |
num | ) |
|
|
inline |
Get whether a number is a power of 2.
- Template Parameters
-
T | Number type, inferred from param |
- Parameters
-
- Returns
- Whether num is a power of 2
◆ next_pow2()
Get next power of 2 equal to or greater than given number.
- Template Parameters
-
T | Number type, inferred from param – must be unsigned |
- Parameters
-
v | Value to get next power of 2 from |
- Returns
- Next power of 2 that's greater than or equal to v, 0 on overflow
- See also
- size_pow2()
◆ operator!=()
bool evo::operator!= |
( |
T |
val1, |
|
|
const Nullable< T > & |
val2 |
|
) |
| |
|
inline |
Inequality operator comparing value with Nullable value.
- If val2 is null, the result is always true as null is not equal to any non-null value
- Parameters
-
val1 | Value to compare |
val2 | Value to compare to |
- Returns
- Whether inequal, true if null
◆ operator<()
bool evo::operator< |
( |
T |
val1, |
|
|
const Nullable< T > & |
val2 |
|
) |
| |
|
inline |
Less than operator comparing value with Nullable value.
- If val2 is null, no non-null value is less than null
- Parameters
-
val1 | Value to compare |
val2 | Value to compare to |
- Returns
- Whether
val1
is less than val2
, false if val2
is null
◆ operator<=()
bool evo::operator<= |
( |
T |
val1, |
|
|
const Nullable< T > & |
val2 |
|
) |
| |
|
inline |
Less than or equal operator comparing value with Nullable value.
- If val2 is null, no non-null value is less than null
- Parameters
-
val1 | Value to compare |
val2 | Value to compare to |
- Returns
- Whether
val1
is less than or equal to val2
, false if val2
is null
◆ operator==()
bool evo::operator== |
( |
T |
val1, |
|
|
const Nullable< T > & |
val2 |
|
) |
| |
|
inline |
Equality operator comparing value with Nullable value.
- If val2 is null, the result is always false as null is not equal to any non-null value
- Parameters
-
val1 | Value to compare |
val2 | Value to compare to |
- Returns
- Whether equal, false if null
◆ operator>()
bool evo::operator> |
( |
T |
val1, |
|
|
const Nullable< T > & |
val2 |
|
) |
| |
|
inline |
Greater than operator comparing value with Nullable value.
- If val2 is null, any non-null value is greater than null
- Parameters
-
val1 | Value to compare |
val2 | Value to compare to |
- Returns
- Whether
val1
is greater than val2
, true if val2
is null
◆ operator>=()
bool evo::operator>= |
( |
T |
val1, |
|
|
const Nullable< T > & |
val2 |
|
) |
| |
|
inline |
Greater than or equal operator comparing value with Nullable value.
- If val2 is null, any non-null value is greater than null
- Parameters
-
val1 | Value to compare |
val2 | Value to compare to |
- Returns
- Whether
val1
is greater or equal to val2
, true if val2
is null
◆ size_pow2()
Size evo::size_pow2 |
( |
Size |
size, |
|
|
Size |
minsize = 2 |
|
) |
| |
|
inline |
Get size as power of 2.
- This finds the lowest power of 2 that fits input size, and is at least minsize
- On overflow the max power of 2 for Size is returned
- Using powers of 2 allows a "faster modulus" on size using a mask (
size - 1
):
i & (size - 1)
is equivalent to i % size
- Template Parameters
-
Size | Size type to use, inferred from params |
- Parameters
-
size | Input size to convert to power of 2 |
minsize | Minimum allowed size – must be positive and a power of 2 |
- Returns
- Requested size as power of 2, always positive 0
- See also
- next_pow2()
◆ ALL
Special integer value for indicating all items or all remaining items.
- Passed to methods like replace()
- Evo uses unsigned Size types, so this is used instead of the common special index value -1
- Implicitly converts and compares with any Size (integer) type – actual value is the max integer of the type converted/compared to
◆ END
Special integer value for indicating end of items or no item.
- Passed as a position/index to methods like find()
- Evo uses unsigned Size types, so this is used instead of the common special index value -1
- Implicitly converts and compares with any Size (integer) type – actual value is the max integer of the type converted/compared to
◆ NONE
Special integer value for indicating no item or unknown item.
- Returned by methods like find()
- Evo uses unsigned Size types, so this is used instead of the common special index value -1
- Implicitly converts and compares with any Size (integer) type – actual value is the max integer of the type converted/compared to