Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver. More...
#include <DataSource.h>
Public Member Functions | |
void | add (const std::string &datasetName, te::da::DataSet *d, const std::map< std::string, std::string > &options, std::size_t limit) |
It adds data items to the dataset in the data source. More... | |
void | addProperty (const std::string &datasetName, te::dt::Property *p) |
It adds a new property to the dataset schema. More... | |
void | cloneDataSet (const std::string &name, const std::string &cloneName, const std::map< std::string, std::string > &options) |
It clones the dataset in the data source. More... | |
void | close () |
It closes the data source and clears all the resources used by its internal communication channel. More... | |
void | createDataSet (te::da::DataSetType *dt, const std::map< std::string, std::string > &options) |
It creates the dataset schema definition in the target data source. More... | |
bool | dataSetExists (const std::string &name) |
It checks if a dataset with the given name exists in the data source. More... | |
DataSource (const std::string &connInfo) | |
DataSource (const te::core::URI &uri) | |
void | dropDataSet (const std::string &name) |
It removes the dataset schema from the data source. More... | |
void | dropProperty (const std::string &datasetName, const std::string &propertyName) |
It removes a property from the given dataset. More... | |
const te::da::DataSourceCapabilities & | getCapabilities () const |
It returns the known capabilities of the data source. More... | |
const te::core::URI & | getConnectionInfo () const |
An Uniform Resource Identifier used to describe the datasource connection. More... | |
std::auto_ptr< te::da::DataSet > | getDataSet (const std::string &name, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) |
It gets the dataset identified by the given name. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released. More... | |
std::vector< std::string > | getDataSetNames () |
It gets the dataset names available in the data source. More... | |
const std::map< std::string, te::da::DataSetPtr > & | getDataSets () const |
It returns a map relating the dataset names and their contents. More... | |
std::auto_ptr< te::da::DataSetType > | getDataSetType (const std::string &datasetName) |
It gets information about the given dataset. More... | |
const te::da::SQLDialect * | getDialect () const |
It returns the data source SQL dialect, if there is one. More... | |
const std::string & | getId () const |
An identification value for the data source. More... | |
std::size_t | getNumberOfDataSets () |
It retrieves the number of data sets available in the data source. More... | |
std::size_t | getNumberOfItems (const std::string &datasetName) |
It retrieves the number of items of the given dataset. More... | |
std::size_t | getNumberOfProperties (const std::string &datasetName) |
It gets the number of properties of the given dataset. More... | |
boost::ptr_vector< te::dt::Property > | getProperties (const std::string &datasetName) |
It retrieves the properties of the dataset. More... | |
std::auto_ptr< te::dt::Property > | getProperty (const std::string &datasetName, const std::string &name) |
It retrieves the property with the given name from the dataset. More... | |
std::auto_ptr< te::dt::Property > | getProperty (const std::string &datasetName, std::size_t propertyPos) |
It retrieves the property lying in the given position from the dataset. More... | |
std::vector< std::string > | getPropertyNames (const std::string &datasetName) |
It gets the property names of the given dataset. More... | |
const std::map< std::string, te::da::DataSetTypePtr > | getSchemas () const |
It returns a map relating the dataset names and their schemas. More... | |
std::auto_ptr< te::da::DataSourceTransactor > | getTransactor () |
It returns the set of parameters used to set up the access channel to the underlying repository. More... | |
std::string | getType () const |
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL. More... | |
bool | hasDataSets () |
It checks if the data source has any dataset. More... | |
bool | isOpened () const |
It returns true if the data source is opened, otherwise it returns false. More... | |
bool | isValid () const |
It checks if the data source is valid (available for using). More... | |
void | open () |
It opens the data source and makes it ready for using. More... | |
bool | propertyExists (const std::string &datasetName, const std::string &name) |
It checks if a property with the given name exists in the dataset. More... | |
void | remove (const std::string &datasetName, const te::da::ObjectIdSet *oids) |
It removes all the informed items from the dataset. More... | |
void | renameDataSet (const std::string &name, const std::string &newName) |
It renames a dataset. More... | |
void | renameProperty (const std::string &datasetName, const std::string &name, const std::string &newName) |
It renames a property of the given dataset. More... | |
void | setId (const std::string &id) |
It sets the data source identification. More... | |
void | update (const std::string &datasetName, te::da::DataSet *dataset, const std::vector< std::size_t > &properties, const te::da::ObjectIdSet *oids, const std::map< std::string, std::string > &options, std::size_t limit=0) |
It updates the contents of a dataset for the set of data items. More... | |
~DataSource () | |
Virtual destructor. More... | |
Dataset Metadata Retrieval | |
Methods for retrieving metadata about the datasets of the data source. | |
std::auto_ptr< te::da::DataSetTypeCapabilities > | getCapabilities (const std::string &name) |
It gets capabilities about a data set. More... | |
virtual void | changePropertyDefinition (const std::string &datasetName, const std::string &propName, te::dt::Property *newProp) |
virtual void | changePropertiesDefinitions (const std::string &datasetName, const std::vector< std::string > &propsNames, const std::vector< te::dt::Property * > newProps) |
virtual std::auto_ptr< te::da::PrimaryKey > | getPrimaryKey (const std::string &datasetName) |
It retrieves the primary key of the dataset. More... | |
virtual bool | primaryKeyExists (const std::string &datasetName, const std::string &name) |
It checks if a primary key exists in the dataset. More... | |
virtual void | addPrimaryKey (const std::string &datasetName, PrimaryKey *pk) |
It adds a primary key constraint to the dataset schema. More... | |
virtual void | dropPrimaryKey (const std::string &datasetName) |
It removes the primary key constraint from the dataset schema. More... | |
virtual std::auto_ptr< ForeignKey > | getForeignKey (const std::string &datasetName, const std::string &name) |
It retrieves the foreign key from the given dataset. More... | |
virtual std::vector< std::string > | getForeignKeyNames (const std::string &datasetName) |
It gets the foreign key names of the given dataset. More... | |
virtual bool | foreignKeyExists (const std::string &datasetName, const std::string &name) |
It checks if a foreign key with the given name exists in the data source. More... | |
virtual void | addForeignKey (const std::string &datasetName, ForeignKey *fk) |
It adds a foreign key constraint to a dataset. More... | |
virtual void | dropForeignKey (const std::string &datasetName, const std::string &fkName) |
It removes the foreign key constraint from the dataset schema. More... | |
virtual std::auto_ptr< te::da::UniqueKey > | getUniqueKey (const std::string &datasetName, const std::string &name) |
It gets the unique key in the dataset with the given name. More... | |
virtual std::vector< std::string > | getUniqueKeyNames (const std::string &datasetName) |
It gets the unique key names of the given dataset. More... | |
virtual bool | uniqueKeyExists (const std::string &datasetName, const std::string &name) |
It checks if a unique key with the given name exists in the dataset. More... | |
virtual void | addUniqueKey (const std::string &datasetName, UniqueKey *uk) |
It adds a unique key constraint to the dataset. More... | |
virtual void | dropUniqueKey (const std::string &datasetName, const std::string &name) |
It removes the unique key constraint from the dataset. More... | |
virtual std::auto_ptr< te::da::CheckConstraint > | getCheckConstraint (const std::string &datasetName, const std::string &name) |
It gets the check constraint of the dataset with the given name. More... | |
virtual std::vector< std::string > | getCheckConstraintNames (const std::string &datasetName) |
It gets the check constraint names of the given dataset. More... | |
virtual bool | checkConstraintExists (const std::string &datasetName, const std::string &name) |
It checks if a check-constraint with the given name exists in the data source. More... | |
virtual void | addCheckConstraint (const std::string &datasetName, CheckConstraint *cc) |
It adds a check constraint to the dataset. More... | |
virtual void | dropCheckConstraint (const std::string &datasetName, const std::string &name) |
It removes the check constraint from the dataset. More... | |
virtual std::auto_ptr< te::da::Index > | getIndex (const std::string &datasetName, const std::string &name) |
It gets the index with the given name from the dataset. More... | |
virtual std::vector< std::string > | getIndexNames (const std::string &datasetName) |
It gets the index names of the given dataset. More... | |
virtual bool | indexExists (const std::string &datasetName, const std::string &name) |
It checks if an index with the given name exists in the dataset. More... | |
virtual void | addIndex (const std::string &datasetName, Index *idx, const std::map< std::string, std::string > &options) |
It adds an index to the dataset. More... | |
virtual void | dropIndex (const std::string &datasetName, const std::string &idxName) |
It removes the index from the given dataset. More... | |
virtual std::auto_ptr< Sequence > | getSequence (const std::string &name) |
It gets the sequence with the given name in the data source. More... | |
virtual std::vector< std::string > | getSequenceNames () |
It gets the sequence names available in the data source. More... | |
virtual bool | sequenceExists (const std::string &name) |
It checks if a sequence with the given name exists in the data source. More... | |
virtual void | addSequence (Sequence *sequence) |
It adds a new sequence in the data source. More... | |
virtual void | dropSequence (const std::string &name) |
It removes the sequence from the data source. More... | |
virtual std::auto_ptr< te::gm::Envelope > | getExtent (const std::string &datasetName, const std::string &propertyName) |
It retrieves the bounding rectangle of the spatial property for the given dataset. More... | |
virtual std::auto_ptr< te::gm::Envelope > | getExtent (const std::string &datasetName, std::size_t propertyPos) |
It retrieves the bounding rectangle for the spatial property lying in the given position in the dataset. More... | |
Data Retrieval | |
Methods for retrieving data from the data source. | |
virtual std::auto_ptr< DataSet > | getDataSet (const std::string &name, const std::string &propertyName, const te::gm::Envelope *e, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) |
It gets the dataset identified by the given name using a spatial filter over the specified property. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released. More... | |
virtual std::auto_ptr< DataSet > | getDataSet (const std::string &name, const std::string &propertyName, const te::gm::Geometry *g, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) |
It gets the dataset identified by the given name using a spatial filter over the given geometric property. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released. More... | |
std::auto_ptr< te::da::DataSet > | getDataSet (const std::string &name, const te::da::ObjectIdSet *oids, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) |
It gets the dataset identified by the given name using the identification of the objects. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released. More... | |
virtual std::auto_ptr< DataSet > | query (const Select &q, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) |
It executes a query that may return some data using a generic query. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released. More... | |
virtual std::auto_ptr< DataSet > | query (const std::string &query, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) |
It executes a query that may return some data using the data source native language. This method always returns a disconnected dataset, that is, a dataset that is no more dependent of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released. More... | |
Command Execution Methods | |
Methods for executing commands against the data source. | |
virtual void | execute (const Query &command) |
It executes the specified command using a generic query representation. More... | |
virtual void | execute (const std::string &command) |
It executes the specified command in the data source native language. More... | |
Auxiliary Methods for Commands and Queries | |
Auxiliary methods for commands and queries. | |
virtual std::string | escape (const std::string &value) |
It escapes a string for using in commands and queries. More... | |
virtual bool | isDataSetNameValid (const std::string &datasetName) |
It checks if the given dataset name is valid. More... | |
virtual bool | isPropertyNameValid (const std::string &propertyName) |
It checks if the given property name is valid. More... | |
Dataset Persistence Methods | |
Methods for dealing with the persistence of data in a data source. | |
virtual void | update (const std::string &datasetName, DataSet *dataset, const std::vector< std::set< int > > &properties, const std::vector< size_t > &ids) |
It updates the contents of a dataset. More... | |
virtual te::core::EncodingType | getEncoding () |
It return the DataSource current encoding. More... | |
virtual void | setEncoding (const te::core::EncodingType &et) |
It sets the encodings for the data source. More... | |
Static Public Member Functions | |
static void | setCapabilities (const te::da::DataSourceCapabilities &capabilities) |
It sets the capabilities document. More... | |
Data Source static methods | |
Data Source static methods | |
static std::unique_ptr< DataSource > | create (const std::string &dsType, const std::string &connInfo) |
It creates a new repository for a data source. More... | |
static void | drop (const std::string &dsType, const std::string &connInfo) |
It removes a data source identified by its connection information and the driver type. More... | |
static bool | exists (const std::string &dsType, const std::string &connInfo) |
It checks if the data source exists with the connection information and the driver type. More... | |
static std::vector< std::string > | getDataSourceNames (const std::string &dsType, const std::string &connInfo) |
It returns the data source names available in the driver. More... | |
Protected Member Functions | |
void | create (const std::string &connInfo) |
It creates a new data source. More... | |
void | drop (const std::string &connInfo) |
It removes the data source with the connection information from a driver. More... | |
bool | exists (const std::string &connInfo) |
Check the existence of a data source in a driver. More... | |
std::vector< std::string > | getDataSourceNames (const std::string &connInfo) |
It gets the data source names available in a driver. More... | |
Protected Attributes | |
std::string | m_id |
The data source identification. More... | |
te::core::URI | m_uri |
The URI used to describe the datasource connection;. More... | |
Private Attributes | |
std::map< std::string, te::da::DataSetPtr > | m_datasets |
The set of datasets stored in memory. More... | |
bool | m_deepCopy |
If true, each dataset is cloned in the getDataSet method. More... | |
bool | m_isOpened |
A flag to control the state of the data source. More... | |
std::size_t | m_maxNumDatasets |
The maximum number of datasets to be handled by the data source. More... | |
boost::recursive_mutex | m_mtx |
The internal mutex. More... | |
std::size_t | m_numDatasets |
The number of datasets kept in the data source. More... | |
std::map< std::string, te::da::DataSetTypePtr > | m_schemas |
The set of dataset schemas. More... | |
Static Private Attributes | |
static te::da::DataSourceCapabilities | sm_capabilities |
The Memory data source capabilities. More... | |
static const te::da::SQLDialect | sm_dialect |
A dummy dialect. More... | |
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver.
Definition at line 52 of file DataSource.h.
te::mem::DataSource::DataSource | ( | const std::string & | connInfo | ) |
te::mem::DataSource::DataSource | ( | const te::core::URI & | uri | ) |
|
virtual |
Virtual destructor.
Reimplemented from te::da::DataSource.
|
virtual |
It adds data items to the dataset in the data source.
datasetName | The target dataset name. |
d | The data items to be added to the dataset. |
options | A list of optional modifiers (driver specific). |
limit | The number of items to be used from the input dataset. If set to 0 (default), all items are used. |
Exception | An exception can be thrown, if the input dataset items could not be added to the given dataset. |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It adds a check constraint to the dataset.
datasetName | The dataset where the constraint will be added. |
cc | The check constraint to be added. |
Exception | An exception can be thrown, if the check constraint could not be added to the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It adds a foreign key constraint to a dataset.
datasetName | The dataset where the foreign key constraint will be added. |
fk | The foreign key constraint. |
Exception | An exception can be thrown, if the foreign key could not be added to the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It adds an index to the dataset.
datasetName | The dataset where the index will be added. |
idx | The index to be added. |
options | A list of optional modifiers (driver specific). |
Exception | An exception can be thrown, if the index could not be added to the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It adds a primary key constraint to the dataset schema.
datasetName | The name of the dataset where the primary key will be added. |
pk | The primary key constraint. |
Exception | An exception can be thrown, if the primary key could not be added to the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It adds a new property to the dataset schema.
datasetName | The dataset where the property will be added. |
p | The new property to be added. |
Exception | An exception can be thrown, if the property could not be added to the dataset schema. |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It adds a new sequence in the data source.
Exception | An exception can be thrown, if the sequence could not be added to the data source. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It adds a unique key constraint to the dataset.
datasetName | The dataset where the unique key will be added. |
uk | The unique key constraint. |
Exception | An exception can be thrown, if the unique key could not be added to the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
It checks if a check-constraint with the given name exists in the data source.
datasetName | The dataset name. |
name | The check-constraint name. |
Exception | An exception can be thrown, if the existence of the check constraint could not be determined. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It clones the dataset in the data source.
name | The dataset to be cloned. |
cloneName | The name of the cloned dataset. |
options | A list of optional modifiers. It is driver specific. |
Exception | An exception can be thrown, if the dataset schema could not be cloned. |
Reimplemented from te::da::DataSource.
|
virtual |
It closes the data source and clears all the resources used by its internal communication channel.
This method closes any connection, any opened file, and releases any other resources.
Exception | An exception can be thrown, if the data source cannot be closed. |
Implements te::da::DataSource.
|
protectedvirtual |
It creates a new data source.
connInfo | The information for creating a new data source. |
Exception | An exception can be thrown, if the data source could not be created. |
Implements te::da::DataSource.
|
staticinherited |
It creates a new repository for a data source.
dsType | The type of data source to be created (example: POSTGIS, ORACLE, SQLITE). |
connInfo | The information for creating a new data source. |
Exception | An exception can be thrown, if the data source could not be created. |
|
virtual |
It creates the dataset schema definition in the target data source.
If a dataset schema with the same name already exists in the target data source, this may throw an exception.
After calling this method, the dataset schema may be updated.
dt | The dataset schema to be created. It may be changed during the operation. |
options | A list of optional modifiers (driver specific). |
Reimplemented from te::da::DataSource.
|
virtual |
It checks if a dataset with the given name exists in the data source.
name | The dataset name. |
Exception | An exception can be thrown, if the existence of a dataset in the data source could not be determined. |
Reimplemented from te::da::DataSource.
|
protectedvirtual |
It removes the data source with the connection information from a driver.
connInfo | The information for removing a data source from a driver. |
Exception | An exception can be thrown, if the data source could not be removed. |
Implements te::da::DataSource.
|
staticinherited |
It removes a data source identified by its connection information and the driver type.
dsType | The data source type name (example: POSTGIS, ORACLE, SQLITE). |
dsInfo | The connection information for removing the data source. |
Exception | An exception can be thrown, if the data source could not be removed. |
|
virtualinherited |
It removes the check constraint from the dataset.
datasetName | The dataset from where the check constraint will be removed. |
name | The check constraint to be removed. |
Exception | An exception can be thrown, if the check constraint could not be removed from the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It removes the dataset schema from the data source.
name | The dataset name whose schema will be removed from the data source. |
Exception | An exception can be thrown, if the dataset could not be removed from the data source. |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It removes the foreign key constraint from the dataset schema.
datasetName | The dataset where the foreign key will be removed. |
fkName | The foreign key to be removed. |
Exception | An exception can be thrown, if the foreign key could not be removed from the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It removes the index from the given dataset.
datasetName | The dataset where the index will be removed. |
idxName | The index to be removed. |
Exception | An exception can be thrown, if the index could not be removed from the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It removes the primary key constraint from the dataset schema.
datasetName | The dataset from where the primary key will be removed. |
Exception | An exception can be thrown, if the primary key could not be dropped from the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It removes a property from the given dataset.
datasetName | The dataset from where the given property will be removed. |
name | The property to be removed from the dataset. |
Exception | An exception can be thrown, if the dataset property could not be removed. |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It removes the sequence from the data source.
name | The sequence that will be removed. |
Exception | An exception can be thrown, if the sequence could not be removed from the data source. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It removes the unique key constraint from the dataset.
datasetName | The dataset from where the unique key will be removed. |
name | The unique key constraint name. |
Exception | An exception can be thrown, if the unique key could not be removed from the dataset schema. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It escapes a string for using in commands and queries.
value | Any string. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It executes the specified command using a generic query representation.
command | A query like: CREATE, DROP, ALTER, INSERT, UPDATE, DELETE. |
Exception | An exception can be thrown if the query cannot be performed. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It executes the specified command in the data source native language.
command | A query string in the data source native language (like: CREATE, DROP, ALTER, INSERT, UPDATE, DELETE). |
Exception | An exception can be thrown if the query can not be performed. |
Reimplemented in te::gdal::DataSource.
|
protectedvirtual |
Check the existence of a data source in a driver.
connInfo | The data source information. |
Exception | An exception can be thrown, if the existence of a data source in a driver could not be determined. |
Implements te::da::DataSource.
|
staticinherited |
It checks if the data source exists with the connection information and the driver type.
dsType | The data source type name (example: POSTGIS, ORACLE, SQLITE). |
dsInfo | The data source information. |
Exception | An exception can be thrown, if the data source exists in the driver. |
|
virtualinherited |
It checks if a foreign key with the given name exists in the data source.
datasetName | The dataset name. |
name | The foreign key name. |
Exception | An exception can be thrown, if the existence of the foreign key could not be obtained. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It returns the known capabilities of the data source.
The returned object has all the information about the operations the data source can perform. Here you will find if the data source implementation supports primary keys, foreign keys, if it can be used in a thread environment and much more information.
capabilities | The known capabilities of the data source. |
Implements te::da::DataSource.
|
inherited |
It gets capabilities about a data set.
name | Name of the dataset. |
|
virtualinherited |
It gets the check constraint of the dataset with the given name.
datasetName | The dataset name. |
name | The check constraint name. |
Exception | An exception can be thrown, if the check constraint could not be retrieved. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It gets the check constraint names of the given dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the check constraint names could not be retrieved. |
Reimplemented in te::gdal::DataSource.
|
inherited |
An Uniform Resource Identifier used to describe the datasource connection.
|
virtual |
It gets the dataset identified by the given name. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released.
name | The dataset name. |
accessPolicy | Access policy. |
travType | The traverse type associated to the returned dataset. |
Exception | It can throw an exception if:
|
Reimplemented from te::da::DataSource.
|
virtualinherited |
It gets the dataset identified by the given name using a spatial filter over the specified property. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released.
name | The dataset name. |
propertyName | The name of the spatial property used to apply the spatial filter. |
e | A rectangle used as a spatial filter when retrieving the dataset. |
r | The spatial relation used during the filtering. |
accessPolicy | Access policy. |
travType | The traversal type associated to the returned dataset. |
Exception | It can throw an exception if:
|
|
virtualinherited |
It gets the dataset identified by the given name using a spatial filter over the given geometric property. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released.
name | The dataset name. |
propertyName | The name of the spatial property used to apply the spatial filter. |
g | The geometry used as a spatial filter when retrieving the dataset. |
r | The spatial relation used during the filtering. |
accessPolicy | Access policy. |
travType | The traverse type associated to the returned dataset. |
|
inherited |
It gets the dataset identified by the given name using the identification of the objects. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released.
name | The dataset name. |
oids | A pointer to the set of objects. Do not pass a null pointer nor an empty set. |
accessPolicy | Access policy. |
travType | The traverse type associated to the returned dataset. |
Exception | It can throw an exception if:
|
|
virtual |
It gets the dataset names available in the data source.
Exception | An exception can be thrown, if the dataset names could not be retrieved. |
Reimplemented from te::da::DataSource.
const std::map<std::string, te::da::DataSetPtr>& te::mem::DataSource::getDataSets | ( | ) | const |
It returns a map relating the dataset names and their contents.
|
virtual |
It gets information about the given dataset.
This method can provide the following information about a dataset:
name | The name of the dataset we are looking information for. |
Exception | An exception can be thrown, if the information about the dataset could not be retrieved. |
Reimplemented from te::da::DataSource.
|
protectedvirtual |
It gets the data source names available in a driver.
dsInfo | The data source information. |
Exception | An exception can be thrown, if the data source names could not be retrieved. |
Implements te::da::DataSource.
|
staticinherited |
It returns the data source names available in the driver.
dsType | The type name of the data source(example: PostGIS, Oracle, WFS). |
dsInfo | The information about the data sources. |
Exception | An exception can be thrown, if the data source names could not be retrieved. |
Exception | An exception can be thrown, if the list of data source names could not be retrieved. |
|
virtual |
It returns the data source SQL dialect, if there is one.
Implements te::da::DataSource.
|
virtualinherited |
It return the DataSource current encoding.
Reimplemented in te::ogr::DataSource.
|
virtualinherited |
It retrieves the bounding rectangle of the spatial property for the given dataset.
datasetName | The dataset name. |
propertyName | The spatial property name. |
Exception | An exception can be thrown, if the extent of the geometry property could not be retrieved. |
|
virtualinherited |
It retrieves the bounding rectangle for the spatial property lying in the given position in the dataset.
datasetName | The dataset name. |
propertyPos | The spatial property position. |
Exception | An exception can be thrown, if the extent of the geometry property lying in the given position could not be retrieved. |
|
virtualinherited |
It retrieves the foreign key from the given dataset.
datasetName | The dataset name. |
name | The foreign key name. |
Exception | An exception can be thrown, if the foreign key could not be retrieved. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It gets the foreign key names of the given dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the foreign key names could not be retrieved. |
Reimplemented in te::gdal::DataSource.
|
inherited |
An identification value for the data source.
|
virtualinherited |
It gets the index with the given name from the dataset.
datasetName | The dataset name. |
name | The index name. |
Exception | An exception can be thrown, if the index could not be retrieved. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It gets the index names of the given dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the index names could not be retrieved. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It retrieves the number of data sets available in the data source.
Exception | An exception can be thrown, if the number of datasets could not be retrieved. |
Reimplemented from te::da::DataSource.
|
virtual |
It retrieves the number of items of the given dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the number of items of the dataset could not be retrieved. |
Reimplemented from te::da::DataSource.
|
virtual |
It gets the number of properties of the given dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the number of dataset properties could not be retrieved. |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It retrieves the primary key of the dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the primary key could not be retrieved. |
|
virtual |
It retrieves the properties of the dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the dataset properties could not be retrieved. |
Reimplemented from te::da::DataSource.
|
virtual |
It retrieves the property with the given name from the dataset.
datasetName | The dataset name. |
propertyName | The property name. |
Exception | An exception can be thrown, if the dataset property could not be retrieved. |
Reimplemented from te::da::DataSource.
|
virtual |
It retrieves the property lying in the given position from the dataset.
datasetName | The dataset name. |
propertyPos | The property position. |
Exception | An exception can be thrown, if the property lying in the given position could not be retrieved. |
Reimplemented from te::da::DataSource.
|
virtual |
It gets the property names of the given dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the property names of the dataset could not be retrieved. |
Reimplemented from te::da::DataSource.
const std::map<std::string, te::da::DataSetTypePtr> te::mem::DataSource::getSchemas | ( | ) | const |
It returns a map relating the dataset names and their schemas.
|
virtualinherited |
It gets the sequence with the given name in the data source.
name | The sequence name. |
Exception | An exception can be thrown, if the sequence could not be retrieved from the data source. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It gets the sequence names available in the data source.
Exception | An exception can be thrown, if the sequence names could not be retrieved. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It returns the set of parameters used to set up the access channel to the underlying repository.
This is the connection information used by a data source in order to enter in an operational mode, when the open method is called.
The key-value-pairs (kvp) may contain information about: maximum number of accepted connections, user name and password required for establishing a connection, the url of a service, or any other information needed by the data source to operate. This information is dependent on the data source driver, so check the driver documentation for any additional information about the kvp.
It sets the connection information to be used when connecting to the data source.
connInfo | The connection information. |
It returns an object that can execute transactions in the context of a data source.
Use this method to get an object that allows to retrieve a dataset, to insert or update data, or to modify dataset types(schemas). You don't need to cache this kind of object because each driver in TerraLib already keeps a connection pooling. So, as soon as you finish using the transactor, destroy it.
Exception | An exception can be thrown, if it is not possible to get a transactor; for example, if there is no available connection. |
Implements te::da::DataSource.
|
virtual |
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL.
Implements te::da::DataSource.
|
virtualinherited |
It gets the unique key in the dataset with the given name.
datasetName | The dataset name. |
name | The unique key name. |
Exception | An exception can be thrown, if the unique key could not be retrieved. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It gets the unique key names of the given dataset.
datasetName | The dataset name. |
Exception | An exception can be thrown, if the unique key names could not be obtained. |
|
virtual |
It checks if the data source has any dataset.
Exception | An exception can be thrown, if it is not possible to check if the data source has datasets . |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It checks if an index with the given name exists in the dataset.
datasetName | The dataset name. |
name | The index name. |
Exception | An exception can be thrown, if the index existence could not be determined. |
Reimplemented in te::gdal::DataSource.
|
virtualinherited |
It checks if the given dataset name is valid.
datasetName | A dataset name whose validity will be checked. |
|
virtual |
It returns true if the data source is opened, otherwise it returns false.
This method will not check if the data source is available for using; it will just answer if the data source has already been opened. If you want to know if the data source is available for using, check the isValid() method.
Implements te::da::DataSource.
|
virtualinherited |
It checks if the given property name is valid.
propertyName | A property name whose validity will be checked. |
|
virtual |
It checks if the data source is valid (available for using).
For a DBMS, it will check the opened connections. For a WFS client, it will check if the server is reachable. For a file, it will check if it can be read.
Implements te::da::DataSource.
|
virtual |
It opens the data source and makes it ready for using.
If the subclass needs to open a connection to a database server, to open a file, or to get information from a Web Service, this method can do this kind of job to prepare the data source to be in an operational mode. It will use the connection information provided by the setConnectionInfo methods.
Exception | An exception can be thrown, if the data source cannot be opened. |
Implements te::da::DataSource.
|
virtualinherited |
It checks if a primary key exists in the dataset.
datasetName | The dataset name. |
name | The primary key name. |
Exception | An exception can be thrown, if the existence of the primary key could not be determined. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It checks if a property with the given name exists in the dataset.
datasetName | The dataset name. |
name | The property name. |
Exception | An exception can be thrown, if the existence of the dataset property could not be obtained. |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It executes a query that may return some data using a generic query. This method always returns a disconnected dataset, that is, a dataset that no more depends of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released.
This method is different of the method that accepts a dataset name and a spatial filter; this method allows the retrieving of only a subset of the attributes, since a query can include a property list.
q | A valid query object. |
travType | The traverse type associated to the returned dataset. |
accessPolicy | Access policy. |
Exception | It can throw an exception if:
|
|
virtualinherited |
It executes a query that may return some data using the data source native language. This method always returns a disconnected dataset, that is, a dataset that is no more dependent of the data source that provided the connection for its creation. Therefore, the disconnected dataset continues to live after the connection given by the data source has been released.
query | A query string in the data source native language. |
travType | The traverse type associated to the returned dataset. |
accessPolicy | Access policy. |
Exception | It can throw an exception if:
|
|
virtual |
It removes all the informed items from the dataset.
It removes all the data items from a dataset which are identified by a set of object identifiers. If this set is not informed, all items will be removed.
datasetName | The dataset name. |
oids | A set of object identifiers used used to remove data from the dataset, or NULL, for removing all. |
Exception | An exception can be thrown, if the data items could not be removed. |
Reimplemented from te::da::DataSource.
|
virtual |
It renames a dataset.
name | The name of the dataset to be renamed. |
newName | The new dataset name. |
Exception | An exception can be thrown, if the dataset could not be renamed. |
Reimplemented from te::da::DataSource.
|
virtual |
It renames a property of the given dataset.
datasetName | The dataset containing the property to be renamed. |
propertyName | The property to be renamed from the dataset. |
newPropertyName | The new property name. |
Exception | An exception can be thrown, if the dataset property could not be renamed. |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It checks if a sequence with the given name exists in the data source.
name | The sequence name. |
Exception | An exception can be thrown, if the index existence could not be determined. |
Reimplemented in te::gdal::DataSource.
|
static |
It sets the capabilities document.
capabilities | The memory data source capabilities. |
|
virtualinherited |
It sets the encodings for the data source.
et | The char encoding type. |
Reimplemented in te::ogr::DataSource.
|
inherited |
It sets the data source identification.
id | An identification value. |
|
virtualinherited |
It checks if a unique key with the given name exists in the dataset.
datasetName | The dataset name. |
name | The unique key name. |
Exception | An exception can be thrown, if the existence of the unique key could not be determined. |
Reimplemented in te::gdal::DataSource.
|
virtual |
It updates the contents of a dataset for the set of data items.
datasetName | The target dataset name. |
dataset | The list of data items to be updated. |
properties | The list of properties of the dataset to be updated. |
oids | The list of objects to be updated. |
options | A list of optional modifiers. It is driver specific. |
limit | The number of items to be used from the input dataset. If set to 0 (default) all items are used. |
Exception | An exception can be thrown, if the dataset could not be updated. |
Reimplemented from te::da::DataSource.
|
virtualinherited |
It updates the contents of a dataset.
All rows are edited. The third parameter tells wich columns are edited for each row.
datasetName | Name pf the dataset. |
dataset | Dataset with editions. |
properties | Columns edited for each row. Note that the size of properties must be the same of the dataset. |
ids | List of positions of the columns that identifies rows. |
te::da::Exception | An exception can be thrown, if the dataset could not be updated. |
|
private |
The set of datasets stored in memory.
Definition at line 170 of file DataSource.h.
|
private |
If true, each dataset is cloned in the getDataSet method.
Definition at line 176 of file DataSource.h.
|
protectedinherited |
The data source identification.
Definition at line 1434 of file DataSource.h.
|
private |
A flag to control the state of the data source.
Definition at line 175 of file DataSource.h.
|
private |
The maximum number of datasets to be handled by the data source.
Definition at line 174 of file DataSource.h.
|
mutableprivate |
The internal mutex.
Definition at line 172 of file DataSource.h.
|
private |
The number of datasets kept in the data source.
Definition at line 173 of file DataSource.h.
|
private |
The set of dataset schemas.
Definition at line 171 of file DataSource.h.
|
protectedinherited |
The URI used to describe the datasource connection;.
Definition at line 1435 of file DataSource.h.
|
staticprivate |
The Memory data source capabilities.
Definition at line 178 of file DataSource.h.
|
staticprivate |
A dummy dialect.
Definition at line 179 of file DataSource.h.