proxygen
folly::ShallowCopyRequestContextScopeGuard Struct Reference

#include <Request.h>

Public Member Functions

 ShallowCopyRequestContextScopeGuard ()
 
 ShallowCopyRequestContextScopeGuard (const RequestToken &val, std::unique_ptr< RequestData > data)
 
 ShallowCopyRequestContextScopeGuard (const std::string &val, std::unique_ptr< RequestData > data)
 
 ~ShallowCopyRequestContextScopeGuard ()
 
 ShallowCopyRequestContextScopeGuard (const ShallowCopyRequestContextScopeGuard &)=delete
 
ShallowCopyRequestContextScopeGuardoperator= (const ShallowCopyRequestContextScopeGuard &)=delete
 
 ShallowCopyRequestContextScopeGuard (ShallowCopyRequestContextScopeGuard &&)=delete
 
ShallowCopyRequestContextScopeGuardoperator= (ShallowCopyRequestContextScopeGuard &&)=delete
 

Private Attributes

std::shared_ptr< RequestContextprev_
 

Detailed Description

This guard maintains all the RequestData pointers of the parent. This allows to overwrite a specific RequestData pointer for the scope's duration, without breaking others.

Only modified pointers will have their set/onset methods called

Definition at line 289 of file Request.h.

Constructor & Destructor Documentation

folly::ShallowCopyRequestContextScopeGuard::ShallowCopyRequestContextScopeGuard ( )
inline

Definition at line 290 of file Request.h.

static std::shared_ptr< RequestContext > setShallowCopyContext()
Definition: Request.cpp:269
std::shared_ptr< RequestContext > prev_
Definition: Request.h:326
folly::ShallowCopyRequestContextScopeGuard::ShallowCopyRequestContextScopeGuard ( const RequestToken val,
std::unique_ptr< RequestData data 
)
inline

Shallow copy then overwrite one specific RequestData

Helper constructor which is a more efficient equivalent to "clearRequestData" then "setRequestData" after the guard.

Definition at line 299 of file Request.h.

References folly::RequestContext::get(), folly::gen::move, and folly::RequestContext::overwriteContextData().

304  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
double val
Definition: String.cpp:273
void overwriteContextData(const RequestToken &val, std::unique_ptr< RequestData > data)
Definition: Request.cpp:141
static RequestContext * get()
Definition: Request.cpp:290
folly::ShallowCopyRequestContextScopeGuard::ShallowCopyRequestContextScopeGuard ( const std::string val,
std::unique_ptr< RequestData data 
)
inline

Definition at line 305 of file Request.h.

References folly::RequestContext::get(), folly::gen::move, and folly::RequestContext::overwriteContextData().

310  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
double val
Definition: String.cpp:273
void overwriteContextData(const RequestToken &val, std::unique_ptr< RequestData > data)
Definition: Request.cpp:141
static RequestContext * get()
Definition: Request.cpp:290
folly::ShallowCopyRequestContextScopeGuard::~ShallowCopyRequestContextScopeGuard ( )
inline

Definition at line 312 of file Request.h.

References folly::gen::move, and folly::RequestContext::setContext().

312  {
314  }
static std::shared_ptr< RequestContext > setContext(std::shared_ptr< RequestContext > ctx)
Definition: Request.cpp:227
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::shared_ptr< RequestContext > prev_
Definition: Request.h:326
folly::ShallowCopyRequestContextScopeGuard::ShallowCopyRequestContextScopeGuard ( const ShallowCopyRequestContextScopeGuard )
delete
folly::ShallowCopyRequestContextScopeGuard::ShallowCopyRequestContextScopeGuard ( ShallowCopyRequestContextScopeGuard &&  )
delete

Member Function Documentation

ShallowCopyRequestContextScopeGuard& folly::ShallowCopyRequestContextScopeGuard::operator= ( const ShallowCopyRequestContextScopeGuard )
delete
ShallowCopyRequestContextScopeGuard& folly::ShallowCopyRequestContextScopeGuard::operator= ( ShallowCopyRequestContextScopeGuard &&  )
delete

Member Data Documentation

std::shared_ptr<RequestContext> folly::ShallowCopyRequestContextScopeGuard::prev_
private

Definition at line 326 of file Request.h.


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