00001 #ifndef QPID_PLUGIN_H
00002 #define QPID_PLUGIN_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <boost/noncopyable.hpp>
00025 #include <boost/function.hpp>
00026 #include <vector>
00027
00030 namespace qpid {
00031 struct Options;
00032
00036 class Plugin : private boost::noncopyable {
00037 public:
00038 typedef std::vector<Plugin*> Plugins;
00039
00045 class Target : private boost::noncopyable
00046 {
00047 public:
00049 virtual ~Target();
00050
00052 void finalize();
00053
00055 void addFinalizer(const boost::function<void()>&);
00056
00057 private:
00058 std::vector<boost::function<void()> > finalizers;
00059 };
00060
00068 Plugin();
00069
00070 virtual ~Plugin();
00071
00079 virtual Options* getOptions();
00080
00089 virtual void earlyInitialize(Target&) = 0;
00090
00099 virtual void initialize(Target&) = 0;
00100
00104 static const Plugins& getPlugins();
00105
00107 static void earlyInitAll(Target&);
00108
00110 static void initializeAll(Target&);
00111
00113 static void addOptions(Options& opts);
00114 };
00115
00116 }
00117
00118 #endif