proxygen
folly::test::EnvVarSaver Struct Reference

#include <EnvUtil.h>

Public Member Functions

 EnvVarSaver ()
 
 EnvVarSaver (EnvVarSaver &&other) noexcept
 
EnvVarSaveroperator= (EnvVarSaver &&other) noexcept
 
 ~EnvVarSaver ()
 

Private Attributes

std::unique_ptr< experimental::EnvironmentStatestate_
 

Detailed Description

Definition at line 100 of file EnvUtil.h.

Constructor & Destructor Documentation

folly::test::EnvVarSaver::EnvVarSaver ( )
inline

Definition at line 101 of file EnvUtil.h.

102  : state_(std::make_unique<experimental::EnvironmentState>(
std::unique_ptr< experimental::EnvironmentState > state_
Definition: EnvUtil.h:119
static EnvironmentState fromCurrentEnvironment()
Definition: EnvUtil.cpp:26
folly::test::EnvVarSaver::EnvVarSaver ( EnvVarSaver &&  other)
inlinenoexcept

Definition at line 105 of file EnvUtil.h.

105 : state_(std::move(other.state_)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::unique_ptr< experimental::EnvironmentState > state_
Definition: EnvUtil.h:119
folly::test::EnvVarSaver::~EnvVarSaver ( )
inline

Definition at line 112 of file EnvUtil.h.

112  {
113  if (state_) {
114  state_->setAsCurrentEnvironment();
115  }
116  }
std::unique_ptr< experimental::EnvironmentState > state_
Definition: EnvUtil.h:119

Member Function Documentation

EnvVarSaver& folly::test::EnvVarSaver::operator= ( EnvVarSaver &&  other)
inlinenoexcept

Definition at line 107 of file EnvUtil.h.

References folly::gen::move.

107  {
108  state_ = std::move(other.state_);
109  return *this;
110  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::unique_ptr< experimental::EnvironmentState > state_
Definition: EnvUtil.h:119

Member Data Documentation

std::unique_ptr<experimental::EnvironmentState> folly::test::EnvVarSaver::state_
private

Definition at line 119 of file EnvUtil.h.


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