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

Diff of /linuxsampler/trunk/src/engines/common/SignalUnitRack.h

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

revision 2218 by iliev, Thu Jul 28 08:05:57 2011 UTC revision 2224 by iliev, Mon Aug 1 19:08:09 2011 UTC
# Line 30  Line 30 
30    
31  namespace LinuxSampler {  namespace LinuxSampler {
32            
     template<typename T>  
     class FixedArray {  
         public:  
             FixedArray(int capacity) {  
                 iSize = 0;  
                 iCapacity = capacity;  
                 pData = new T[iCapacity];  
             }  
               
             ~FixedArray() {  
                 delete pData;  
                 pData = NULL;  
             }  
               
             inline int size() { return iSize; }  
             inline int capacity() { return iCapacity; }  
               
             void add(T element) {  
                 if (iSize >= iCapacity) throw Exception("Array out of bounds");  
                 pData[iSize++] = element;  
             }  
               
               
             T increment() {  
                 if (iSize >= iCapacity) throw Exception("Array out of bounds");  
                 return pData[iSize++];  
             }  
               
             void clear() { iSize = 0; }  
               
             inline T& operator[](int idx) {  
                 return pData[idx];  
             }  
               
         private:  
             T*   pData;  
             int  iSize;  
             int  iCapacity;  
     };  
       
33      class SignalUnitRack {      class SignalUnitRack {
34          protected:          protected:
35              uint CurrentStep; // The current time step              uint CurrentStep; // The current time step

Legend:
Removed from v.2218  
changed lines
  Added in v.2224

  ViewVC Help
Powered by ViewVC