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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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::unique_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... | |
| virtual std::string | getGeometryTypeName (te::gm::GeomType type) |
| It gets the datasource geometry type name equivalent to terralib. More... | |
Data Retrieval | |
Methods for retrieving data from the data source. | |
| virtual std::unique_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::unique_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::unique_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::unique_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::unique_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 Data Source Methods???? | |
The protected methods of the data source | |
| bool | isConnected () |
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 src/terralib/memory/DataSource.h.
| te::mem::DataSource::DataSource | ( | const std::string & | connInfo | ) |
Definition at line 54 of file src/terralib/memory/DataSource.cpp.
| te::mem::DataSource::DataSource | ( | const te::core::URI & | uri | ) |
Definition at line 63 of file src/terralib/memory/DataSource.cpp.
|
virtual |
Virtual destructor.
Reimplemented from te::da::DataSource.
Definition at line 72 of file src/terralib/memory/DataSource.cpp.
References close().
|
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.
Definition at line 478 of file src/terralib/memory/DataSource.cpp.
References te::mem::DataSet::copy(), dataSetExists(), m_datasets, m_mtx, and TE_TR.
Referenced by te::mem::Transactor::add().
|
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.
Definition at line 356 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 294 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 386 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
Referenced by te::graph::DataSourceGraphMetadata::saveProperty().
|
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.
Definition at line 264 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 293 of file src/terralib/memory/DataSource.cpp.
References te::mem::DataSet::add(), dt, getDataSet(), getDataSetType(), te::dt::Property::getName(), te::dt::Property::getType(), m_mtx, propertyExists(), and TE_TR.
Referenced by te::mem::Transactor::addProperty().
|
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.
Definition at line 417 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 325 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
virtualinherited |
Definition at line 244 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::changePropertyDefinition().
|
virtualinherited |
Definition at line 238 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
Referenced by te::da::DataSource::changePropertiesDefinitions().
|
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.
Definition at line 350 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 412 of file src/terralib/memory/DataSource.cpp.
References dataSetExists(), getDataSet(), te::da::DataSource::isDataSetNameValid(), m_datasets, m_mtx, m_numDatasets, m_schemas, and TE_TR.
Referenced by te::mem::Transactor::cloneDataSet().
|
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.
Definition at line 124 of file src/terralib/memory/DataSource.cpp.
References m_datasets, m_deepCopy, m_isOpened, m_maxNumDatasets, m_numDatasets, m_schemas, and TE_MEMORY_MAX_DATASETS.
Referenced by open(), and ~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.
Definition at line 522 of file src/terralib/memory/DataSource.cpp.
|
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. |
Definition at line 528 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References ds, te::da::DataSourceFactory::make(), and TE_TR.
Referenced by te::qt::plugins::sqlite::SQLiteCreatorDialog::applyPushButtonPressed(), te::qt::plugins::ado::ADOCreatorDialog::applyPushButtonPressed(), te::qt::plugins::mysql::MySQLCreatorDialog::applyPushButtonPressed(), CreateDataSource(), te::qt::plugins::pgis::PostGISCreatorDialog::onApplyPushButtonPressed(), and TsDataSource::tcCreate().
|
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.
Definition at line 389 of file src/terralib/memory/DataSource.cpp.
References DataSet(), te::dt::Property::getName(), m_datasets, m_maxNumDatasets, m_mtx, m_numDatasets, m_schemas, and TE_TR.
Referenced by te::mem::Transactor::createDataSet().
|
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.
Definition at line 377 of file src/terralib/memory/DataSource.cpp.
References getDataSetNames(), and m_mtx.
Referenced by add(), cloneDataSet(), te::mem::Transactor::dataSetExists(), dropDataSet(), getDataSet(), getDataSetType(), getNumberOfItems(), getProperty(), getPropertyNames(), remove(), and renameDataSet().
|
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.
Definition at line 526 of file src/terralib/memory/DataSource.cpp.
|
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. |
Definition at line 540 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References ds, te::da::DataSourceFactory::make(), and TE_TR.
Referenced by DataSource_Drop(), DropDataSource(), and TsDataSource::tcDrop().
|
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.
Definition at line 362 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 442 of file src/terralib/memory/DataSource.cpp.
References dataSetExists(), m_datasets, m_mtx, m_numDatasets, m_schemas, and TE_TR.
Referenced by te::mem::Transactor::dropDataSet().
|
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.
Definition at line 300 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 393 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 270 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 313 of file src/terralib/memory/DataSource.cpp.
References te::mem::DataSet::drop(), dt, getDataSet(), getDataSetType(), te::da::GetPropertyPos(), m_mtx, p, propertyExists(), and TE_TR.
Referenced by te::mem::Transactor::dropProperty().
|
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.
Definition at line 423 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 331 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
virtualinherited |
It escapes a string for using in commands and queries.
| value | Any string. |
Reimplemented in te::gdal::DataSource.
Definition at line 140 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 128 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 134 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 530 of file src/terralib/memory/DataSource.cpp.
|
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. |
Definition at line 550 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References ds, te::da::DataSourceFactory::make(), and TE_TR.
Referenced by CheckDataSourceExistence(), and TsDataSource::tcExist().
|
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.
Definition at line 288 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 149 of file src/terralib/memory/DataSource.cpp.
References sm_capabilities.
|
inherited |
It gets capabilities about a data set.
| name | Name of the dataset. |
Definition at line 176 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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, and MockDataSource.
Definition at line 337 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 344 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
inherited |
An Uniform Resource Identifier used to describe the datasource connection.
Definition at line 70 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::m_uri.
Referenced by te::ogr::Transactor::createDataSet(), DataSource_GetConnectionInfo(), DSInfo::getDataSourceHeader(), te::sqlite::GetHiddenTables(), te::pgis::ConnectionPool::initialize(), PrintDataSetNames(), TsDataSource::tcGetConnectionInfo(), TsDataSourceTransactor::tcRenameDataSet(), TsDataSource::tcSetConnectionInfo(), and te::ado::Transactor::Transactor().
|
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.
Definition at line 159 of file src/terralib/memory/DataSource.cpp.
References DataSet(), dataSetExists(), m_datasets, m_deepCopy, m_mtx, and TE_TR.
Referenced by addProperty(), cloneDataSet(), dropProperty(), te::mem::Transactor::getDataSet(), and renameProperty().
|
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:
|
Reimplemented in MockDataSource.
Definition at line 83 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor(), and te::da::DataSource::isConnected().
|
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. |
Reimplemented in MockDataSource.
Definition at line 94 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor(), and te::da::DataSource::isConnected().
|
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:
|
Definition at line 105 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor(), and te::da::DataSource::isConnected().
|
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.
Definition at line 173 of file src/terralib/memory/DataSource.cpp.
References m_mtx, and m_schemas.
Referenced by dataSetExists(), and te::mem::Transactor::getDataSetNames().
| const std::map< std::string, te::da::DataSetPtr > & te::mem::DataSource::getDataSets | ( | ) | const |
It returns a map relating the dataset names and their contents.
Definition at line 77 of file src/terralib/memory/DataSource.cpp.
References m_datasets.
|
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.
Definition at line 191 of file src/terralib/memory/DataSource.cpp.
References dataSetExists(), dt, m_mtx, m_schemas, and TE_TR.
Referenced by addProperty(), dropProperty(), te::mem::Transactor::getDataSetType(), getProperty(), renameDataSet(), and renameProperty().
|
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.
Definition at line 535 of file src/terralib/memory/DataSource.cpp.
|
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. |
Definition at line 560 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References ds, te::da::DataSourceFactory::make(), and TE_TR.
Referenced by te::qt::plugins::pgis::PostGISCreatorDialog::onLineEditEditingFinished(), te::qt::plugins::pgisRaster::PostGISConnectorDialog::passwordLineEditEditingFinished(), te::qt::plugins::pgis::PostGISConnectorDialog::passwordLineEditEditingFinished(), and PrintDataSourceNames().
|
virtual |
It returns the data source SQL dialect, if there is one.
Implements te::da::DataSource.
Definition at line 154 of file src/terralib/memory/DataSource.cpp.
References sm_dialect.
|
virtualinherited |
It return the DataSource current encoding.
Reimplemented in te::ogr::DataSource.
Definition at line 518 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::core::UTF8.
Referenced by exportVectortoGPKG(), and te::pgis::ConnectionPool::initialize().
|
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. |
Reimplemented in MockDataSource.
Definition at line 429 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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. |
Reimplemented in MockDataSource.
Definition at line 435 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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 MockDataSource, and te::gdal::DataSource.
Definition at line 276 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 282 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
virtualinherited |
It gets the datasource geometry type name equivalent to terralib.
| type | The terralib geometry type. |
Definition at line 579 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
inherited |
An identification value for the data source.
Definition at line 60 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::m_id.
Referenced by te::qt::widgets::DataPropertiesDialog::onOkPushButtonClicked(), TsDataSource::tcGetId(), and TsDataSource::tcSetId().
|
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, and MockDataSource.
Definition at line 368 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 374 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 186 of file src/terralib/memory/DataSource.cpp.
References m_numDatasets.
Referenced by te::mem::Transactor::getNumberOfDataSets().
|
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.
Definition at line 360 of file src/terralib/memory/DataSource.cpp.
References dataSetExists(), m_datasets, m_mtx, and TE_TR.
Referenced by te::mem::Transactor::getNumberOfItems().
|
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.
Definition at line 276 of file src/terralib/memory/DataSource.cpp.
References getPropertyNames().
Referenced by te::mem::Transactor::getNumberOfProperties(), and getProperty().
|
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. |
Reimplemented in MockDataSource.
Definition at line 252 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
Referenced by PrintDataSetConstraints().
|
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.
Definition at line 205 of file src/terralib/memory/DataSource.cpp.
References dt, m_mtx, and m_schemas.
Referenced by te::mem::Transactor::getProperties().
|
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.
Definition at line 226 of file src/terralib/memory/DataSource.cpp.
References te::dt::Property::clone(), dt, getDataSetType(), m_mtx, p, propertyExists(), and TE_TR.
Referenced by te::mem::Transactor::getProperty().
|
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.
Definition at line 240 of file src/terralib/memory/DataSource.cpp.
References te::dt::Property::clone(), dataSetExists(), dt, getDataSetType(), getNumberOfProperties(), m_mtx, p, and TE_TR.
|
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.
Definition at line 256 of file src/terralib/memory/DataSource.cpp.
References dataSetExists(), dt, m_mtx, m_schemas, and TE_TR.
Referenced by getNumberOfProperties(), te::mem::Transactor::getPropertyNames(), and propertyExists().
| const std::map< std::string, te::da::DataSetTypePtr > te::mem::DataSource::getSchemas | ( | ) | const |
It returns a map relating the dataset names and their schemas.
Definition at line 82 of file src/terralib/memory/DataSource.cpp.
References m_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, and MockDataSource.
Definition at line 399 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 405 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 92 of file src/terralib/memory/DataSource.cpp.
|
virtual |
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL.
Implements te::da::DataSource.
Definition at line 87 of file src/terralib/memory/DataSource.cpp.
References TE_MEMORY_DRIVER_IDENTIFIER.
|
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 MockDataSource, and te::gdal::DataSource.
Definition at line 306 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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. |
Definition at line 313 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 372 of file src/terralib/memory/DataSource.cpp.
References m_numDatasets.
Referenced by te::mem::Transactor::hasDataSets().
|
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.
Definition at line 380 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
protectedinherited |
Definition at line 570 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getCapabilities(), te::da::DataSourceCapabilities::getDataSetCapabilities(), and te::da::DataSetCapabilities::isConnected().
Referenced by te::da::DataSource::getDataSet().
|
virtualinherited |
It checks if the given dataset name is valid.
| datasetName | A dataset name whose validity will be checked. |
Definition at line 146 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
Referenced by cloneDataSet(), and renameDataSet().
|
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.
Definition at line 139 of file src/terralib/memory/DataSource.cpp.
References m_isOpened.
|
virtualinherited |
It checks if the given property name is valid.
| propertyName | A property name whose validity will be checked. |
Definition at line 152 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
Referenced by exportVectortoGPKG(), and renameProperty().
|
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.
Definition at line 144 of file src/terralib/memory/DataSource.cpp.
References m_isOpened.
|
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.
Definition at line 98 of file src/terralib/memory/DataSource.cpp.
References close(), te::core::Expand(), te::core::URI::isValid(), m_deepCopy, m_isOpened, m_maxNumDatasets, te::da::DataSource::m_uri, te::core::URI::query(), and TE_TR.
|
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.
Definition at line 258 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 281 of file src/terralib/memory/DataSource.cpp.
References getPropertyNames(), and m_mtx.
Referenced by addProperty(), dropProperty(), getProperty(), te::mem::Transactor::propertyExists(), and renameProperty().
|
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:
|
Reimplemented in MockDataSource.
Definition at line 114 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
Referenced by te::graph::SequenceIterator::getFirstEdge(), te::graph::QueryIterator::getFirstEdge(), te::graph::BoxIterator::getFirstEdge(), te::graph::SequenceIterator::getFirstVertex(), te::graph::QueryIterator::getFirstVertex(), te::graph::BoxIterator::getFirstVertex(), te::stat::GetNumericStatisticalSummaryQuery(), te::stat::GetStringStatisticalSummaryQuery(), te::graph::SequenceLoaderStrategy::loadDataByEdgeId(), te::graph::BoxLoaderStrategy::loadDataByEdgeId(), te::graph::SequenceLoaderStrategy::loadDataByVertexId(), te::graph::BoxLoaderStrategy::loadDataByVertexId(), te::graph::AbstractGraphLoaderStrategy::loadEdge(), te::ado::DataSource::loadGeometryColumnsCache(), te::graph::DataSourceGraphMetadata::loadGraphAttrInfo(), te::graph::DataSourceGraphMetadata::loadGraphInfo(), te::graph::AbstractGraphLoaderStrategy::loadVertexAttrs(), te::qt::plugins::terramobile::GeoPackageSynchronizer::synchronize(), and te::graph::DataSourceGraphMetadata::updateGraphId().
|
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:
|
Reimplemented in MockDataSource.
Definition at line 121 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 492 of file src/terralib/memory/DataSource.cpp.
References dataSetExists(), te::da::DataSource::getDataSet(), m_mtx, te::mem::DataSet::moveNext(), te::mem::DataSet::remove(), and TE_TR.
Referenced by te::mem::Transactor::remove().
|
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.
Definition at line 455 of file src/terralib/memory/DataSource.cpp.
References dataSetExists(), dt, getDataSetType(), te::da::DataSource::isDataSetNameValid(), m_datasets, m_mtx, m_schemas, and TE_TR.
Referenced by te::mem::Transactor::renameDataSet().
|
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.
Definition at line 334 of file src/terralib/memory/DataSource.cpp.
References dt, getDataSet(), getDataSetType(), te::da::GetPropertyPos(), te::da::DataSource::isPropertyNameValid(), m_mtx, propertyExists(), te::mem::DataSet::setPropertyName(), and TE_TR.
Referenced by te::mem::Transactor::renameProperty().
|
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.
Definition at line 411 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
static |
It sets the capabilities document.
| capabilities | The memory data source capabilities. |
Definition at line 516 of file src/terralib/memory/DataSource.cpp.
References capabilities, and sm_capabilities.
Referenced by te::mem::Module::initialize().
|
virtualinherited |
It sets the encodings for the data source.
| et | The char encoding type. |
Reimplemented in te::ogr::DataSource.
Definition at line 523 of file src/terralib/dataaccess/datasource/DataSource.cpp.
|
inherited |
It sets the data source identification.
| id | An identification value. |
Definition at line 65 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::m_id.
Referenced by LoadShapeDataSource(), and TsDataSource::tcSetId().
|
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.
Definition at line 319 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
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.
Definition at line 507 of file src/terralib/memory/DataSource.cpp.
Referenced by te::mem::Transactor::update().
|
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. |
Definition at line 511 of file src/terralib/dataaccess/datasource/DataSource.cpp.
References te::da::DataSource::getTransactor().
|
private |
The set of datasets stored in memory.
Definition at line 170 of file src/terralib/memory/DataSource.h.
Referenced by add(), cloneDataSet(), close(), createDataSet(), dropDataSet(), getDataSet(), getDataSets(), getNumberOfItems(), and renameDataSet().
|
private |
If true, each dataset is cloned in the getDataSet method.
Definition at line 176 of file src/terralib/memory/DataSource.h.
Referenced by close(), getDataSet(), and open().
|
protectedinherited |
The data source identification.
Definition at line 1445 of file src/terralib/dataaccess/datasource/DataSource.h.
Referenced by te::da::DataSource::getId(), and te::da::DataSource::setId().
|
private |
A flag to control the state of the data source.
Definition at line 175 of file src/terralib/memory/DataSource.h.
Referenced by close(), isOpened(), isValid(), and open().
|
private |
The maximum number of datasets to be handled by the data source.
Definition at line 174 of file src/terralib/memory/DataSource.h.
Referenced by close(), createDataSet(), and open().
|
mutableprivate |
The internal mutex.
Definition at line 172 of file src/terralib/memory/DataSource.h.
Referenced by add(), addProperty(), cloneDataSet(), createDataSet(), dataSetExists(), dropDataSet(), dropProperty(), getDataSet(), getDataSetNames(), getDataSetType(), getNumberOfItems(), getProperties(), getProperty(), getPropertyNames(), propertyExists(), remove(), renameDataSet(), and renameProperty().
|
private |
The number of datasets kept in the data source.
Definition at line 173 of file src/terralib/memory/DataSource.h.
Referenced by cloneDataSet(), close(), createDataSet(), dropDataSet(), getNumberOfDataSets(), and hasDataSets().
|
private |
The set of dataset schemas.
Definition at line 171 of file src/terralib/memory/DataSource.h.
Referenced by cloneDataSet(), close(), createDataSet(), dropDataSet(), getDataSetNames(), getDataSetType(), getProperties(), getPropertyNames(), getSchemas(), and renameDataSet().
|
protectedinherited |
The URI used to describe the datasource connection;.
Definition at line 1446 of file src/terralib/dataaccess/datasource/DataSource.h.
Referenced by te::ogr::DataSource::createOGRDataSource(), terralib4::DataSource::exists(), te::ws::ogc::wcs::da::DataSource::exists(), te::ws::ogc::wms::da::DataSource::exists(), te::gdal::DataSource::exists(), te::da::DataSource::getConnectionInfo(), te::wms::DataSource::getTransactor(), te::wcs::DataSource::getTransactor(), te::wcs::DataSource::isValid(), te::wms::DataSource::isValid(), te::wfs::DataSource::isValid(), te::ws::ogc::wms::da::DataSource::isValid(), te::ws::ogc::wcs::da::DataSource::isValid(), te::gdal::DataSource::isValid(), terralib4::DataSource::open(), te::wcs::DataSource::open(), te::wms::DataSource::open(), te::ogr::DataSource::open(), te::wfs::DataSource::open(), te::ws::ogc::wms::da::DataSource::open(), te::ws::ogc::wcs::da::DataSource::open(), te::ado::DataSource::open(), te::stmem::DataSource::open(), open(), te::gdal::DataSource::open(), te::wcs::DataSource::verifyConnectionInfo(), te::wms::DataSource::verifyConnectionInfo(), te::wfs::DataSource::verifyConnectionInfo(), te::ws::ogc::wcs::da::DataSource::verifyConnectionInfo(), and te::ws::ogc::wms::da::DataSource::verifyConnectionInfo().
|
staticprivate |
The Memory data source capabilities.
Definition at line 178 of file src/terralib/memory/DataSource.h.
Referenced by getCapabilities(), and setCapabilities().
|
staticprivate |
A dummy dialect.
Definition at line 179 of file src/terralib/memory/DataSource.h.
Referenced by getDialect().