Classes | Public Member Functions | Private Attributes | List of all members
actionlib::DestructionGuard Class Reference

This class protects an object from being destructed until all users of that object relinquish control of it. More...

#include <destruction_guard.h>

Classes

class  ScopedProtector
 Protects a DestructionGuard until this object goes out of scope. More...
 

Public Member Functions

void destruct ()
 
 DestructionGuard ()
 Constructor for a DestructionGuard. More...
 
bool tryProtect ()
 Attempts to protect the guarded object from being destructed. More...
 
void unprotect ()
 Releases protection on the guarded object. More...
 

Private Attributes

boost::condition count_condition_
 
bool destructing_
 
boost::mutex mutex_
 
int use_count_
 

Detailed Description

This class protects an object from being destructed until all users of that object relinquish control of it.

Definition at line 84 of file destruction_guard.h.

Constructor & Destructor Documentation

◆ DestructionGuard()

actionlib::DestructionGuard::DestructionGuard ( )
inline

Constructor for a DestructionGuard.

Definition at line 90 of file destruction_guard.h.

Member Function Documentation

◆ destruct()

void actionlib::DestructionGuard::destruct ( )
inline

Definition at line 92 of file destruction_guard.h.

◆ tryProtect()

bool actionlib::DestructionGuard::tryProtect ( )
inline

Attempts to protect the guarded object from being destructed.

Returns
True if protection succeeded, false if protection failed

Definition at line 105 of file destruction_guard.h.

◆ unprotect()

void actionlib::DestructionGuard::unprotect ( )
inline

Releases protection on the guarded object.

Definition at line 118 of file destruction_guard.h.

Member Data Documentation

◆ count_condition_

boost::condition actionlib::DestructionGuard::count_condition_
private

Definition at line 169 of file destruction_guard.h.

◆ destructing_

bool actionlib::DestructionGuard::destructing_
private

Definition at line 168 of file destruction_guard.h.

◆ mutex_

boost::mutex actionlib::DestructionGuard::mutex_
private

Definition at line 166 of file destruction_guard.h.

◆ use_count_

int actionlib::DestructionGuard::use_count_
private

Definition at line 167 of file destruction_guard.h.


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


actionlib
Author(s): Eitan Marder-Eppstein, Vijay Pradeep, Mikael Arguedas
autogenerated on Fri May 19 2023 02:36:55