Namespaces | Defines | Functions
status_macros.h File Reference
#include "util/status.h"
#include "util/statusor.h"
Include dependency graph for status_macros.h:

Go to the source code of this file.

Namespaces

namespace  util

Defines

#define ASSIGN_OR_RETURN(lhs, rexpr)
#define ASSIGN_OR_RETURN_IMPL(status, lhs, rexpr)
#define RETURN_IF_ERROR(expr)
#define STATUS_MACROS_CONCAT_NAME(x, y)   STATUS_MACROS_CONCAT_NAME_INNER(x, y)
#define STATUS_MACROS_CONCAT_NAME_INNER(x, y)   x##y

Functions

template<typename T >
Status util::DoAssignOrReturn (T &lhs, StatusOr< T > result)

Define Documentation

#define ASSIGN_OR_RETURN (   lhs,
  rexpr 
)
Value:
ASSIGN_OR_RETURN_IMPL( \
      STATUS_MACROS_CONCAT_NAME(_status_or_value, __COUNTER__), lhs, rexpr);

Definition at line 72 of file status_macros.h.

#define ASSIGN_OR_RETURN_IMPL (   status,
  lhs,
  rexpr 
)
Value:
::util::Status status = DoAssignOrReturn(lhs, (rexpr)); \
  if (!status.ok()) return status;

Definition at line 59 of file status_macros.h.

#define RETURN_IF_ERROR (   expr)
Value:
do { \
    /* Using _status below to avoid capture problems if expr is "status". */ \
    const ::util::Status _status = (expr); \
    if (!_status.ok()) return _status; \
  } while (0)

Definition at line 40 of file status_macros.h.

#define STATUS_MACROS_CONCAT_NAME (   x,
 
)    STATUS_MACROS_CONCAT_NAME_INNER(x, y)

Definition at line 49 of file status_macros.h.

#define STATUS_MACROS_CONCAT_NAME_INNER (   x,
 
)    x##y

Definition at line 48 of file status_macros.h.



gcloud_speech
Author(s):
autogenerated on Thu Jun 6 2019 17:58:03