bufferdatas.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_BUFFERDATAS_H
00011 #define _GEDDEI_BUFFERDATAS_H
00012 
00013 #ifdef __GEDDEI_BUILD
00014 #include "bufferdata.h"
00015 #else
00016 #include <geddei/bufferdata.h>
00017 #endif
00018 
00019 namespace Geddei
00020 {
00021 
00036 class BufferDatas
00037 {
00038  friend class SubProcessor;
00039  uint theCount;
00040  const BufferData **theData;
00041 
00042 public:
00057  void copyData(const uint i, const BufferData &d) { theData[i] = new BufferData(d); }
00058 
00069  void setData(const uint i, const BufferData *d) { theData[i] = d; }
00070 
00079  const BufferDatas samples(const uint index, const uint amount) const;
00080 
00089  BufferDatas samples(const uint index, const uint amount);
00090 
00099  void resize(const uint count);
00100 
00106  void nullify();
00107 
00114  const BufferData &operator[](uint i) const
00115  {
00116 #ifdef EDEBUG
00117   assert(i < theCount);
00118   assert(theData[i]);
00119 #endif
00120   return *((const BufferData *)theData[i]);
00121  }
00122 
00135  BufferData &operator[](uint i)
00136  {
00137 #ifdef EDEBUG
00138   assert(i < theCount);
00139   assert(theData[i]);
00140 #endif
00141   return *((BufferData *)theData[i]);
00142  }
00143 
00149  const uint size() const { return theCount; }
00150  
00156  const uint count() const { return theCount; }
00157 
00170  BufferDatas &operator=(const BufferDatas &src);
00171 
00182  BufferDatas(const BufferDatas &src);
00183 
00190  BufferDatas(const uint count = 0);
00191 
00195  ~BufferDatas();
00196 };
00197 
00198 };
00199 
00200 #endif

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