3 This file is part of gldbg
4 Copyright © 2010 Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
23 virtual ~Factory() { }
25 virtual Tool *create(GlDbg &) const = 0;
33 virtual void decode(const char *, unsigned) = 0;
34 virtual void process_started() { }
35 virtual void process_stopped(int) { }
37 static std::list<Factory *> &get_factories();
42 class RegisteredTool: public Tool
45 class Factory: public Tool::Factory
47 virtual Tool *create(GlDbg &g) const { return new T(g); }
50 static Factory factory;
53 // The no-op expression is necessary to instantiate the static member
54 RegisteredTool() { (void)factory; }
58 typename RegisteredTool<T>::Factory RegisteredTool<T>::factory;