not completely tested new structure for VST/FST build
[ardour.git] / libs / pbd / pbd / destructible.h
1 #ifndef __pbd_destructible_h__
2 #define __pbd_destructible_h__
3
4 #include <sigc++/signal.h>
5
6 namespace PBD {
7
8 /* be very very careful using this class. it does not inherit from sigc::trackable and thus
9    should only be used in multiple-inheritance situations involving another type
10    that does inherit from sigc::trackable (or sigc::trackable itself)
11 */
12
13 class ThingWithGoingAway {
14   public:
15         virtual ~ThingWithGoingAway () {}
16         sigc::signal<void> GoingAway;
17 };
18
19 class Destructible : public sigc::trackable, public ThingWithGoingAway {
20   public:
21         virtual ~Destructible () {}
22         void drop_references () const { GoingAway(); }
23
24 };
25
26 }
27
28 #endif /* __pbd_destructible_h__ */