|
#define | DEPRECATED __attribute__((deprecated)) |
| Attribute for deprecated functions and symbols.
|
|
#define | PRIVATE |
| Attribute for private functions not intended to be called by plugins.
|
|
#define | CONCAT_LITERAL(x, y) x ## y |
| Concatenates two literals or two macros Example:
|
|
#define | CONCAT(x, y) CONCAT_LITERAL(x, y) |
|
#define | TOSTRING_LITERAL(x) #x |
| Surrounds raw text with quotes Example:
|
|
#define | TOSTRING(x) TOSTRING_LITERAL(x) |
|
#define | LENGTHOF(arr) (sizeof(arr) / sizeof((arr)[0])) |
| Produces the length of a static array in number of elements.
|
|
#define | ENUMS(name, count) name, name ## _LAST = name + (count) - 1 |
| Reserve space for count enums starting with name .
|
|
#define | BINARY(sym) extern char _binary_##sym##_start, _binary_##sym##_end, _binary_##sym##_size |
| References binary files compiled into the program.
|
|
#define | BINARY_START(sym) ((const void*) &_binary_##sym##_start) |
|
#define | BINARY_END(sym) ((const void*) &_binary_##sym##_end) |
|
#define | BINARY_SIZE(sym) ((size_t) (&_binary_##sym##_end - &_binary_##sym##_start)) |
|
#define | DEFER(code) auto CONCAT(_defer_, __COUNTER__) = rack::deferWrapper([&]() code) |
|
|
int8_t | operator""_i8 (unsigned long long x) |
| Helpful user-defined literals for specifying exact integer and float types.
|
|
int16_t | operator""_i16 (unsigned long long x) |
|
int32_t | operator""_i32 (unsigned long long x) |
|
int64_t | operator""_i64 (unsigned long long x) |
|
uint8_t | operator""_u8 (unsigned long long x) |
|
uint16_t | operator""_u16 (unsigned long long x) |
|
uint32_t | operator""_u32 (unsigned long long x) |
|
uint64_t | operator""_u64 (unsigned long long x) |
|
float | operator""_f32 (long double x) |
|
float | operator""_f32 (unsigned long long x) |
|
double | operator""_f64 (long double x) |
|
double | operator""_f64 (unsigned long long x) |
|
template<typename To , typename From > |
To | rack::bitCast (From from) |
| Casts a primitive, preserving its bits instead of converting.
|
|
template<typename T > |
T * | rack::construct () |
| C#-style property constructor Example:
|
|
template<typename T , typename F , typename V , typename... Args> |
T * | rack::construct (F f, V v, Args... args) |
|
template<typename F > |
DeferWrapper< F > | rack::deferWrapper (F f) |
|
template<typename C > |
const C::mapped_type & | rack::get (const C &c, const typename C::key_type &key, const typename C::mapped_type &def=typename C::mapped_type()) |
| Given a std::map c , returns the value of the given key, or returns def if the key doesn't exist.
|
|
template<typename C > |
const C::value_type & | rack::get (const C &c, typename C::size_type i, const typename C::value_type &def=typename C::value_type()) |
| Given a std::vector c , returns the value of the given index i , or returns def if the index is out of bounds.
|
|
#define BINARY |
( |
| sym | ) |
extern char _binary_##sym##_start, _binary_##sym##_end, _binary_##sym##_size |
References binary files compiled into the program.
For example, to include a file "Test.dat" directly into your program binary, add
BINARIES += Test.dat
to your Makefile and declare
BINARY(Test_dat);
at the root of a .c or .cpp source file. Note that special characters are replaced with "_". Then use
BINARY_START(Test_dat)
BINARY_END(Test_dat)
to reference the data beginning and end as a void* array, and
BINARY_SIZE(Test_dat)
to get its size in bytes.