soma-io
5.1.2
|
Abstraction layer for various data sources (file, buffer, socket...). More...
#include <soma-io/datasource/datasource.h>
Public Types | |
enum | Mode { Read = 1 , Write = 2 , ReadWrite = 3 } |
enum | IterateMode { DirectAccess = 1 , SequentialAccess = 2 } |
Public Types inherited from carto::RCObject | |
typedef int | RefCounterType |
Public Member Functions | |
DataSource () | |
virtual | ~DataSource () |
int | mode () const |
access mode(s) (read/write): bitwise OR of Mode values More... | |
virtual DataSource * | clone () const =0 |
virtual int | iterateMode () const =0 |
possible iteration mode(s): bitwise OR of IterateMode values More... | |
virtual bool | isOpen () const =0 |
virtual bool | eof () const |
virtual bool | operator! () const |
virtual | operator bool () const |
virtual bool | open (int mode)=0 |
virtual void | close ()=0 |
virtual void | flush () |
virtual offset_t | size () const =0 |
virtual offset_t | at () const =0 |
virtual bool | at (offset_t pos)=0 |
virtual bool | atEnd () const |
bool | reset () |
virtual long | readBlock (char *data, unsigned long maxlen)=0 |
virtual long | writeBlock (const char *data, unsigned long len)=0 |
virtual int | getch ()=0 |
virtual int | putch (int ch)=0 |
virtual bool | ungetch (int ch)=0 |
virtual bool | allowsMemoryMapping () const =0 |
virtual std::string | url () const |
Public Member Functions inherited from carto::RCObject | |
RCObject () | |
RCObject (const RCObject &) | |
RCObject & | operator= (const RCObject &) |
virtual | ~RCObject () |
Static Public Member Functions | |
static const carto::rc_ptr< DataSource > | none () |
An empty ref-counter that is more convenient than calling a constructor of rc_ptr<DataSource> (useful when calling functions) More... | |
Protected Attributes | |
int | _mode |
Abstraction layer for various data sources (file, buffer, socket...).
It can be seen as a stream, and is inspired by the QIODevice of Trolltech's Qt library (http://doc.trolltech.com/3.3/qiodevice.html)
Definition at line 64 of file datasource.h.
Enumerator | |
---|---|
DirectAccess | |
SequentialAccess |
Definition at line 74 of file datasource.h.
Enumerator | |
---|---|
Read | |
Write | |
ReadWrite |
Definition at line 67 of file datasource.h.
soma::DataSource::DataSource | ( | ) |
|
virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
virtual |
|
pure virtual |
|
pure virtual |
|
virtual |
Reimplemented in soma::OStreamDataSource, soma::IStreamDataSource, and soma::StreamDataSource.
Referenced by soma::PythonReader::genericDictHelper(), and soma::PythonReader::genericSequenceHelper().
|
virtual |
|
pure virtual |
Implemented in soma::OStreamDataSource, soma::IStreamDataSource, soma::StreamDataSource, soma::FilteringDataSource, soma::FDDataSource, soma::CStreamDataSource, and soma::BufferDataSource.
Referenced by soma::PythonReader::genericDictHelper(), soma::PythonReader::genericSequenceHelper(), soma::internal::AsciiIntReadTraits< T >::read(), soma::internal::AsciiFloatReadTraits< T >::read(), soma::AsciiDataSourceTraits< AimsVector< T, D > >::read(), soma::AsciiDataSourceTraits< carto::VoxelValue< T, C > >::read(), soma::AsciiDataSourceTraits< T >::read(), and soma::DefaultAsciiItemReader< T >::read().
|
pure virtual |
Implemented in soma::OStreamDataSource, soma::IStreamDataSource, soma::StreamDataSource, soma::FDDataSource, soma::CStreamDataSource, soma::ChainDataSource, and soma::BufferDataSource.
Referenced by soma::PythonReader::genericSequenceHelper(), soma::internal::AsciiIntReadTraits< T >::read(), soma::internal::AsciiFloatReadTraits< T >::read(), soma::AsciiDataSourceTraits< carto::VoxelValue< T, C > >::read(), soma::AsciiDataSourceTraits< T >::read(), soma::DefaultAsciiItemReader< T >::read(), soma::AsciiDataSourceTraits< AimsVector< T, D > >::write(), soma::AsciiDataSourceTraits< T >::write(), and soma::DefaultAsciiItemWriter< T >::write().
|
pure virtual |
possible iteration mode(s): bitwise OR of IterateMode values
Implemented in soma::OStreamDataSource, soma::IStreamDataSource, soma::StreamDataSource, soma::FilteringDataSource, soma::FDDataSource, soma::CStreamDataSource, and soma::BufferDataSource.
int soma::DataSource::mode | ( | ) | const |
access mode(s) (read/write): bitwise OR of Mode values
|
static |
An empty ref-counter that is more convenient than calling a constructor of rc_ptr<DataSource> (useful when calling functions)
Referenced by soma::Reader< T >::dataSource().
|
pure virtual |
|
virtual |
|
virtual |
Reimplemented in soma::OStreamDataSource, soma::IStreamDataSource, and soma::StreamDataSource.
|
pure virtual |
Implemented in soma::OStreamDataSource, soma::IStreamDataSource, soma::StreamDataSource, soma::FilteringDataSource, soma::FDDataSource, soma::CStreamDataSource, and soma::BufferDataSource.
Referenced by soma::PythonWriter::genericSequenceHelper(), and soma::AsciiDataSourceTraits< AimsVector< T, D > >::write().
|
pure virtual |
bool soma::DataSource::reset | ( | ) |
|
pure virtual |
|
pure virtual |
Implemented in soma::OStreamDataSource, soma::IStreamDataSource, soma::StreamDataSource, soma::FilteringDataSource, soma::FDDataSource, soma::CStreamDataSource, and soma::BufferDataSource.
Referenced by soma::PythonReader::genericSequenceHelper(), soma::internal::AsciiIntReadTraits< T >::read(), soma::internal::AsciiFloatReadTraits< T >::read(), soma::AsciiDataSourceTraits< T >::read(), and soma::DefaultAsciiItemReader< T >::read().
|
virtual |
Reimplemented in soma::OStreamDataSource, soma::IStreamDataSource, soma::StreamDataSource, soma::FileDataSource, and soma::ChainDataSource.
Referenced by soma::PythonReader::genericDictHelper(), and soma::PythonReader::genericSequenceHelper().
|
pure virtual |
Implemented in soma::OStreamDataSource, soma::IStreamDataSource, soma::StreamDataSource, soma::FilteringDataSource, soma::FDDataSource, soma::CStreamDataSource, and soma::BufferDataSource.
Referenced by soma::AsciiDataSourceTraits< T >::write(), soma::DefaultItemWriter< T >::write(), and soma::DefaultBSwapItemWriter< T >::write().
|
protected |
Definition at line 113 of file datasource.h.