mlconnection.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 _GEDDEI_MLCONNECTION_H
00011 #define _GEDDEI_MLCONNECTION_H
00012 
00013 #ifdef __GEDDEI_BUILD
00014 #include "buffer.h"
00015 #include "xlconnection.h"
00016 #else
00017 #include <geddei/buffer.h>
00018 #include <geddei/xlconnection.h>
00019 #endif
00020 using namespace Geddei;
00021 
00022 namespace Geddei
00023 {
00024 
00025 class LMConnection;
00026 class BufferReader;
00027 class Processor;
00028 
00036 class MLConnection: public xLConnection
00037 {
00038  //* Reimplementations from Connection
00039  virtual const SignalTypeRef type();
00040 
00041  //* Reimplementations from xLConnection
00042  virtual void reset();
00043  virtual void sinkStopping();
00044  virtual void sinkStopped();
00045  virtual const uint elementsReady() const;
00046  virtual void waitForElements(const uint elements) const;
00047  virtual const BufferData readElements(const uint elements);
00048  virtual const BufferData peekElements(const uint elements);
00049  virtual void enforceMinimum(const uint elements);
00050  virtual BufferReader *newReader();
00051  virtual void killReader();
00052  virtual void resurectReader();
00053  virtual const bool plungeSync(const uint samples) const;
00054  virtual const uint capacity() const;
00055 
00056 protected:
00057  LMConnection *theConnection;
00058  BufferReader *theReader;
00059 
00060 public:
00064  const bool waitUntilReady();
00065 
00070  void resetType();
00071 
00075  void setType(const SignalType *type);
00076  
00081  void startPlungers();
00082  
00088  void plungerSent();
00089  
00094  void noMorePlungers();
00095  
00096  MLConnection(Sink *sink, const uint sinkIndex, LMConnection *connection);
00097  virtual ~MLConnection();
00098 };
00099 
00100 };
00101 
00102 #endif

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