26 #ifndef __TERRALIB_GDAL_INTERNAL_DATASOURCE_H
27 #define __TERRALIB_GDAL_INTERNAL_DATASOURCE_H
30 #include "../dataaccess/datasource/DataSource.h"
31 #include "../dataaccess/datasource/DataSourceCapabilities.h"
32 #include "../dataaccess/dataset/DataSetType.h"
38 #include <boost/shared_ptr.hpp>
39 #include <boost/ptr_container/ptr_vector.hpp>
40 #include <boost/filesystem.hpp>
64 class DataSourceTransactor;
114 void renameProperty(
const std::string& ,
const std::string& ,
const std::string& ) {}
117 void add(
const std::string& ,
119 const std::map<std::string, std::string>& ,
127 const std::vector<std::size_t>&,
129 const std::map<std::string, std::string>& ,
141 std::string
escape(
const std::string& value)
153 std::unique_ptr<te::da::ForeignKey>
getForeignKey(
const std::string& ,
const std::string& )
154 {
return std::unique_ptr<te::da::ForeignKey>(); }
157 {
return std::vector<std::string>(); }
168 std::unique_ptr<te::da::UniqueKey>
getUniqueKey(
const std::string& ,
const std::string& )
169 {
return std::unique_ptr<te::da::UniqueKey>(); }
180 std::unique_ptr<te::da::CheckConstraint>
getCheckConstraint(
const std::string& ,
const std::string& )
181 {
return std::unique_ptr<te::da::CheckConstraint>(); }
184 {
return std::vector<std::string>(); }
195 std::unique_ptr<te::da::Index>
getIndex(
const std::string& ,
const std::string& )
196 {
return std::unique_ptr<te::da::Index>(); }
199 {
return std::vector<std::string>(); }
205 const std::map<std::string, std::string>& )
208 void dropIndex(
const std::string& ,
const std::string& )
211 std::unique_ptr<te::da::Sequence>
getSequence(
const std::string& )
212 {
return std::unique_ptr<te::da::Sequence>(); }
215 {
return std::vector<std::string>(); }
228 void create(
const std::string& connInfo);
230 void drop(
const std::string& connInfo);
232 bool exists(
const std::string& connInfo);
te::da::DataSourceCapabilities capabilities
A class to store the proxy information that must be used to access data located in URIs.
A class that describes a check constraint.
A dataset is the unit of information manipulated by the data access module of TerraLib.
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
An abstract class for data providers like a DBMS, Web Services or a regular file.
It models a foreign key constraint for a DataSetType.
It describes an index associated to a DataSetType.
This class represents a set of unique ids created in the same context. i.e. from the same data set.
It describes a primary key (pk) constraint.
A Query is independent from the data source language/dialect.
It represents the SQL query dialect accepted by a given data source.
It describes a sequence (a number generator).
It describes a unique key (uk) constraint.
It models a property definition.
A driver to access raster data using the GDAL library.
void dropIndex(const std::string &, const std::string &)
It removes the index from the given dataset.
bool indexExists(const std::string &, const std::string &)
It checks if an index with the given name exists in the dataset.
static void setCapabilities(const te::da::DataSourceCapabilities &capabilities)
void addProperty(const std::string &, te::dt::Property *)
It adds a new property to the dataset schema.
void execute(const te::da::Query &)
It executes the specified command using a generic query representation.
void addIndex(const std::string &, te::da::Index *, const std::map< std::string, std::string > &)
It adds an index to the dataset.
std::unique_ptr< te::da::Sequence > getSequence(const std::string &)
It gets the sequence with the given name in the data source.
void create(const std::string &connInfo)
It creates a new data source.
void dropProperty(const std::string &, const std::string &)
It removes a property from the given dataset.
void addUniqueKey(const std::string &, te::da::UniqueKey *)
It adds a unique key constraint to the dataset.
void renameProperty(const std::string &, const std::string &, const std::string &)
It renames a property of the given dataset.
DataSource(const te::core::URI &uri)
void dropPrimaryKey(const std::string &)
It removes the primary key constraint from the dataset schema.
void addCheckConstraint(const std::string &, te::da::CheckConstraint *)
It adds a check constraint to the dataset.
std::unique_ptr< te::da::ForeignKey > getForeignKey(const std::string &, const std::string &)
It retrieves the foreign key from the given dataset.
std::unique_ptr< te::da::Index > getIndex(const std::string &, const std::string &)
It gets the index with the given name from the dataset.
bool uniqueKeyExists(const std::string &, const std::string &)
It checks if a unique key with the given name exists in the dataset.
void open()
It opens the data source and makes it ready for using.
std::string escape(const std::string &value)
It escapes a string for using in commands and queries.
void close()
It closes the data source and clears all the resources used by its internal communication channel.
bool checkConstraintExists(const std::string &, const std::string &)
It checks if a check-constraint with the given name exists in the data source.
void update(const std::string &, te::da::DataSet *, const std::vector< std::size_t > &, const te::da::ObjectIdSet *, const std::map< std::string, std::string > &, std::size_t)
It updates the contents of a dataset for the set of data items.
void dropForeignKey(const std::string &, const std::string &)
It removes the foreign key constraint from the dataset schema.
void addPrimaryKey(const std::string &, te::da::PrimaryKey *)
It adds a primary key constraint to the dataset schema.
const te::da::SQLDialect * getDialect() const
It returns the data source SQL dialect, if there is one.
std::vector< std::string > getForeignKeyNames(const std::string &)
It gets the foreign key names of the given dataset.
bool sequenceExists(const std::string &)
It checks if a sequence with the given name exists in the data source.
bool foreignKeyExists(const std::string &, const std::string &)
It checks if a foreign key with the given name exists in the data source.
std::string getType() const
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS,...
bool isOpened() const
It returns true if the data source is opened, otherwise it returns false.
bool isValid() const
It checks if the data source is valid (available for using).
const te::da::DataSourceCapabilities & getCapabilities() const
It returns the known capabilities of the data source.
void dropSequence(const std::string &)
It removes the sequence from the data source.
void execute(const std::string &)
It executes the specified command in the data source native language.
std::vector< std::string > getCheckConstraintNames(const std::string &)
It gets the check constraint names of the given dataset.
std::vector< std::string > getDataSourceNames(const std::string &connInfo)
It gets the data source names available in a driver.
std::unique_ptr< te::da::DataSourceTransactor > getTransactor()
It returns the set of parameters used to set up the access channel to the underlying repository.
std::vector< std::string > getIndexNames(const std::string &)
It gets the index names of the given dataset.
bool exists(const std::string &connInfo)
Check the existence of a data source in a driver.
void addSequence(te::da::Sequence *)
It adds a new sequence in the data source.
static te::da::DataSourceCapabilities sm_capabilities
std::size_t getNumberOfItems(const std::string &datasetName)
It retrieves the number of items of the given dataset.
void remove(const std::string &, const te::da::ObjectIdSet *)
It removes all the informed items from the dataset.
bool primaryKeyExists(const std::string &, const std::string &)
It checks if a primary key exists in the dataset.
std::unique_ptr< te::da::CheckConstraint > getCheckConstraint(const std::string &, const std::string &)
It gets the check constraint of the dataset with the given name.
~DataSource()
Virtual destructor.
void dropUniqueKey(const std::string &, const std::string &)
It removes the unique key constraint from the dataset.
void drop(const std::string &connInfo)
It removes the data source with the connection information from a driver.
DataSource(const std::string &connInfo)
void addForeignKey(const std::string &, te::da::ForeignKey *)
It adds a foreign key constraint to a dataset.
void add(const std::string &, te::da::DataSet *, const std::map< std::string, std::string > &, std::size_t)
It adds data items to the dataset in the data source.
std::unique_ptr< te::da::UniqueKey > getUniqueKey(const std::string &, const std::string &)
It gets the unique key in the dataset with the given name.
std::vector< std::string > getSequenceNames()
It gets the sequence names available in the data source.
void dropCheckConstraint(const std::string &, const std::string &)
It removes the check constraint from the dataset.
#define TEGDALEXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).
Implementation of the transactor for the WS OGC WMS.
An exception class for the XML module.