pvAccessCPP  7.1.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
destroyable.h
1 /* destroyable.h */
2 /*
3  * Copyright information and license terms for this software can be
4  * found in the file LICENSE that is included with the distribution
5  */
9 #ifndef DESTROYABLE_H
10 #define DESTROYABLE_H
11 
12 #include <compilerDependencies.h>
13 
14 #include <pv/sharedPtr.h>
15 
16 #include <shareLib.h>
17 
18 namespace epics { namespace pvAccess {
19 
20 
24  class Destroyable {
25  public:
26  POINTER_DEFINITIONS(Destroyable);
30  virtual void destroy() {};
31 
32  protected:
33  virtual ~Destroyable() {}
34  public:
35 
47  class cleaner {
48  Destroyable::shared_pointer ptr;
49  public:
50  cleaner(const Destroyable::shared_pointer& ptr) :ptr(ptr) {}
51  void operator()(Destroyable*) {
52  Destroyable::shared_pointer P;
53  P.swap(ptr);
54  P->destroy();
55  }
56  };
57  };
58 
59 }}
60 namespace epics { namespace pvData {
61  typedef ::epics::pvAccess::Destroyable Destroyable EPICS_DEPRECATED;
62 }}
63 #endif /* DESTROYABLE_H */
virtual void destroy()
Destroy this instance.
Definition: destroyable.h:30
for use with shared_ptr&lt;&gt; when wrapping
Definition: destroyable.h:47
Instance declaring destroy method.
Definition: destroyable.h:24