remoteprocessor.h

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_REMOTEPROCESSOR_H
00011 #define _RGEDDEI_REMOTEPROCESSOR_H
00012 
00013 #include <qstring.h>
00014 
00015 #ifdef __GEDDEI_BUILD
00016 #include "remotesession.h"
00017 #include "processor.h"
00018 #include "processorfactory.h"
00019 #include "abstractprocessorgroup.h"
00020 #include "abstractprocessor.h"
00021 #else
00022 #include <rgeddei/remotesession.h>
00023 #include <rgeddei/abstractprocessorgroup.h>
00024 #include <rgeddei/abstractprocessor.h>
00025 #include <geddei/processor.h>
00026 #include <geddei/processorfactory.h>
00027 #endif
00028 
00029 using namespace Geddei;
00030 using namespace rGeddei;
00031 
00032 namespace rGeddei
00033 {
00034 
00035 class LocalProcessor;
00036 class LocalDomProcessor;
00037 class RemoteDomProcessor;
00038 
00051 class RemoteProcessor: virtual public AbstractProcessor
00052 {
00053  friend class RemoteSession;
00054  friend class LocalProcessor;
00055  friend class LocalDomProcessor;
00056  friend class RemoteDomProcessor;
00057  friend class AbstractProcessor;
00058 
00059  RemoteSession *theSession;
00060  QString theHandle, theType, theName;
00061  AbstractProcessorGroup *theGroup;
00062 
00069  inline bool isValid() const { return theType != ""; }
00070 
00081  RemoteProcessor(RemoteSession &session, const QString &type);
00082 
00083 protected:
00091  RemoteProcessor(RemoteSession &session);
00092 
00093  //* Reimplementations from AbstractProcessor.
00094 private:
00095  virtual void doInit(const QString &name, AbstractProcessorGroup *g, const Properties &p);
00096 public:
00097  virtual const bool go() { return theSession->processorGo(theHandle); }
00098  virtual const Processor::ErrorType waitUntilGoing(int *errorData = 0) { int ed; return (Processor::ErrorType)theSession->processorWaitUntilGoing(theHandle, errorData ? *errorData : ed); }
00099  virtual void waitUntilDone() { theSession->processorWaitUntilDone(theHandle); }
00100  virtual void stop() { theSession->processorStop(theHandle); }
00101  virtual void reset() { theSession->processorReset(theHandle); }
00102  virtual void split(const uint sourceIndex) { theSession->processorSplit(theHandle, sourceIndex); }
00103  virtual void share(const uint sourceIndex) { theSession->processorShare(theHandle, sourceIndex); }
00104  virtual const bool connect(const uint sourceIndex, const RemoteProcessor *sink, const uint sinkIndex, const uint bufferSize = 1);
00105  virtual const bool connect(const uint sourceIndex, const LocalProcessor *sink, const uint sinkIndex, const uint bufferSize = 1);
00106  virtual void disconnect(const uint sourceIndex) { theSession->processorDisconnect(theHandle, sourceIndex); }
00107  virtual void disconnectAll() { theSession->processorDisconnectAll(theHandle); }
00108  virtual const QString name() const { return theName; }
00109 
00113  virtual ~RemoteProcessor();
00114 };
00115 
00116 };
00117 
00118 #endif

Generated on Fri Nov 10 21:58:26 2006 for Exscalibar by  doxygen 1.5.1