libGDF
Modifier.h
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 __MODIFIER_H_INCLUDED__
00020 #define __MODIFIER_H_INCLUDED__
00021 
00022 #include "GDF/Reader.h"
00023 #include <vector>
00024 #include <string>
00025 #include <fstream>
00026 
00027 namespace gdf
00028 {
00030 
00035     class Modifier : private Reader
00036     {
00037     public:
00039         Modifier( );
00040 
00042         virtual ~Modifier( );
00043 
00045         void open( const std::string filename );
00046 
00048         void close( );
00049 
00051         void saveChanges( );
00052 
00054 
00057         double getSample( uint16 channel_idx, size_t sample_idx );
00058 
00060 
00064         void setSample( uint16 channel_idx, size_t sample_idx, double value );
00065 
00067         EventHeader *getEventHeader( );
00068 
00070         const EventHeader *getEventHeader_readonly( );
00071 
00072     private:
00073 
00075         void initCache( );
00076 
00078         void resetCache( );
00079 
00080         std::vector< bool > m_record_changed;
00081         bool m_events_changed;
00082     };
00083 }
00084 
00085 #endif // __READER_H_INCLUDED__
 All Data Structures Functions Variables Friends