Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
status.h File Reference
#include <string>
#include "absl/base/port.h"

Go to the source code of this file.

Classes

class  operations_research::glop::Status
 

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 
namespace  operations_research::glop
 

Macros

#define GLOP_RETURN_IF_ERROR(function_call)
 Macro to simplify error propagation between function returning Status.
 
#define GLOP_RETURN_AND_LOG_ERROR(error_code, message)
 Macro to simplify the creation of an error.
 
#define GLOP_RETURN_ERROR_IF_NULL(arg)
 Macro to check that a pointer argument is not null.
 

Functions

std::string operations_research::glop::GetErrorCodeString (Status::ErrorCode error_code)
 Returns the string representation of the ErrorCode enum.
 

Macro Definition Documentation

◆ GLOP_RETURN_AND_LOG_ERROR

#define GLOP_RETURN_AND_LOG_ERROR ( error_code,
message )
Value:
do { \
std::string error_message = message; \
LOG(ERROR) << GetErrorCodeString(error_code) << ": " << error_message; \
return Status(error_code, error_message); \
} while (false)
std::string message
Definition trace.cc:397

Macro to simplify the creation of an error.

Definition at line 78 of file status.h.

◆ GLOP_RETURN_ERROR_IF_NULL

#define GLOP_RETURN_ERROR_IF_NULL ( arg)
Value:
if (arg == nullptr) { \
const std::string variable_name = #arg; \
std::string error_message = variable_name + " must not be null."; \
LOG(DFATAL) << error_message; \
return Status(Status::ERROR_NULL, error_message); \
}

Macro to check that a pointer argument is not null.

Definition at line 86 of file status.h.

◆ GLOP_RETURN_IF_ERROR

#define GLOP_RETURN_IF_ERROR ( function_call)
Value:
do { \
Status return_status = function_call; \
if (!return_status.ok()) return return_status; \
} while (false)

Macro to simplify error propagation between function returning Status.

Definition at line 71 of file status.h.