25 #ifndef __TERRALIB_GDAL_INTERNAL_TRANSACTOR_H 
   26 #define __TERRALIB_GDAL_INTERNAL_TRANSACTOR_H 
   29 #include "../dataaccess/datasource/DataSourceTransactor.h" 
   36 #include <boost/filesystem.hpp> 
   37 #include <boost/ptr_container/ptr_vector.hpp> 
   38 #include <boost/shared_ptr.hpp> 
   81       std::unique_ptr<te::da::DataSetType> 
getDataSetType(
const std::string& name);
 
   83       boost::ptr_vector<te::dt::Property> 
getProperties(
const std::string& datasetName);
 
   85       std::unique_ptr<te::dt::Property> 
getProperty(
const std::string& datasetName, 
const std::string& name);
 
   87       std::unique_ptr<te::dt::Property> 
getProperty(
const std::string& datasetName, std::size_t propertyPos);
 
   93       bool propertyExists(
const std::string& datasetName, 
const std::string& name);
 
  101       void renameProperty(
const std::string& , 
const std::string& , 
const std::string& ) {}
 
  103       std::unique_ptr<te::da::DataSet> 
getDataSet(
const std::string& name, 
 
  105                                                 bool connected = 
false,
 
  108       std::unique_ptr<te::da::DataSet> 
getDataSet(
const std::string& name,
 
  109                                                 const std::string& propertyName,
 
  113                                                 bool connected = 
false,
 
  116       std::unique_ptr<te::da::DataSet> 
getDataSet(
const std::string& name,
 
  117                                                 const std::string& propertyName,
 
  121                                                 bool connected = 
false,
 
  124       std::unique_ptr<te::da::DataSet> 
getDataSet(
const std::string& name,
 
  127                                                 bool connected = 
false,
 
  132                                            bool connected = 
false,
 
  135       std::unique_ptr<te::da::DataSet> 
query(
const std::string& query,
 
  137                                    bool connected = 
false,
 
  147                          const std::map<std::string, std::string>& options);
 
  150                         const std::string& cloneName,
 
  151                         const std::map<std::string, std::string>& options) ;
 
  156                          const std::string& newName);
 
  158       void add(
const std::string& ,
 
  160                const std::map<std::string, std::string>& ,
 
  169                   const std::vector<std::size_t>& ,
 
  171                   const std::map<std::string, std::string>& ,
 
  174       std::unique_ptr<te::gm::Envelope> 
getExtent(
const std::string& datasetName,
 
  175                                                 const std::string& propertyName);
 
  177       std::unique_ptr<te::gm::Envelope> 
getExtent(
const std::string& datasetName,
 
  178                                                 std::size_t propertyPos);
 
  192       std::unique_ptr<te::da::PreparedQuery> 
getPrepared(
const std::string& ) { 
return std::unique_ptr<te::da::PreparedQuery>(); }
 
  194       std::unique_ptr<te::da::BatchExecutor> 
getBatchExecutor() { 
return std::unique_ptr<te::da::BatchExecutor>(); }
 
  200       std::string 
escape(
const std::string& ) { 
return std::string(
""); }
 
  203       { 
return std::unique_ptr<te::da::PrimaryKey>(); }
 
  211       std::unique_ptr<te::da::ForeignKey> 
getForeignKey(
const std::string& , 
const std::string& ) { 
return std::unique_ptr<te::da::ForeignKey>(); }
 
  213       std::vector<std::string> 
getForeignKeyNames(
const std::string& ) { 
return std::vector<std::string>(); }
 
  221       std::unique_ptr<te::da::UniqueKey> 
getUniqueKey(
const std::string& , 
const std::string& ) 
 
  222       { 
return std::unique_ptr<te::da::UniqueKey>(); }
 
  225       { 
return std::vector<std::string>(); }
 
  233       std::unique_ptr<te::da::CheckConstraint> 
getCheckConstraint(
const std::string& , 
const std::string& ) 
 
  234       { 
return std::unique_ptr<te::da::CheckConstraint>(); }
 
  237       { 
return std::vector<std::string>(); }
 
  245       std::unique_ptr<te::da::Index> 
getIndex(
const std::string& , 
const std::string& ) 
 
  246       { 
return std::unique_ptr<te::da::Index>(); }
 
  249       { 
return std::vector<std::string>(); }
 
  256       void dropIndex(
const std::string& , 
const std::string& ) {}
 
  261       std::unique_ptr<te::da::Sequence> 
getSequence(
const std::string& )
 
  262       { 
return std::unique_ptr<te::da::Sequence>(); }
 
  265       { 
return std::vector<std::string>(); }
 
  271       void optimize(
const std::map<std::string, std::string>& ){}
 
  276       std::unique_ptr<te::da::DataSetType> 
getType(
const std::string& dsfullname);  
 
  280       std::unique_ptr<te::da::DataSetType> 
getDataSetType(
const std::string& source, 
const std::string& name, std::string& uri);
 
A class that describes a check constraint.
 
A class that models the description of a dataset.
 
A dataset is the unit of information manipulated by the data access module of TerraLib.
 
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
 
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.
 
A Select models a query to be used when retrieving data from a DataSource.
 
It describes a sequence (a number generator).
 
It describes a unique key (uk) constraint.
 
It models a property definition.
 
std::vector< std::string > getSequenceNames()
It gets the sequence names available in the data source.
 
std::size_t getNumberOfItems(const std::string &datasetName)
It retrieves the number of items of the given dataset.
 
std::unique_ptr< te::da::PrimaryKey > getPrimaryKey(const std::string &)
It retrieves the primary key of the dataset.
 
void remove(const std::string &, const te::da::ObjectIdSet *)
It removes all the informed items from the dataset.
 
std::unique_ptr< te::da::Sequence > getSequence(const std::string &)
It gets the sequence with the given name in the data source.
 
bool primaryKeyExists(const std::string &, const std::string &)
It checks if a primary key exists in the dataset.
 
void dropCheckConstraint(const std::string &, const std::string &)
It removes the check constraint from the dataset.
 
std::vector< std::string > getUniqueKeyNames(const std::string &)
It gets the unique key names of the given dataset.
 
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.
 
void addProperty(const std::string &, te::dt::Property *)
It adds a new property to the dataset schema.
 
boost::int64_t getLastGeneratedId()
It returns the last id generated by an insertion command.
 
void dropIndex(const std::string &, const std::string &)
It removes the index from the dataset schema.
 
bool propertyExists(const std::string &datasetName, size_t propertyPos)
 
std::vector< std::string > getIndexNames(const std::string &)
It gets the index names of the given dataset.
 
void addPrimaryKey(const std::string &, te::da::PrimaryKey *)
It adds a primary key constraint to the dataset schema.
 
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.
 
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.
 
void dropPrimaryKey(const std::string &)
It removes the primary key constraint from the dataset schema.
 
bool hasDataSets(const std::string &source)
 
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.
 
bool hasDataSets()
It checks if the data source has any dataset.
 
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::unique_ptr< te::da::PreparedQuery > getPrepared(const std::string &)
It creates a prepared query object that may be used for query commands (select, insert,...
 
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::BatchExecutor > getBatchExecutor()
It creates a batch command executor.
 
void dropDataSet(const std::string &name)
It removes the dataset schema from the data source.
 
void addCheckConstraint(const std::string &, te::da::CheckConstraint *)
It adds a check constraint to the dataset.
 
void renameDataSet(const std::string &name, const std::string &newName)
It renames a dataset.
 
bool dataSetExists(const std::string &name)
It checks if a dataset with the given name exists in the data source.
 
std::unique_ptr< te::da::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, bool connected=false, 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....
 
void execute(const std::string &)
It executes the specifed command in the data source native language.
 
bool propertyExists(const std::string &datasetName, const std::string &name)
It checks if a property with the given name exists in the dataset.
 
std::string escape(const std::string &)
It escapes a string for using in commands and queries.
 
std::vector< std::string > getPropertyNames(const std::string &datasetName)
It gets the property names of the given dataset.
 
std::unique_ptr< te::da::DataSetType > getType(const std::string &dsfullname)
 
std::unique_ptr< te::da::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, bool connected=false, 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 prop...
 
void dropForeignKey(const std::string &, const std::string &)
It removes the foreign key constraint from the dataset schema.
 
std::unique_ptr< te::da::DataSet > query(const te::da::Select &q, te::common::TraverseType travType=te::common::FORWARDONLY, bool connected=false, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It executes a query that may return some data using a generic query. A dataset can be connected or di...
 
void begin()
It starts a new transaction.
 
std::unique_ptr< te::da::DataSet > getDataSet(const std::string &name, te::common::TraverseType travType=te::common::FORWARDONLY, bool connected=false, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It gets the dataset identified by the given name. A dataset can be connected or disconnected....
 
std::unique_ptr< te::da::DataSet > getDataSet(const std::string &name, const te::da::ObjectIdSet *oids, te::common::TraverseType travType=te::common::FORWARDONLY, bool connected=false, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
 
void cancel()
It requests that the data source stop the processing of the current command.
 
void addForeignKey(const std::string &, te::da::ForeignKey *)
It adds a foreign key constraint to a dataset.
 
void getDataSetNames(const std::string &source, std::vector< std::string > &dsnames)
 
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.
 
bool checkConstraintExists(const std::string &, const std::string &)
It checks if a check-constraint with the given name exists in the data source.
 
bool isInTransaction() const
It returns true if a transaction is in progress, otherwise, it returns false.
 
void dropProperty(const std::string &, const std::string &)
It removes a property 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.
 
void add(const std::string &, te::da::DataSet *, const std::map< std::string, std::string > &, std::size_t, bool)
It adds data items to the dataset in the data source.
 
te::da::DataSource * getDataSource() const
It returns the parent data source of the transactor.
 
void execute(const te::da::Query &)
It executes the specified command using a generic query representation.
 
std::size_t getNumberOfProperties(const std::string &datasetName)
It gets the number of properties of the given dataset.
 
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.
 
void optimize(const std::map< std::string, std::string > &)
For some data access drivers, this method will perform some operations to optimize the data storage.
 
std::unique_ptr< te::da::Index > getIndex(const std::string &, const std::string &)
It gets the index with the given name from the dataset.
 
void commit()
It commits the transaction.
 
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 rollBack()
It aborts the transaction. Any changes will be rolled-back.
 
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 datas...
 
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.
 
Transactor(const std::string &accessInfo)
 
boost::ptr_vector< te::dt::Property > getProperties(const std::string &datasetName)
It retrieves the properties of 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::vector< std::string > getDataSetNames()
It It gets the dataset names available in the data source.
 
void addSequence(te::da::Sequence *)
It creates a new sequence in the data source.
 
std::vector< std::string > getCheckConstraintNames(const std::string &)
It gets the check constraint names of the given dataset.
 
bool uniqueKeyExists(const std::string &, const std::string &)
It checks if a unique key with the given name exists in the dataset.
 
void dropSequence(const std::string &)
It removes the sequence from the data source.
 
std::size_t getNumberOfDataSets()
It retrieves the number of data sets available in the data source.
 
void dropUniqueKey(const std::string &, const std::string &)
It removes the unique key constraint from the dataset.
 
bool foreignKeyExists(const std::string &, const std::string &)
It checks if a foreign key with the given name exists in the data source.
 
std::unique_ptr< te::da::DataSetType > getDataSetType(const std::string &name)
It gets information about the given dataset.
 
std::unique_ptr< te::da::DataSet > query(const std::string &query, te::common::TraverseType travType=te::common::FORWARDONLY, bool connected=false, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It executes a query that may return some data using the data source native language....
 
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.
 
std::unique_ptr< te::da::DataSetType > getDataSetType(const std::string &source, const std::string &name, std::string &uri)
 
size_t getNumberOfDataSets(const std::string &source)
 
An Envelope defines a 2D rectangular region.
 
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
 
TraverseType
A dataset can be traversed in two ways:
 
AccessPolicy
Supported data access policies (can be used as bitfield).
 
boost::shared_ptr< DataSetType > DataSetTypePtr
 
SpatialRelation
Spatial relations between geometric objects.
 
#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).