openthread-br
0.3.0-72c0388
|
Go to the source code of this file.
Classes | |
class | NonCopyable |
class | Optional< T > |
Macros | |
#define | OTBR_LOG_TAG "UTILS" |
#define | OTBR_ALIGNED(aMem, aAlignType) |
#define | BASE 0x1 |
#define | myoffsetof(s, m) (((size_t) & (((s *)BASE)->m)) - BASE) |
#define | CONTAINING_RECORD(address, type, field) ((type *)((uint8_t *)(address)-myoffsetof(type, field))) |
#define | SuccessOrExit(aStatus) |
#define | SuccessOrDie(aStatus, aMessage) |
#define | VerifyOrExit(aCondition, ...) |
#define | VerifyOrDie(aCondition, aMessage) |
#define | ExitNow(...) |
#define | OTBR_NOOP |
#define | OTBR_UNUSED_VARIABLE(variable) ((void)(variable)) |
Functions | |
template<typename T , typename... Args> | |
std::unique_ptr< T > | MakeUnique (Args &&... args) |
This file includes utility macros for coding.
#define ExitNow | ( | ... | ) |
This unconditionally executes ... and branches to the local label 'exit'.
[in] | ... | An optional expression or block to execute when the assertion fails. |
#define OTBR_ALIGNED | ( | aMem, | |
aAlignType | |||
) |
This aligns the pointer to aAlignType
.
[in] | aMem | A pointer to arbitrary memory. |
[in] | aAlignType | The type to align with and convert the pointer to this type. |
#define SuccessOrDie | ( | aStatus, | |
aMessage | |||
) |
This macro verifies a given error status to be successful (compared against value zero (0)), otherwise, it emits a given error messages and exits the program.
[in] | aStatus | A scalar error status to be evaluated against zero (0). |
[in] | aMessage | A message (text string) to print on failure. |
#define SuccessOrExit | ( | aStatus | ) |
This checks for the specified status, which is expected to commonly be successful, and branches to the local label 'exit' if the status is unsuccessful.
[in] | aStatus | A scalar status to be evaluated against zero (0). |
#define VerifyOrDie | ( | aCondition, | |
aMessage | |||
) |
This macro checks for the specified condition, which is expected to commonly be true, and both prints the message and terminates the program if the condition is false.
[in] | aCondition | The condition to verify |
[in] | aMessage | A message (text string) to print on failure. |
#define VerifyOrExit | ( | aCondition, | |
... | |||
) |
This checks for the specified condition, which is expected to commonly be true, and both executes ... and branches to the local label 'exit' if the condition is false.
[in] | aCondition | A Boolean expression to be evaluated. |
[in] | ... | An expression or block to execute when the assertion fails. |