proxygen
folly::exception_wrapper::InPlace< Ex > Struct Template Reference

Static Public Member Functions

static void copy_ (exception_wrapper const *from, exception_wrapper *to)
 
static void move_ (exception_wrapper *from, exception_wrapper *to)
 
static void delete_ (exception_wrapper *that)
 
static void throw_ (exception_wrapper const *that)
 
static std::type_info const * type_ (exception_wrapper const *)
 
static std::exception const * get_exception_ (exception_wrapper const *that)
 
static exception_wrapper get_exception_ptr_ (exception_wrapper const *that)
 

Static Public Attributes

static constexpr VTable const ops_
 

Detailed Description

template<class Ex>
struct folly::exception_wrapper::InPlace< Ex >

Definition at line 284 of file ExceptionWrapper.h.

Member Function Documentation

template<class Ex >
void folly::exception_wrapper::InPlace< Ex >::copy_ ( exception_wrapper const *  from,
exception_wrapper to 
)
inlinestatic

Definition at line 182 of file ExceptionWrapper-inl.h.

References folly::exception_wrapper::Buffer::as(), and folly::exception_wrapper::buff_.

184  {
185  ::new (static_cast<void*>(std::addressof(to->buff_.as<Ex>())))
186  Ex(from->buff_.as<Ex>());
187 }
std::enable_if< detail::is_chrono_conversion< Tgt, Src >::value, Tgt >::type to(const Src &value)
Definition: Conv.h:677
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::from_fn from
Collect as()
Definition: Base.h:811
template<class Ex >
void folly::exception_wrapper::InPlace< Ex >::delete_ ( exception_wrapper that)
inlinestatic

Definition at line 197 of file ExceptionWrapper-inl.h.

References folly::exception_wrapper::Buffer::as(), folly::exception_wrapper::buff_, folly::exception_wrapper::uninit_, and folly::exception_wrapper::vptr_.

197  {
198  that->buff_.as<Ex>().~Ex();
199  that->vptr_ = &uninit_;
200 }
static VTable const uninit_
template<class Ex >
std::exception const * folly::exception_wrapper::InPlace< Ex >::get_exception_ ( exception_wrapper const *  that)
inlinestatic

Definition at line 212 of file ExceptionWrapper-inl.h.

References folly::exception_wrapper::Buffer::as(), folly::exception_wrapper::as_exception_or_null_(), and folly::exception_wrapper::buff_.

213  {
214  return as_exception_or_null_(that->buff_.as<Ex>());
215 }
static std::exception const * as_exception_or_null_(std::exception const &ex)
template<class Ex >
exception_wrapper folly::exception_wrapper::InPlace< Ex >::get_exception_ptr_ ( exception_wrapper const *  that)
inlinestatic

Definition at line 217 of file ExceptionWrapper-inl.h.

218  {
219  try {
220  throw_(that);
221  } catch (Ex const& ex) {
222  return exception_wrapper{std::current_exception(), ex};
223  }
224 }
static void throw_(exception_wrapper const *that)
template<class Ex >
void folly::exception_wrapper::InPlace< Ex >::move_ ( exception_wrapper from,
exception_wrapper to 
)
inlinestatic

Definition at line 189 of file ExceptionWrapper-inl.h.

References folly::exception_wrapper::Buffer::as(), folly::exception_wrapper::buff_, and folly::gen::move.

191  {
192  ::new (static_cast<void*>(std::addressof(to->buff_.as<Ex>())))
193  Ex(std::move(from->buff_.as<Ex>()));
194  delete_(from);
195 }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
STL namespace.
std::enable_if< detail::is_chrono_conversion< Tgt, Src >::value, Tgt >::type to(const Src &value)
Definition: Conv.h:677
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::from_fn from
static void delete_(exception_wrapper *that)
Collect as()
Definition: Base.h:811
template<class Ex >
void folly::exception_wrapper::InPlace< Ex >::throw_ ( exception_wrapper const *  that)
inlinestatic

Definition at line 202 of file ExceptionWrapper-inl.h.

References folly::exception_wrapper::Buffer::as(), and folly::exception_wrapper::buff_.

203  {
204  throw that->buff_.as<Ex>(); // @nolint
205 }
template<class Ex >
std::type_info const * folly::exception_wrapper::InPlace< Ex >::type_ ( exception_wrapper const *  )
inlinestatic

Definition at line 207 of file ExceptionWrapper-inl.h.

208  {
209  return &typeid(Ex);
210 }

Member Data Documentation

template<class Ex >
constexpr exception_wrapper::VTable folly::exception_wrapper::InPlace< Ex >::ops_
static
Initial value:

Definition at line 293 of file ExceptionWrapper.h.


The documentation for this struct was generated from the following files: