soma-io
5.0.5
|
This class allows to manipulate "lists" of pointers to DataSource. More...
#include <soma-io/datasource/datasourcelist.h>
Public Member Functions | |
DataSourceList () | |
Default constructor : Builds a map containing only ( "default" , empty pointer ) More... | |
DataSourceList (const carto::rc_ptr< DataSource > &ds, const std::string &type="default") | |
Constructor : builds a 1-element map This allows to construct easily a 1 element list, useful when declaring a Reader which creator takes a source as parameter. More... | |
DataSourceList (const DataSourceList &) | |
Copy constructor. More... | |
DataSourceList & | operator= (const DataSourceList &) |
virtual | ~DataSourceList () |
bool | operator== (const DataSourceList &) const |
bool | operator!= (const DataSourceList &) const |
bool | empty () const |
Returns true only if no keyword inserted. More... | |
std::set< std::string > | types () const |
Returns existing keywords. More... | |
int | typecount () const |
bool | exists (const std::string &) const |
bool | empty (const std::string &) const |
int | size (const std::string &) const |
const carto::rc_ptr< DataSource > & | dataSource (const std::string &s="default", int i=0) const |
Accessing an element of the list If keyword doesn't exist, or is empty, or coordinate is undefined, launches exception. More... | |
carto::rc_ptr< DataSource > & | dataSource (const std::string &s="default", int i=0) |
Accessing an element of the list If keyword doesn't exist, or is empty, or coordinate is undefined, launches exception. More... | |
void | addDataSource (const std::string &, const carto::rc_ptr< DataSource > &) |
Adds an element to the dictionary If new keyword, creates it. More... | |
void | reset () |
sets the list and keywords empty. More... | |
Protected Attributes | |
std::map< std::string, std::vector< carto::rc_ptr< DataSource > > > | _dslist |
This class allows to manipulate "lists" of pointers to DataSource.
It has the design of a dictionary in order to sort sources by content (header, minf, data, ...). Since those contents depend on the format, the keywords used are defined by specific checkers and readers.
The only global keyword is "default"
which is used to store the DataSource defining (at construction) a reader.
"default"
keyword always contains at least one entry, which may be empty. I haven't for now found any use to several "default" entries.Access to a source is done using dataSource(...) methods. Sources are ordered by increasing order of insertion and numbering starts at 0.
Definition at line 69 of file datasourcelist.h.
soma::DataSourceList::DataSourceList | ( | ) |
Default constructor : Builds a map containing only ( "default"
, empty pointer )
soma::DataSourceList::DataSourceList | ( | const carto::rc_ptr< DataSource > & | ds, |
const std::string & | type = "default" |
||
) |
soma::DataSourceList::DataSourceList | ( | const DataSourceList & | ) |
Copy constructor.
|
virtual |
void soma::DataSourceList::addDataSource | ( | const std::string & | , |
const carto::rc_ptr< DataSource > & | |||
) |
Adds an element to the dictionary If new keyword, creates it.
const carto::rc_ptr<DataSource>& soma::DataSourceList::dataSource | ( | const std::string & | s = "default" , |
int | i = 0 |
||
) | const |
Accessing an element of the list If keyword doesn't exist, or is empty, or coordinate is undefined, launches exception.
Numbering starts at 0
Referenced by soma::ImageReader< T >::read(), soma::DataSourceInfo::url(), soma::ImageWriter< T >::write(), and soma::ImageWriter< T >::writeHeader().
carto::rc_ptr<DataSource>& soma::DataSourceList::dataSource | ( | const std::string & | s = "default" , |
int | i = 0 |
||
) |
Accessing an element of the list If keyword doesn't exist, or is empty, or coordinate is undefined, launches exception.
Numbering starts at 0
bool soma::DataSourceList::empty | ( | ) | const |
Returns true only if no keyword inserted.
Referenced by soma::Reader< T >::read().
bool soma::DataSourceList::empty | ( | const std::string & | ) | const |
bool soma::DataSourceList::exists | ( | const std::string & | ) | const |
bool soma::DataSourceList::operator!= | ( | const DataSourceList & | ) | const |
DataSourceList& soma::DataSourceList::operator= | ( | const DataSourceList & | ) |
bool soma::DataSourceList::operator== | ( | const DataSourceList & | ) | const |
void soma::DataSourceList::reset | ( | ) |
sets the list and keywords empty.
int soma::DataSourceList::size | ( | const std::string & | ) | const |
int soma::DataSourceList::typecount | ( | ) | const |
std::set<std::string> soma::DataSourceList::types | ( | ) | const |
Returns existing keywords.
|
protected |
Definition at line 127 of file datasourcelist.h.