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

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

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

revision 879 by persson, Mon Feb 6 18:07:17 2006 UTC revision 880 by schoenebeck, Tue Jun 27 22:57:37 2006 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2005 Christian Schoenebeck                              *   *   Copyright (C) 2005, 2006 Christian Schoenebeck                        *
4   *                                                                         *   *                                                                         *
5   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
6   *   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 21  Line 21 
21  #ifndef __LS_ARRAYLIST_H__  #ifndef __LS_ARRAYLIST_H__
22  #define __LS_ARRAYLIST_H__  #define __LS_ARRAYLIST_H__
23    
24  #include "LinuxSamplerException.h"  #include "Exception.h"
25    
26  namespace LinuxSampler {  namespace LinuxSampler {
27    
# Line 61  namespace LinuxSampler { Line 61  namespace LinuxSampler {
61              /**              /**
62               * Remove the given element at \a iPosition from the list.               * Remove the given element at \a iPosition from the list.
63               *               *
64               * @throws LinuxSamplerException - if \a iPosition is out of range               * @throws Exception - if \a iPosition is out of range
65               */               */
66              void remove(int iPosition) throw (LinuxSamplerException) {              void remove(int iPosition) throw (Exception) {
67                  if (iPosition < 0 || iPosition >= iSize)                  if (iPosition < 0 || iPosition >= iSize)
68                      throw LinuxSamplerException("ArrayList::remove(): index out of range");                      throw Exception("ArrayList::remove(): index out of range");
69                  if (iSize == 1) clear();                  if (iSize == 1) clear();
70                  else if (pData) {                  else if (pData) {
71                      T* pNewArray = new T[iSize - 1];                      T* pNewArray = new T[iSize - 1];
# Line 83  namespace LinuxSampler { Line 83  namespace LinuxSampler {
83              /**              /**
84               * Remove the given \a element from the list.               * Remove the given \a element from the list.
85               *               *
86               * @throws LinuxSamplerException - if \a element could not be found               * @throws Exception - if \a element could not be found
87               */               */
88              void remove(const T& element) {              void remove(const T& element) {
89                  remove(find(element));                  remove(find(element));
# Line 103  namespace LinuxSampler { Line 103  namespace LinuxSampler {
103              /**              /**
104               * Returns the index of the given \a element on the list.               * Returns the index of the given \a element on the list.
105               *               *
106               * @throws LinuxSamplerException - if \a element could not be found               * @throws Exception - if \a element could not be found
107               */               */
108              int find(const T& element) {              int find(const T& element) {
109                  for (int i = 0; i < iSize; i++)                  for (int i = 0; i < iSize; i++)
110                      if (pData[i] == element) return i;                      if (pData[i] == element) return i;
111                  throw LinuxSamplerException("ArrayList::find(): could not find given element");                  throw Exception("ArrayList::find(): could not find given element");
112              }              }
113    
114              /**              /**

Legend:
Removed from v.879  
changed lines
  Added in v.880

  ViewVC Help
Powered by ViewVC