proxygen
TryWriteUntilCaller< Q, Clock, Duration > Struct Template Reference
Inheritance diagram for TryWriteUntilCaller< Q, Clock, Duration >:
WriteMethodCaller< Q >

Public Member Functions

 TryWriteUntilCaller (Duration &&duration)
 
bool callWrite (Q &q, int i) override
 
string methodName () override
 
- Public Member Functions inherited from WriteMethodCaller< Q >
 WriteMethodCaller ()
 
virtual ~WriteMethodCaller ()=default
 

Public Attributes

const Duration duration_
 

Detailed Description

template<typename Q, class Clock = steady_clock, class Duration = typename Clock::duration>
struct TryWriteUntilCaller< Q, Clock, Duration >

Definition at line 409 of file MPMCQueueTest.cpp.

Constructor & Destructor Documentation

template<typename Q , class Clock = steady_clock, class Duration = typename Clock::duration>
TryWriteUntilCaller< Q, Clock, Duration >::TryWriteUntilCaller ( Duration &&  duration)
inlineexplicit

Definition at line 411 of file MPMCQueueTest.cpp.

411 : duration_(duration) {}
const Duration duration_

Member Function Documentation

template<typename Q , class Clock = steady_clock, class Duration = typename Clock::duration>
bool TryWriteUntilCaller< Q, Clock, Duration >::callWrite ( Q &  q,
int  i 
)
inlineoverridevirtual

Implements WriteMethodCaller< Q >.

Definition at line 412 of file MPMCQueueTest.cpp.

References now().

412  {
413  auto then = Clock::now() + duration_;
414  return q.tryWriteUntil(then, i);
415  }
std::chrono::steady_clock::time_point now()
const Duration duration_
template<typename Q , class Clock = steady_clock, class Duration = typename Clock::duration>
string TryWriteUntilCaller< Q, Clock, Duration >::methodName ( )
inlineoverridevirtual

Implements WriteMethodCaller< Q >.

Definition at line 416 of file MPMCQueueTest.cpp.

References count, and folly::sformat().

416  {
417  return folly::sformat(
418  "tryWriteUntil({}ms)",
419  std::chrono::duration_cast<milliseconds>(duration_).count());
420  }
std::string sformat(StringPiece fmt, Args &&...args)
Definition: Format.h:280
int * count
const Duration duration_

Member Data Documentation

template<typename Q , class Clock = steady_clock, class Duration = typename Clock::duration>
const Duration TryWriteUntilCaller< Q, Clock, Duration >::duration_

Definition at line 410 of file MPMCQueueTest.cpp.


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