/usr/include/GDF/Modifier.h is in libgdf-dev 0.1.2-2.0build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | //
// This file is part of libGDF.
//
// libGDF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// libGDF is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with libGDF. If not, see <http://www.gnu.org/licenses/>.
//
// Copyright 2010 Martin Billinger
#ifndef __MODIFIER_H_INCLUDED__
#define __MODIFIER_H_INCLUDED__
#include "GDF/Reader.h"
#include <vector>
#include <string>
#include <fstream>
namespace gdf
{
/// Class for reading, modifying and saving changes to GDF files.
/** It is not possible to change the number of signals or their length.
When a sample is set, the entire record is marked for rewriting. If the
Event Header is retrieved using the non-const get function, it is marked
for rewriting.
*/
class Modifier : private Reader
{
public:
/// Constructor
Modifier( );
/// Destructor
virtual ~Modifier( );
/// Opens file for modification
void open( const std::string filename );
/// Close file
void close( );
/// Write changes to disk
void saveChanges( );
/// Get a single Sample (physical units)
/** @param[in] channel_idx channel index
@param[in] sample_idx sample index
*/
double getSample( uint16 channel_idx, size_t sample_idx );
/// Set a single Sample (physical units)
/** @param[in] channel_idx channel index
@param[in] sample_idx sample index
@param[in] value
*/
void setSample( uint16 channel_idx, size_t sample_idx, double value );
/// get writable reference to event header
EventHeader *getEventHeader( );
/// get const reference to event header
const EventHeader *getEventHeader_readonly( );
private:
/// Initialize cache to correct size
void initCache( );
/// Reset cache to empty state
void resetCache( );
std::vector< bool > m_record_changed;
bool m_events_changed;
};
}
#endif // __READER_H_INCLUDED__
|