OR-Tools  8.1
status.h File Reference

Go to the source code of this file.

Classes

class  Status
 

Namespaces

 operations_research
 The vehicle routing library lets one model and solve generic vehicle routing problems ranging from the Traveling Salesman Problem to more complex problems such as the Capacitated Vehicle Routing Problem with Time Windows.
 
 operations_research::glop
 

Macros

#define GLOP_RETURN_IF_ERROR(function_call)
 
#define GLOP_RETURN_AND_LOG_ERROR(error_code, message)
 
#define GLOP_RETURN_ERROR_IF_NULL(arg)
 

Functions

std::string GetErrorCodeString (Status::ErrorCode error_code)
 

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)

Definition at line 77 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); \
}

Definition at line 85 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)

Definition at line 70 of file status.h.

ERROR
const int ERROR
Definition: log_severity.h:32
message
std::string message
Definition: trace.cc:395
operations_research::glop::GetErrorCodeString
std::string GetErrorCodeString(Status::ErrorCode error_code)
Definition: status.cc:29