This is Unofficial EPICS BASE Doxygen Site
epics::pvAccess::Destroyable::cleaner Class Reference

#include "destroyable.h"

Public Member Functions

 cleaner (const Destroyable::shared_pointer &ptr)
 
void operator() (Destroyable *)
 

Detailed Description

for use with shared_ptr<> when wrapping

shared_ptr<foo> inner(new foo),
outer(inner.get, Destroyable::cleaner(inner));
Warning
Do not use this trick in combination with enable_shared_from_this as it is undefined whether the hidden weak_ptr will be the original or wrapped reference.

Definition at line 47 of file destroyable.h.

Constructor & Destructor Documentation

epics::pvAccess::Destroyable::cleaner::cleaner ( const Destroyable::shared_pointer &  ptr)
inline

Definition at line 50 of file destroyable.h.

50 :ptr(ptr) {}

Member Function Documentation

void epics::pvAccess::Destroyable::cleaner::operator() ( Destroyable )
inline

Definition at line 51 of file destroyable.h.

51  {
52  Destroyable::shared_pointer P;
53  P.swap(ptr);
54  P->destroy();
55  }

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