/[svn]/linuxsampler/trunk/src/common/Pool.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/common/Pool.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1800 by schoenebeck, Sun Dec 7 01:26:46 2008 UTC revision 2335 by persson, Sat Mar 17 06:19:01 2012 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2012 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 381  class RTList : public RTListBase<T> { Line 381  class RTList : public RTListBase<T> {
381          RTList(Pool<T>* pPool) : RTListBase<T>::RTListBase() {          RTList(Pool<T>* pPool) : RTListBase<T>::RTListBase() {
382              this->pPool = pPool;              this->pPool = pPool;
383          }          }
384            
385            /**
386             * Copy constructor
387             */
388            RTList(RTList<T>& list) : RTListBase<T>::RTListBase() {
389                this->pPool = list.pPool;
390                Iterator it = list.first();
391                Iterator end = list.end();
392                for(; it != end; ++it) {
393                    if (poolIsEmpty()) break;
394                    *(allocAppend()) = *it;
395                }
396            }
397    
398          virtual ~RTList() {          virtual ~RTList() {
399              clear();              clear();
# Line 393  class RTList : public RTListBase<T> { Line 406  class RTList : public RTListBase<T> {
406          inline Iterator allocAppend() {          inline Iterator allocAppend() {
407              if (pPool->poolIsEmpty()) return RTListBase<T>::begin();              if (pPool->poolIsEmpty()) return RTListBase<T>::begin();
408              Iterator element = pPool->alloc();              Iterator element = pPool->alloc();
409              append(element);              this->append(element);
410              #if CONFIG_DEVMODE              #if CONFIG_DEVMODE
411              element.list = this;              element.list = this;
412              #endif // CONFIG_DEVMODE              #endif // CONFIG_DEVMODE

Legend:
Removed from v.1800  
changed lines
  Added in v.2335

  ViewVC Help
Powered by ViewVC