| soma-io
    5.1.2
    | 
Low-level "small item" reader, used by higher-level file readers. More...
#include <soma-io/reader/itemreader.h>

| Public Member Functions | |
| virtual | ~ItemReader () | 
| virtual ItemReader< T > * | reader (bool binary=true, bool bswap=false) const =0 | 
| Factory function.  More... | |
| virtual long | read (DataSource &ds, T *pitem, size_t n=1) const =0 | 
| Reading on an arbitrary DataSource.  More... | |
Low-level "small item" reader, used by higher-level file readers.
It can read either a single item, or an array of them. This template class is inherited by specific item readers, esp. by the DefaultItemReader classes.
Usage: you generally have to allocate two readers: one as a factory to use the correct item variant, and another one to switch on the reading-mode specific ItemReader:
Definition at line 84 of file itemreader.h.
| 
 | inlinevirtual | 
Definition at line 87 of file itemreader.h.
| 
 | pure virtual | 
Reading on an arbitrary DataSource.
| ds | source of data (file, buffer, socket...) | 
| pitem | buffer to fill with read values | 
| n | number of elements to read | 
Implemented in soma::DefaultBSwapItemReader< T >, soma::DefaultAsciiItemReader< T >, and soma::DefaultItemReader< T >.
| 
 | pure virtual | 
Factory function.
Implemented in soma::DefaultItemReader< T >, soma::DefaultItemReader< T >, and soma::DefaultItemReader< T >.