pvAccessCPP 7.1.8
Loading...
Searching...
No Matches
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
18namespace epics { namespace pvAccess {
19
20
24 class epicsShareClass 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}}
60namespace epics { namespace pvData {
61 typedef ::epics::pvAccess::Destroyable Destroyable EPICS_DEPRECATED;
62}}
63#endif /* DESTROYABLE_H */
for use with shared_ptr<> when wrapping
Definition destroyable.h:47
Instance declaring destroy method.
Definition destroyable.h:24
virtual void destroy()
Destroy this instance.
Definition destroyable.h:30
Copyright - See the COPYRIGHT that is included with this distribution.