XnMacros.h File Reference
`#include "XnStatusCodes.h"`

Go to the source code of this file.

## Macros

#define | XN_SETBITMASK(x)
#define | XN_RET_IF_NULL(x, y)
#define | XN_IS_STATUS_OK_RET(x, y)
#define | XN_IS_STATUS_OK_GOCLEANUP_RET(x, y)
#define | XN_IS_STATUS_OK(x)
#define | XN_IS_STATUS_OK_ASSERT(x)
#define | XN_IS_STATUS_OK_GOCLEANUP(x)
#define | XN_IS_BOOL_OK_RET(x, y)
#define | XN_IS_BOOL_OK_GOCLEANUP_RET(x, y)
#define | XN_GOCLEANUP_RET(x, y)
#define | XN_VALIDATE_PTR(x, y)
#define | XN_CHECK_INPUT_OVERFLOW(x, y)
#define | XN_CHECK_OUTPUT_OVERFLOW(x, y)
#define | XN_DISABLE_COPY_AND_ASSIGN(TypeName)
#define | XN_REFERENCE_VARIABLE(x)

## Macro Definition Documentation

## XN_CHECK_INPUT_OVERFLOW

#define XN_CHECK_INPUT_OVERFLOW | ( |  | x,
|  |  | y )

Value:
if (x > y) \
{ \
return (XN_STATUS_INPUT_BUFFER_OVERFLOW); \
}

Returns an output overflow error if x is beyond y

## XN_CHECK_OUTPUT_OVERFLOW

#define XN_CHECK_OUTPUT_OVERFLOW | ( |  | x,
|  |  | y )

Value:
if (x > y) \
{ \
return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW); \
}

Returns an input overflow error if x is beyond y

## XN_DISABLE_COPY_AND_ASSIGN

#define XN_DISABLE_COPY_AND_ASSIGN | ( |  | TypeName | ) |

Value:
TypeName(const TypeName&); \
void operator=(const TypeName&);

Disables Copy ctor and assignment operator. Should be placed under "private:" section.

## XN_GOCLEANUP_RET

#define XN_GOCLEANUP_RET | ( |  | x,
|  |  | y )

Value:
x = y; \
goto ErrorCleanUp;

Jumps to the ErrorCleanUp label if X isn't XN_STATUS_OK and returns Y.

## XN_IS_BOOL_OK_GOCLEANUP_RET

#define XN_IS_BOOL_OK_GOCLEANUP_RET | ( |  | x,
|  |  | y )

Value:
if (x != TRUE) \
{ \
goto ErrorCleanUp; \
}
TRUE
#define TRUE
Definition XnPlatform.h:96

Jumps to the ErrorCleanUp label if X isn't XN_STATUS_OK and returns Y.

## XN_IS_BOOL_OK_RET

#define XN_IS_BOOL_OK_RET | ( |  | x,
|  |  | y )

Value:
if (x != TRUE) \
{ \
return (y); \
}

Returns Y if X isn't XN_STATUS_OK.

## XN_IS_STATUS_OK

#define XN_IS_STATUS_OK | ( |  | x | ) |

Value:
XN_IS_STATUS_OK_RET(x, x)
XN_IS_STATUS_OK_RET
#define XN_IS_STATUS_OK_RET(x, y)
Definition XnMacros.h:45

Returns X if X isn't XN_STATUS_OK.

## XN_IS_STATUS_OK_ASSERT

#define XN_IS_STATUS_OK_ASSERT | ( |  | x | ) |

Value:
if (x != XN_STATUS_OK) \
{ \
XN_ASSERT(FALSE); \
return (x); \
}
FALSE
#define FALSE
Definition XnPlatform.h:100
XN_STATUS_OK
#define XN_STATUS_OK
Definition XnStatus.h:37

## XN_IS_STATUS_OK_GOCLEANUP

#define XN_IS_STATUS_OK_GOCLEANUP | ( |  | x | ) |

Value:
if (x != XN_STATUS_OK) \
{ \
goto ErrorCleanUp; \
}

Jumps to the ErrorCleanUp label if X isn't XN_STATUS_OK.

## XN_IS_STATUS_OK_GOCLEANUP_RET

#define XN_IS_STATUS_OK_GOCLEANUP_RET | ( |  | x,
|  |  | y )

Value:
if (x != XN_STATUS_OK) \
{ \
x = y; \
goto ErrorCleanUp; \
}

Jumps to the ErrorCleanUp label if X isn't XN_STATUS_OK and return Y.

## XN_IS_STATUS_OK_RET

#define XN_IS_STATUS_OK_RET | ( |  | x,
|  |  | y )

Value:
if (x != XN_STATUS_OK) \
{ \
return (y); \
}

Returns Y if X isn't XN_STATUS_OK.

## XN_REFERENCE_VARIABLE

#define XN_REFERENCE_VARIABLE | ( |  | x | ) |

Value:
((void)x)

Disables the "local variable is initialized but not referenced" warning (if you need to use this variable in an assert

## XN_RET_IF_NULL

#define XN_RET_IF_NULL | ( |  | x,
|  |  | y )

Value:
if (x == NULL) \
{ \
return (y); \
}

Returns Y if X is NULL.

## XN_SETBITMASK

#define XN_SETBITMASK | ( |  | x | ) |

Value:
(1 << x-1)

Returns the (x)th power of 2.

## XN_VALIDATE_PTR

#define XN_VALIDATE_PTR | ( |  | x,
|  |  | y )

Value:
if (x == NULL) \
{ \
return (y); \
}

Returns Y if X is null.