proxygen
DestructionOnCallback Class Reference
Inheritance diagram for DestructionOnCallback:
folly::DelayedDestructionBase

Public Member Functions

 DestructionOnCallback ()
 
void onComplete (int n, int &state)
 
int state () const
 
bool deleted () const
 
- Public Member Functions inherited from folly::DelayedDestructionBase
virtual ~DelayedDestructionBase ()=default
 

Protected Member Functions

void onStackedComplete (int recur)
 
- Protected Member Functions inherited from folly::DelayedDestructionBase
 DelayedDestructionBase ()
 
uint32_t getDestructorGuardCount () const
 

Private Member Functions

void onDelayedDestroy (bool delayed) override
 

Private Attributes

int state_
 
bool deleted_
 

Detailed Description

Definition at line 25 of file DelayedDestructionBaseTest.cpp.

Constructor & Destructor Documentation

DestructionOnCallback::DestructionOnCallback ( )
inline

Member Function Documentation

bool DestructionOnCallback::deleted ( ) const
inline

Definition at line 40 of file DelayedDestructionBaseTest.cpp.

40  {
41  return deleted_;
42  }
void DestructionOnCallback::onComplete ( int  n,
int &  state 
)
inline

Definition at line 29 of file DelayedDestructionBaseTest.cpp.

References i.

Referenced by TEST_F().

29  {
30  DestructorGuard dg(this);
31  for (auto i = n; i >= 0; --i) {
33  }
34  state = state_;
35  }
state
Definition: http_parser.c:272
void DestructionOnCallback::onDelayedDestroy ( bool  delayed)
inlineoverrideprivatevirtual

Implement onDelayedDestroy in subclasses. onDelayedDestroy() is invoked when the object is potentially being destroyed.

Parameters
delayedThis parameter is true if destruction was delayed because of a DestructorGuard object, or false if onDelayedDestroy() is being called directly from the destructor.

Implements folly::DelayedDestructionBase.

Definition at line 58 of file DelayedDestructionBaseTest.cpp.

58  {
59  deleted_ = true;
60  delete this;
61  (void)delayed; // prevent unused variable warnings
62  }
void DestructionOnCallback::onStackedComplete ( int  recur)
inlineprotected

Definition at line 45 of file DelayedDestructionBaseTest.cpp.

45  {
46  DestructorGuard dg(this);
47  ++state_;
48  if (recur <= 0) {
49  return;
50  }
51  onStackedComplete(--recur);
52  }
int DestructionOnCallback::state ( ) const
inline

Definition at line 37 of file DelayedDestructionBaseTest.cpp.

37  {
38  return state_;
39  }

Member Data Documentation

bool DestructionOnCallback::deleted_
private

Definition at line 56 of file DelayedDestructionBaseTest.cpp.

int DestructionOnCallback::state_
private

Definition at line 55 of file DelayedDestructionBaseTest.cpp.


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