Skip to content

File internal.hh

FileList > ase > internal.hh

Namespaces

Type Name
namespace Ase
The Anklang C++ API namespace.
namespace Test
Helper namespace for unit testing.

Classes

Type Name
struct IntegrityCheck

Macros

Type Name
define ALIGNED16 (pointer) ASE\_ALIGNED16 (pointer)
Check if a pointer address is 16-Byte aligned.
define ALIGNMENT16 (pointer) ASE\_ALIGNMENT16 (pointer)
Yield 16-Byte alignment of a pointer address.
define APPLY_IDL_PROPERTY (lvalue, rvalue) ASE\_OBJECT\_APPLY\_IDL\_PROPERTY(lvalue, rvalue)
Constrain, apply, notify and implement a property change, the property name must equal __func__ .
define ARRAY_SIZE (array) ASE\_ARRAY\_SIZE (array)
Yield the number of C array elements.
define CLAMP (v, mi, ma) ((v) < (mi) ? (mi) : ((v) > (ma) ? (ma) : (v)))
Yield v clamped to[mi … ma] .
define CQUOTE (str) ASE\_CQUOTE(str)
Produce a const char* string, wrapping str into C-style double quotes.
define ISLIKELY (cond) ASE\_ISLIKELY (cond)
Hint to the compiler to optimize for cond == TRUE.
define MAX (a, b) ((a) >= (b) ? (a) : (b))
Yield maximum of a andb .
define MIN (a, b) ((a) <= (b) ? (a) : (b))
Yield minimum of a andb .
define N_ (str) (str)
Mark a string for translation, passed through verbatim by the preprocessor.
define STRING_VECTOR_FROM_ARRAY (ConstCharArray) ASE\_STRING\_VECTOR\_FROM\_ARRAY(ConstCharArray)
Create a Ase::StringVector, from a const char* C-style array.
define TEST_BENCHMARK (FUNC) /* multi line expression */
Register func as a benchmark test.
define TEST_INTEGRITY (FUNC) /* multi line expression */
Register func as an integrity test.
define UNLIKELY (cond) ASE\_UNLIKELY (cond)
Hint to the compiler to optimize for cond == FALSE.
define _ (...) ::Ase::ase\_gettext (\_\_VA\_ARGS\_\_)
Retrieve the translation of a C or C++ string.
define assert_paranoid (expr) do { if (expr) [[likely]] break; [**::Ase::assertion\_failed**](namespaceAse.md#function-assertion_failed) (#expr); } while (0)
Issue an assertion warning if expr evaluates to false, check might be disabled in production.
define assert_return (expr, ...) do { if (expr) [[likely]] break; [**::Ase::assertion\_failed**](namespaceAse.md#function-assertion_failed) (#expr); return \_\_VA\_ARGS\_\_; } while (0)
Return from the current function if expr is unmet and issue an assertion warning.
define assert_return_unreached (...) do { [**::Ase::assertion\_failed**](namespaceAse.md#function-assertion_failed) (""); return \_\_VA\_ARGS\_\_; } while (0)
Return from the current function and issue an assertion warning.
define assert_unreached () \_\_builtin\_unreachable()
Explicitely mark unreachable code locations.
define assert_warn (expr) do { if (expr) [[likely]] break; [**::Ase::assertion\_failed**](namespaceAse.md#function-assertion_failed) (#expr); } while (0)
Issue an assertion warning if expr evaluates to false.
define if_constexpr if constexpr
Indentation helper for editors that cannot (yet) decipher if constexpr __
define return_unless (cond, ...) ASE\_RETURN\_UNLESS (cond, \_\_VA\_ARGS\_\_)
Return silently if cond does not evaluate to true with return value___ ..._

Macro Definition Documentation

define ALIGNED16

Check if a pointer address is 16-Byte aligned.

#define ALIGNED16 (
    pointer
) `ASE_ALIGNED16 (pointer)`

define ALIGNMENT16

Yield 16-Byte alignment of a pointer address.

#define ALIGNMENT16 (
    pointer
) `ASE_ALIGNMENT16 (pointer)`

define APPLY_IDL_PROPERTY

Constrain, apply, notify and implement a property change, the property name must equal __func__ .

#define APPLY_IDL_PROPERTY (
    lvalue,
    rvalue
) `ASE_OBJECT_APPLY_IDL_PROPERTY(lvalue, rvalue)`

define ARRAY_SIZE

Yield the number of C array elements.

#define ARRAY_SIZE (
    array
) `ASE_ARRAY_SIZE (array)`

define CLAMP

Yield v clamped to[mi … ma] .

#define CLAMP (
    v,
    mi,
    ma
) `((v) < (mi) ? (mi) : ((v) > (ma) ? (ma) : (v)))`

define CQUOTE

Produce a const char* string, wrapping str into C-style double quotes.

#define CQUOTE (
    str
) `ASE_CQUOTE(str)`

define ISLIKELY

Hint to the compiler to optimize for cond == TRUE.

#define ISLIKELY (
    cond
) `ASE_ISLIKELY (cond)`

define MAX

Yield maximum of a andb .

#define MAX (
    a,
    b
) `((a) >= (b) ? (a) : (b))`

