|
libGDF
|
00001 // 00002 // This file is part of libGDF. 00003 // 00004 // libGDF is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU Lesser General Public License as 00006 // published by the Free Software Foundation, either version 3 of 00007 // the License, or (at your option) any later version. 00008 // 00009 // libGDF is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU Lesser General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU Lesser General Public License 00015 // along with libGDF. If not, see <http://www.gnu.org/licenses/>. 00016 // 00017 // Copyright 2010 Martin Billinger 00018 00019 #ifndef __CHANNELDATABASE_H_INCLUDED 00020 #define __CHANNELDATABASE_H_INCLUDED 00021 00022 #include "Types.h" 00023 #include "Exceptions.h" 00024 #include <stddef.h> 00025 00026 namespace gdf 00027 { 00028 00030 00034 class ChannelDataBase 00035 { 00036 public: 00037 ChannelDataBase( ) { } 00038 virtual ~ChannelDataBase( ) { } 00039 00040 virtual void addSample( const int8 ) { throw exception::bad_type_assigned_to_channel( ); } 00041 virtual void addSample( const uint8 ) { throw exception::bad_type_assigned_to_channel( ); } 00042 virtual void addSample( const int16 ) { throw exception::bad_type_assigned_to_channel( ); } 00043 virtual void addSample( const uint16 ) { throw exception::bad_type_assigned_to_channel( ); } 00044 virtual void addSample( const int32 ) { throw exception::bad_type_assigned_to_channel( ); } 00045 virtual void addSample( const uint32 ) { throw exception::bad_type_assigned_to_channel( ); } 00046 virtual void addSample( const int64 ) { throw exception::bad_type_assigned_to_channel( ); } 00047 virtual void addSample( const uint64 ) { throw exception::bad_type_assigned_to_channel( ); } 00048 virtual void addSample( const float32 ) { throw exception::bad_type_assigned_to_channel( ); } 00049 virtual void addSample( const float64 ) { throw exception::bad_type_assigned_to_channel( ); } 00050 00051 virtual void blitSamples( const int8*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00052 virtual void blitSamples( const uint8*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00053 virtual void blitSamples( const int16*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00054 virtual void blitSamples( const uint16*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00055 virtual void blitSamples( const int32*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00056 virtual void blitSamples( const uint32*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00057 virtual void blitSamples( const int64*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00058 virtual void blitSamples( const uint64*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00059 virtual void blitSamples( const float32*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00060 virtual void blitSamples( const float64*, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00061 00062 virtual void fill( const int8, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00063 virtual void fill( const uint8, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00064 virtual void fill( const int16, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00065 virtual void fill( const uint16, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00066 virtual void fill( const int32, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00067 virtual void fill( const uint32, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00068 virtual void fill( const int64, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00069 virtual void fill( const uint64, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00070 virtual void fill( const float32, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00071 virtual void fill( const float64, const size_t ) { throw exception::bad_type_assigned_to_channel( ); } 00072 00073 virtual void setSample( size_t, int8 ) { throw exception::bad_type_assigned_to_channel( ); } 00074 virtual void setSample( size_t, uint8 ) { throw exception::bad_type_assigned_to_channel( ); } 00075 virtual void setSample( size_t, int16 ) { throw exception::bad_type_assigned_to_channel( ); } 00076 virtual void setSample( size_t, uint16 ) { throw exception::bad_type_assigned_to_channel( ); } 00077 virtual void setSample( size_t, int32 ) { throw exception::bad_type_assigned_to_channel( ); } 00078 virtual void setSample( size_t, uint32 ) { throw exception::bad_type_assigned_to_channel( ); } 00079 virtual void setSample( size_t, int64 ) { throw exception::bad_type_assigned_to_channel( ); } 00080 virtual void setSample( size_t, uint64 ) { throw exception::bad_type_assigned_to_channel( ); } 00081 virtual void setSample( size_t, float32 ) { throw exception::bad_type_assigned_to_channel( ); } 00082 virtual void setSample( size_t, float64 ) { throw exception::bad_type_assigned_to_channel( ); } 00083 00084 virtual int8 getSample( size_t, int8 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00085 virtual uint8 getSample( size_t, uint8 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00086 virtual int16 getSample( size_t, int16 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00087 virtual uint16 getSample( size_t, uint16 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00088 virtual int32 getSample( size_t, int32 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00089 virtual uint32 getSample( size_t, uint32 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00090 virtual int64 getSample( size_t, int64 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00091 virtual uint64 getSample( size_t, uint64 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00092 virtual float32 getSample( size_t, float32 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00093 virtual float64 getSample( size_t, float64 /*dummy*/ ) { throw exception::bad_type_assigned_to_channel( ); } 00094 00096 virtual void clear( ) = 0; 00097 00099 virtual size_t getFree( ) = 0; 00100 00102 virtual size_t getWritten( ) = 0; 00103 00105 virtual void tostream( std::ostream &out ) = 0; 00106 00108 virtual void fromstream( std::istream &in ) = 0; 00109 }; 00110 00111 } 00112 00113 #endif