Logo Search packages:      
Sourcecode: libgdf version File versions  Download package

Public Member Functions | Private Member Functions | Private Attributes

gdf::Modifier Class Reference

Class for reading, modifying and saving changes to GDF files. More...

#include <Modifier.h>

Inheritance diagram for gdf::Modifier:
Inheritance graph
[legend]
Collaboration diagram for gdf::Modifier:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void close ()
 Close file.
EventHeadergetEventHeader ()
 get writable reference to event header
const EventHeadergetEventHeader_readonly ()
 get const reference to event header
double getSample (uint16 channel_idx, size_t sample_idx)
 Get a single Sample (physical units)
 Modifier ()
 Constructor.
void open (const std::string filename)
 Opens file for modification.
void saveChanges ()
 Write changes to disk.
void setSample (uint16 channel_idx, size_t sample_idx, double value)
 Set a single Sample (physical units)
virtual ~Modifier ()
 Destructor.

Private Member Functions

void enableCache (bool b)
 Enable or disable cache.
size_t findRecord (uint16 channel_idx, size_t sample_idx)
 Find Record index to which a sample belongs.
const GDFHeaderAccessgetHeaderAccess_readonly () const
 get Constant reference to header access
const MainHeadergetMainHeader_readonly () const
 get Constant reference to main header
RecordgetRecordPtr (size_t index)
 Returns a reference to Record.
void getSignal (uint16 channel_idx, double *buffer, size_t start=0, size_t end=0)
 Read a single channel from file into buffer.
const SignalHeadergetSignalHeader_readonly (size_t idx) const
 get constant reference to a signal's header
void getSignals (std::vector< std::vector< double > > &buffer, double start_time=0, double end_time=-1, std::vector< uint16 > signal_indices=std::vector< uint16 >())
 Read Signals from file into buffer (physical units)
void initCache ()
 Initialize cache to correct size.
void precacheRecords (size_t start, size_t end)
 Precache a range of Records.
void readEvents ()
void readRecord (size_t index, Record *rec)
 Read directly into Record rec.
void resetCache ()
 Reset cache to empty state.

Private Attributes

bool m_cache_enabled
std::list< size_t > m_cache_entries
size_t m_event_offset
 Where data records start in the file.
EventHeaderm_events
bool m_events_changed
std::ifstream m_file
std::string m_filename
GDFHeaderAccess m_header
std::vector< Record * > m_record_cache
std::vector< bool > m_record_changed
size_t m_record_length
Recordm_record_nocache
size_t m_record_offset
 Record length in bytes.

Detailed Description

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.

Definition at line 35 of file Modifier.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index