lmconnection.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 
00011 #ifndef _GEDDEI_LMCONNECTION_H
00012 #define _GEDDEI_LMCONNECTION_H
00013 
00014 #include <qptrlist.h>
00015 
00016 #ifdef __GEDDEI_BUILD
00017 #include "buffer.h"
00018 #include "lxconnectionreal.h"
00019 #else
00020 #include <geddei/buffer.h>
00021 #include <geddei/lxconnectionreal.h>
00022 #endif
00023 using namespace Geddei;
00024 
00025 namespace Geddei
00026 {
00027 
00028 class Processor;
00029 class MLConnection;
00030 
00038 class LMConnection: public LxConnectionReal
00039 {
00040  friend class MLConnection;
00041  friend class Processor;
00042  
00043  //* Reimplementations from Connection
00044  virtual const SignalTypeRef type();
00045 
00046  //* Reimplementations from LxConnection
00047  virtual const bool waitUntilReady();
00048  virtual void setType(const SignalType *type);
00049  virtual void resetType();
00050  virtual void sourceStopping();
00051  virtual void sourceStopped();
00052  virtual void reset();
00053  virtual BufferData makeScratchElements(const uint elements, bool autoPush = false);
00054  virtual void pushPlunger();
00055  virtual void startPlungers();
00056  virtual void plungerSent();
00057  virtual void noMorePlungers();
00058  virtual const uint maximumScratchElements(const uint minimum = 1);
00059  virtual const uint maximumScratchElementsEver();
00060  virtual void enforceMinimum(const uint elements);
00061  
00062  //* Reimplementations from LxConnectionReal
00063  virtual void bufferWaitForFree();
00064  virtual const uint bufferElementsFree();
00065  virtual void transport(const BufferData &data);
00066 
00076  void openBufferTrapdoor(Processor *sink) { theBuffer.openTrapdoor(sink); }
00077  
00087  void closeBufferTrapdoor(Processor *sink) { theBuffer.closeTrapdoor(sink); }
00088 
00097  LMConnection(Source *source, const uint sourceIndex, const uint bufferSize);
00098 
00102  ~LMConnection();
00103 
00104 protected:
00105  QPtrList<MLConnection> theConnections;
00106  Buffer theBuffer;
00107 };
00108 
00109 };
00110 
00111 #endif

Generated on Thu Jul 13 06:56:33 2006 for Exscalibar by  doxygen 1.4.7