Apache Mesos
Classes | Macros | Functions
check.hpp File Reference
#include <ostream>
#include <sstream>
#include <string>
#include <glog/logging.h>
#include <stout/abort.hpp>
#include <stout/error.hpp>
#include <stout/none.hpp>
#include <stout/option.hpp>
#include <stout/result.hpp>
#include <stout/some.hpp>
#include <stout/try.hpp>

Go to the source code of this file.

Classes

struct  _CheckFatal
 

Macros

#define CHECK_STATE(name, check, expression)
 
#define CHECK_SOME(expression)   CHECK_STATE(CHECK_SOME, _check_some, expression)
 
#define CHECK_NONE(expression)   CHECK_STATE(CHECK_NONE, _check_none, expression)
 
#define CHECK_ERROR(expression)   CHECK_STATE(CHECK_ERROR, _check_error, expression)
 
#define CHECK_NOTNONE(expression)
 

Functions

template<typename T >
T && _check_not_none (const char *file, int line, const char *message, Option< T > &&t)
 
template<typename T >
T & _check_not_none (const char *file, int line, const char *message, Option< T > &t)
 
template<typename T >
const T & _check_not_none (const char *file, int line, const char *message, const Option< T > &t)
 
template<typename T >
Option< Error_check_some (const Option< T > &o)
 
template<typename T >
Option< Error_check_some (const Try< T > &t)
 
template<typename T >
Option< Error_check_some (const Result< T > &r)
 
template<typename T >
Option< Error_check_none (const Option< T > &o)
 
template<typename T >
Option< Error_check_none (const Result< T > &r)
 
template<typename T >
Option< Error_check_error (const Try< T > &t)
 
template<typename T >
Option< Error_check_error (const Result< T > &r)
 

Macro Definition Documentation

#define CHECK_ERROR (   expression)    CHECK_STATE(CHECK_ERROR, _check_error, expression)
#define CHECK_NONE (   expression)    CHECK_STATE(CHECK_NONE, _check_none, expression)
#define CHECK_NOTNONE (   expression)
Value:
__FILE__, \
__LINE__, \
"'" #expression "' Must be SOME", \
(expression))
T && _check_not_none(const char *file, int line, const char *message, Option< T > &&t)
Definition: check.hpp:59
#define CHECK_SOME (   expression)    CHECK_STATE(CHECK_SOME, _check_some, expression)
#define CHECK_STATE (   name,
  check,
  expression 
)
Value:
for (const Option<Error> _error = check(expression); _error.isSome();) \
_CheckFatal(__FILE__, \
__LINE__, \
#name, \
#expression, \
_error.get()).stream()
Try< Nothing > check()
Definition: check.hpp:197
constexpr const char * name
Definition: shell.hpp:41

Function Documentation

template<typename T >
Option<Error> _check_error ( const Try< T > &  t)
template<typename T >
Option<Error> _check_error ( const Result< T > &  r)
template<typename T >
Option<Error> _check_none ( const Option< T > &  o)
template<typename T >
Option<Error> _check_none ( const Result< T > &  r)
template<typename T >
T&& _check_not_none ( const char *  file,
int  line,
const char *  message,
Option< T > &&  t 
)
template<typename T >
T& _check_not_none ( const char *  file,
int  line,
const char *  message,
Option< T > &  t 
)
template<typename T >
const T& _check_not_none ( const char *  file,
int  line,
const char *  message,
const Option< T > &  t 
)
template<typename T >
Option<Error> _check_some ( const Option< T > &  o)
template<typename T >
Option<Error> _check_some ( const Try< T > &  t)
template<typename T >
Option<Error> _check_some ( const Result< T > &  r)