Sauce-0.10.1: sauce/internal/disposal_deleter.h Source File

Sauce-0.10.1 A C++ Dependency Injection Framework

- Main Page
- Classes
- Files

- File List

disposal_deleter.h
1 #ifndef SAUCE_INTERNAL_DISPOSAL_DELETER_H_
2 #define SAUCE_INTERNAL_DISPOSAL_DELETER_H_
3
4 #include <sauce/memory.h>
5
6 namespace sauce {
7 namespace internal {
8
12 template<typename Iface, typename Disposal>
13 class DisposalDeleter {
14 typedef sauce::shared_ptr<Disposal> DisposalPtr;
15
16 DisposalPtr disposal;
17
18 public:
19
20 DisposalDeleter(DisposalPtr disposal):
21 disposal(disposal) {}
22
26 void operator()(Iface * iface) const {
27 disposal->dispose(iface);
28 }
29 };
30
31 }
32
33 namespace i = ::sauce::internal;
34
35 }
36
37 #endif // SAUCE_INTERNAL_DISPOSAL_DELETER_H_