1 /***************************************************************************
2 trackpanelfunctionfactory - description
4 begin : Sun Dec 28 2003
5 copyright : (C) 2003 by Jason Wood
6 email : jasonwood@blueyonder.co.uk
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
17 #include "trackpanelfunctionfactory.h"
19 #include "trackpanelfunction.h"
23 TrackPanelFunctionFactory::TrackPanelFunctionFactory()
28 TrackPanelFunctionFactory::~TrackPanelFunctionFactory()
33 void TrackPanelFunctionFactory::clearFactory()
35 QMap < QString, TrackPanelFunction * >::iterator itt =
36 m_functionMap.begin();
38 while (itt != m_functionMap.end()) {
43 m_functionMap.clear();
46 void TrackPanelFunctionFactory::registerFunction(const QString & name,
47 TrackPanelFunction * function)
49 if (!m_functionMap.contains(name)) {
50 m_functionMap[name] = function;
52 kError() << "Factory already contains a function called " << name;
56 TrackPanelFunction *TrackPanelFunctionFactory::
57 function(const QString & name)
59 if (m_functionMap.contains(name)) {
60 return m_functionMap[name];
62 kError() << "No function called " << name << " found in factory";
68 #include "trackpanelfunctionfactory.moc"