00001 /*************************************************************************** 00002 * Copyright (C) 2003 by Gav Wood * 00003 * gav@cs.york.ac.uk * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU Library General Public License as * 00007 * published by the Free Software Foundation; either version 2 of the * 00008 * License, or (at your option) any later version. * 00009 ***************************************************************************/ 00010 #ifndef _RGEDDEI_ABSTRACTPROCESSORGROUP_H 00011 #define _RGEDDEI_ABSTRACTPROCESSORGROUP_H 00012 00013 #include <qstring.h> 00014 #include <qmap.h> 00015 00016 #ifdef __GEDDEI_BUILD 00017 #include "processor.h" 00018 #include "abstractprocessor.h" 00019 #else 00020 #include <geddei/processor.h> 00021 #include <geddei/abstractprocessor.h> 00022 #endif 00023 using namespace Geddei; 00024 00025 namespace rGeddei 00026 { 00027 00028 class AbstractDomProcessor; 00029 00043 class AbstractProcessorGroup 00044 { 00045 QMap<QString, AbstractProcessor *> theProcessors; 00046 00047 friend class AbstractProcessor; 00048 void add(AbstractProcessor *o); 00049 void remove(AbstractProcessor *o); 00050 00051 public: 00063 void init() const; 00064 00074 const bool go(const bool waitUntilGoing = true) const; 00075 00087 const Processor::ErrorType waitUntilGoing(AbstractProcessor **errorProc = 0, int *errorData = 0) const; 00088 00097 void stop(const bool resetToo = true) const; 00098 00106 void reset() const; 00107 00112 void disconnectAll(); 00113 00117 void deleteAll(); 00118 00126 const bool exists(const QString &name); 00127 00139 AbstractProcessor &get(const QString &name); 00140 00152 AbstractDomProcessor &dom(const QString &name); 00153 00162 AbstractProcessor &operator[](const QString &name) { return get(name); } 00163 00167 AbstractProcessorGroup(); 00168 00172 ~AbstractProcessorGroup(); 00173 }; 00174 00175 }; 00176 00177 #endif