Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
StatusCodes.h File Reference

Header file defining status codes and relevant preprocessor macros. More...

#include <exception>
#include <string>
Include dependency graph for StatusCodes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pandora::StatusCodeException
 StatusCodeException class. More...
 

Namespaces

namespace  pandora
 

Macros

#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
 
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
 
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
 
#define PANDORA_THROW_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
 
#define STATUS_CODE_TABLE(d)
 
#define GET_STATUS_CODE_ENUM_ENTRY(a, b)    a,
 The status code enum entry macro.
 
#define GET_STATUS_CODE_NAME_SWITCH(a, b)    case a : return b;
 The status code name switch statement macro.
 

Enumerations

enum  pandora::StatusCode { pandora::NUMBER_OF_STATUS_CODES }
 The StatusCode enum. More...
 

Functions

std::string pandora::StatusCodeToString (const StatusCode statusCode)
 Get status code as a string.
 

Detailed Description

Header file defining status codes and relevant preprocessor macros.

Log

Definition in file StatusCodes.h.

Macro Definition Documentation

◆ GET_STATUS_CODE_ENUM_ENTRY

#define GET_STATUS_CODE_ENUM_ENTRY (   a,
 
)     a,

The status code enum entry macro.

Definition at line 87 of file StatusCodes.h.

◆ GET_STATUS_CODE_NAME_SWITCH

#define GET_STATUS_CODE_NAME_SWITCH (   a,
 
)     case a : return b;

The status code name switch statement macro.

Definition at line 93 of file StatusCodes.h.

◆ PANDORA_RETURN_RESULT_IF

#define PANDORA_RETURN_RESULT_IF (   StatusCode1,
  Operator,
  Command 
)
Value:
{ \
const pandora::StatusCode statusCode(Command); \
if (statusCode Operator StatusCode1) \
{ \
std::cout << #Command << " return " << StatusCodeToString(statusCode) << std::endl; \
std::cout << " in function: " << __FUNCTION__ << std::endl; \
std::cout << " in file: " << __FILE__ << " line#: " << __LINE__ << std::endl; \
return statusCode; \
} \
}
StatusCode
The StatusCode enum.

Definition at line 19 of file StatusCodes.h.

◆ PANDORA_RETURN_RESULT_IF_AND_IF

#define PANDORA_RETURN_RESULT_IF_AND_IF (   StatusCode1,
  StatusCode2,
  Operator,
  Command 
)
Value:
{ \
const pandora::StatusCode statusCode(Command); \
if ((statusCode Operator StatusCode1) && (statusCode Operator StatusCode2)) \
{ \
std::cout << #Command << " return " << StatusCodeToString(statusCode) << std::endl; \
std::cout << " in function: " << __FUNCTION__ << std::endl; \
std::cout << " in file: " << __FILE__ << " line#: " << __LINE__ << std::endl; \
return statusCode; \
} \
}

Definition at line 31 of file StatusCodes.h.

◆ PANDORA_THROW_RESULT_IF

#define PANDORA_THROW_RESULT_IF (   StatusCode1,
  Operator,
  Command 
)
Value:
{ \
const pandora::StatusCode statusCode(Command); \
if (statusCode Operator StatusCode1) \
{ \
std::cout << #Command << " throw " << StatusCodeToString(statusCode) << std::endl; \
std::cout << " in function: " << __FUNCTION__ << std::endl; \
std::cout << " in file: " << __FILE__ << " line#: " << __LINE__ << std::endl; \
throw pandora::StatusCodeException(statusCode); \
} \
}
StatusCodeException class.

Definition at line 43 of file StatusCodes.h.

◆ PANDORA_THROW_RESULT_IF_AND_IF

#define PANDORA_THROW_RESULT_IF_AND_IF (   StatusCode1,
  StatusCode2,
  Operator,
  Command 
)
Value:
{ \
const pandora::StatusCode statusCode(Command); \
if ((statusCode Operator StatusCode1) && (statusCode Operator StatusCode2)) \
{ \
std::cout << #Command << " throw " << StatusCodeToString(statusCode) << std::endl; \
std::cout << " in function: " << __FUNCTION__ << std::endl; \
std::cout << " in file: " << __FILE__ << " line#: " << __LINE__ << std::endl; \
throw pandora::StatusCodeException(statusCode); \
} \
}

Definition at line 55 of file StatusCodes.h.

◆ STATUS_CODE_TABLE

#define STATUS_CODE_TABLE (   d)
Value:
d(STATUS_CODE_SUCCESS, "STATUS_CODE_SUCCESS" ) \
d(STATUS_CODE_FAILURE, "STATUS_CODE_FAILURE" ) \
d(STATUS_CODE_NOT_FOUND, "STATUS_CODE_NOT_FOUND" ) \
d(STATUS_CODE_NOT_INITIALIZED, "STATUS_CODE_NOT_INITIALIZED" ) \
d(STATUS_CODE_ALREADY_INITIALIZED, "STATUS_CODE_ALREADY_INITIALIZED" ) \
d(STATUS_CODE_ALREADY_PRESENT, "STATUS_CODE_ALREADY_PRESENT" ) \
d(STATUS_CODE_OUT_OF_RANGE, "STATUS_CODE_OUT_OF_RANGE" ) \
d(STATUS_CODE_NOT_ALLOWED, "STATUS_CODE_NOT_ALLOWED" ) \
d(STATUS_CODE_INVALID_PARAMETER, "STATUS_CODE_INVALID_PARAMETER" ) \
d(STATUS_CODE_UNCHANGED, "STATUS_CODE_UNCHANGED" )

Definition at line 72 of file StatusCodes.h.