define MIN

Yield minimum of a andb .

#define MIN (
    a,
    b
) `((a) <= (b) ? (a) : (b))`

define N_

Mark a string for translation, passed through verbatim by the preprocessor.

#define N_ (
    str
) `(str)`

define STRING_VECTOR_FROM_ARRAY

Create a Ase::StringVector, from a const char* C-style array.

#define STRING_VECTOR_FROM_ARRAY (
    ConstCharArray
) `ASE_STRING_VECTOR_FROM_ARRAY(ConstCharArray)`

define TEST_BENCHMARK

Register func as a benchmark test.

#define TEST_BENCHMARK (
    FUNC
) `/* multi line expression */`

define TEST_INTEGRITY

Register func as an integrity test.

#define TEST_INTEGRITY (
    FUNC
) `/* multi line expression */`

define UNLIKELY

Hint to the compiler to optimize for cond == FALSE.

#define UNLIKELY (
    cond
) `ASE_UNLIKELY (cond)`

define _

Retrieve the translation of a C or C++ string.

#define _ (
    ...
) `::Ase::ase_gettext (__VA_ARGS__)`

define assert_paranoid

Issue an assertion warning if expr evaluates to false, check might be disabled in production.

#define assert_paranoid (
    expr
) `do { if (expr) [[likely]] break; ::Ase::assertion_failed (#expr); } while (0)`

define assert_return

Return from the current function if expr is unmet and issue an assertion warning.

#define assert_return (
    expr,
    ...
) `do { if (expr) [[likely]] break; ::Ase::assertion_failed (#expr); return __VA_ARGS__; } while (0)`

define assert_return_unreached

Return from the current function and issue an assertion warning.

#define assert_return_unreached (
    ...
) `do { ::Ase::assertion_failed (""); return __VA_ARGS__; } while (0)`

define assert_unreached

Explicitely mark unreachable code locations.

#define assert_unreached (

) `__builtin_unreachable()`

define assert_warn

Issue an assertion warning if expr evaluates to false.

#define assert_warn (
    expr
) `do { if (expr) [[likely]] break; ::Ase::assertion_failed (#expr); } while (0)`

define if_constexpr

Indentation helper for editors that cannot (yet) decipher if constexpr __

#define if_constexpr `if constexpr`

define return_unless

Return silently if cond does not evaluate to true with return value___ ..._

#define return_unless (
    cond,
    ...
) `ASE_RETURN_UNLESS (cond, __VA_ARGS__)`


The documentation for this class was generated from the following file /__w/anklang/anklang/ase/internal.hh