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() {
27 TrackPanelFunctionFactory::~TrackPanelFunctionFactory() {
31 void TrackPanelFunctionFactory::clearFactory() {
32 QMap < QString, TrackPanelFunction * >::iterator itt =
33 m_functionMap.begin();
35 while (itt != m_functionMap.end()) {
40 m_functionMap.clear();
43 void TrackPanelFunctionFactory::registerFunction(const QString & name,
44 TrackPanelFunction * function) {
45 if (!m_functionMap.contains(name)) {
46 m_functionMap[name] = function;
48 kError() << "Factory already contains a function called " << name;
52 TrackPanelFunction *TrackPanelFunctionFactory::
53 function(const QString & name) {
54 if (m_functionMap.contains(name)) {
55 return m_functionMap[name];
57 kError() << "No function called " << name << " found in factory";
63 #include "trackpanelfunctionfactory.moc"