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>
77 std::vector<std::string> getDataSetNames();
79 std::size_t getNumberOfDataSets();
81 std::auto_ptr<te::da::DataSetType> getDataSetType(
const std::string& name);
83 boost::ptr_vector<te::dt::Property> getProperties(
const std::string& datasetName);
85 std::auto_ptr<te::dt::Property> getProperty(
const std::string& datasetName,
const std::string& name);
87 std::auto_ptr<te::dt::Property> getProperty(
const std::string& datasetName, std::size_t propertyPos);
89 std::vector<std::string> getPropertyNames(
const std::string& datasetName);
91 std::size_t getNumberOfProperties(
const std::string& datasetName);
93 bool propertyExists(
const std::string& datasetName,
const std::string& name);
95 bool propertyExists(
const std::string& datasetName,
size_t propertyPos);
101 void renameProperty(
const std::string& ,
const std::string& ,
const std::string& ) {}
103 std::auto_ptr<te::da::DataSet> getDataSet(
const std::string& name,
105 bool connected =
false,
108 std::auto_ptr<te::da::DataSet> getDataSet(
const std::string& name,
109 const std::string& propertyName,
113 bool connected =
false,
116 std::auto_ptr<te::da::DataSet> getDataSet(
const std::string& name,
117 const std::string& propertyName,
121 bool connected =
false,
124 std::auto_ptr<te::da::DataSet> getDataSet(
const std::string& name,
127 bool connected =
false,
132 bool connected =
false,
135 std::auto_ptr<te::da::DataSet> query(
const std::string& query,
137 bool connected =
false,
144 bool dataSetExists(
const std::string& name);
147 const std::map<std::string, std::string>& options);
149 void cloneDataSet(
const std::string& name,
150 const std::string& cloneName,
151 const std::map<std::string, std::string>& options) ;
153 void dropDataSet(
const std::string& name);
155 void renameDataSet(
const std::string& name,
156 const std::string& newName);
158 void add(
const std::string& ,
160 const std::map<std::string, std::string>& ,
163 void remove(
const std::string& ,
168 const std::vector<std::size_t>& ,
170 const std::map<std::string, std::string>& ,
173 std::auto_ptr<te::gm::Envelope> getExtent(
const std::string& datasetName,
174 const std::string& propertyName);
176 std::auto_ptr<te::gm::Envelope> getExtent(
const std::string& datasetName,
177 std::size_t propertyPos);
191 std::auto_ptr<te::da::PreparedQuery>
getPrepared(
const std::string& ) {
return std::auto_ptr<te::da::PreparedQuery>(); }
193 std::auto_ptr<te::da::BatchExecutor>
getBatchExecutor() {
return std::auto_ptr<te::da::BatchExecutor>(); }
199 std::string
escape(
const std::string& ) {
return std::string(
""); }
202 {
return std::auto_ptr<te::da::PrimaryKey>(); }
210 std::auto_ptr<te::da::ForeignKey>
getForeignKey(
const std::string& ,
const std::string& ) {
return std::auto_ptr<te::da::ForeignKey>(); }
212 std::vector<std::string>
getForeignKeyNames(
const std::string& ) {
return std::vector<std::string>(); }
220 std::auto_ptr<te::da::UniqueKey>
getUniqueKey(
const std::string& ,
const std::string& )
221 {
return std::auto_ptr<te::da::UniqueKey>(); }
224 {
return std::vector<std::string>(); }
233 {
return std::auto_ptr<te::da::CheckConstraint>(); }
236 {
return std::vector<std::string>(); }
244 std::auto_ptr<te::da::Index>
getIndex(
const std::string& ,
const std::string& )
245 {
return std::auto_ptr<te::da::Index>(); }
248 {
return std::vector<std::string>(); }
255 void dropIndex(
const std::string& ,
const std::string& ) {}
261 {
return std::auto_ptr<te::da::Sequence>(); }
264 {
return std::vector<std::string>(); }
270 void optimize(
const std::map<std::string, std::string>& ){}
277 std::auto_ptr<te::da::DataSetType> getType(
const std::string& dsfullname);
278 void getDataSetNames(
const boost::filesystem::path& path, std::vector<std::string>& dsnames);
279 bool hasDataSets(
const boost::filesystem::path& path);
280 size_t getNumberOfDataSets(
const boost::filesystem::path& path);
281 std::auto_ptr<te::da::DataSetType> getDataSetType(
const boost::filesystem::path& path,
const std::string& name, std::string& uri);
287 #endif // __TERRALIB_GDAL_INTERNAL_TRANSACTOR_H
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 addUniqueKey(const std::string &, te::da::UniqueKey *)
It adds a unique key constraint to the dataset.
std::vector< std::string > getUniqueKeyNames(const std::string &)
It gets the unique key names of the given dataset.
void rollBack()
It aborts the transaction. Any changes will be rolled-back.
boost::shared_ptr< DataSetType > DataSetTypePtr
void execute(const te::da::Query &)
It executes the specified command using a generic query representation.
CharEncoding
Supported charsets (character encoding).
bool primaryKeyExists(const std::string &, const std::string &)
It checks if a primary key exists in the dataset.
boost::int64_t getLastGeneratedId()
It returns the last id generated by an insertion command.
std::auto_ptr< te::da::Index > getIndex(const std::string &, const std::string &)
It gets the index with the given name from the dataset.
A class that models the description of a dataset.
void addSequence(te::da::Sequence *)
It creates a new sequence in the data source.
#define TEGDALEXPORT
You can use this macro in order to export/import classes and functions from this module.
void dropForeignKey(const std::string &, const std::string &)
It removes the foreign key constraint from the dataset schema.
void addIndex(const std::string &, te::da::Index *, const std::map< std::string, std::string > &)
It adds an index to the dataset.
std::auto_ptr< te::da::BatchExecutor > getBatchExecutor()
It creates a batch command executor.
std::auto_ptr< te::da::PreparedQuery > getPrepared(const std::string &)
It creates a prepared query object that may be used for query commands (select, insert, update and delete) that are used repeatedly.
SpatialRelation
Spatial relations between geometric objects.
It describes a sequence (a number generator).
bool checkConstraintExists(const std::string &, const std::string &)
It checks if a check-constraint with the given name exists in the data source.
A class that describes a check constraint.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
bool isInTransaction() const
It returns true if a transaction is in progress, otherwise, it returns false.
void addPrimaryKey(const std::string &, te::da::PrimaryKey *)
It adds a primary key constraint to the dataset schema.
It models a property definition.
bool uniqueKeyExists(const std::string &, const std::string &)
It checks if a unique key 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)
It adds data items to the dataset in the data source.
AccessPolicy
Supported data access policies (can be used as bitfield).
TraverseType
A dataset can be traversed in two ways:
std::auto_ptr< te::da::UniqueKey > getUniqueKey(const std::string &, const std::string &)
It gets the unique key in the dataset with the given name.
An Envelope defines a 2D rectangular region.
std::vector< std::string > getForeignKeyNames(const std::string &)
It gets the foreign key names of the given dataset.
void begin()
It starts a new transaction.
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...
This class represents a set of unique ids created in the same context. i.e. from the same data set...
std::vector< std::string > getSequenceNames()
It gets the sequence names available in the data source.
void commit()
It commits the transaction.
It models a foreign key constraint for a DataSetType.
It describes a unique key (uk) constraint.
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
void addCheckConstraint(const std::string &, te::da::CheckConstraint *)
It adds a check constraint to the dataset.
std::auto_ptr< te::da::ForeignKey > getForeignKey(const std::string &, const std::string &)
It retrieves the foreign key from the given dataset.
void dropSequence(const std::string &)
It removes the sequence from the data source.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
std::string escape(const std::string &)
It escapes a string for using in commands and queries.
A Select models a query to be used when retrieving data from a DataSource.
std::auto_ptr< te::da::Sequence > getSequence(const std::string &)
It gets the sequence with the given name in the data source.
void dropPrimaryKey(const std::string &)
It removes the primary key constraint from the dataset schema.
A dataset is the unit of information manipulated by the data access module of TerraLib.
It describes a primary key (pk) constraint.
void renameProperty(const std::string &, const std::string &, const std::string &)
It renames a property of the given 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::size_t getNumberOfItems(const std::string &datasetName)
It retrieves the number of items of the given dataset.
void dropUniqueKey(const std::string &, const std::string &)
It removes the unique key constraint from the dataset.
void addForeignKey(const std::string &, te::da::ForeignKey *)
It adds a foreign key constraint to a dataset.
bool sequenceExists(const std::string &)
It checks if a sequence with the given name exists in the data source.
void execute(const std::string &)
It executes the specifed command in the data source native language.
std::auto_ptr< te::da::PrimaryKey > getPrimaryKey(const std::string &)
It retrieves the primary key of the dataset.
std::auto_ptr< te::da::CheckConstraint > getCheckConstraint(const std::string &, const std::string &)
It gets the check constraint of the dataset with the given name.
std::vector< std::string > getIndexNames(const std::string &)
It gets the index names of the given dataset.
void addProperty(const std::string &, te::dt::Property *)
It adds a new property to the dataset schema.
void dropIndex(const std::string &, const std::string &)
It removes the index from the dataset schema.
A Query is independent from the data source language/dialect.
It describes an index associated to a DataSetType.
boost::filesystem::path m_path
std::vector< std::string > getCheckConstraintNames(const std::string &)
It gets the check constraint names of the given dataset.
void cancel()
It requests that the data source stop the processing of the current command.
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.
Configuration flags for the GDAL Driver of TerraLib.
void dropCheckConstraint(const std::string &, const std::string &)
It removes the check constraint from the dataset.