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;
35 static std::list<Factory *> &get_factories();
40 class RegisteredTool: public Tool
43 class Factory: public Tool::Factory
45 virtual Tool *create(GlDbg &g) const { return new T(g); }
48 static Factory factory;
51 // The no-op expression is necessary to instantiate the static member
52 RegisteredTool() { (void)factory; }
56 typename RegisteredTool<T>::Factory RegisteredTool<T>::factory;