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 bool isDataSetNameValid(
const std::string& datasetName);
79 bool isPropertyNameValid(
const std::string& propertyName);
81 std::vector<std::string> getDataSetNames();
83 std::size_t getNumberOfDataSets();
85 std::auto_ptr<te::da::DataSetType> getDataSetType(
const std::string& name);
87 boost::ptr_vector<te::dt::Property> getProperties(
const std::string& datasetName);
89 std::auto_ptr<te::dt::Property> getProperty(
const std::string& datasetName,
const std::string& name);
91 std::auto_ptr<te::dt::Property> getProperty(
const std::string& datasetName, std::size_t propertyPos);
93 std::vector<std::string> getPropertyNames(
const std::string& datasetName);
95 std::size_t getNumberOfProperties(
const std::string& datasetName);
97 bool propertyExists(
const std::string& datasetName,
const std::string& name);
99 bool propertyExists(
const std::string& datasetName,
size_t propertyPos);
105 void renameProperty(
const std::string& ,
const std::string& ,
const std::string& ) {}
107 std::auto_ptr<te::da::DataSet> getDataSet(
const std::string& name,
109 bool connected =
false,
112 std::auto_ptr<te::da::DataSet> getDataSet(
const std::string& name,
113 const std::string& propertyName,
117 bool connected =
false,
120 std::auto_ptr<te::da::DataSet> getDataSet(
const std::string& name,
121 const std::string& propertyName,
125 bool connected =
false,
128 std::auto_ptr<te::da::DataSet> getDataSet(
const std::string& name,
131 bool connected =
false,
136 bool connected =
false,
139 std::auto_ptr<te::da::DataSet> query(
const std::string& query,
141 bool connected =
false,
148 bool dataSetExists(
const std::string& name);
151 const std::map<std::string, std::string>& options);
153 void cloneDataSet(
const std::string& name,
154 const std::string& cloneName,
155 const std::map<std::string, std::string>& options) ;
157 void dropDataSet(
const std::string& name);
159 void renameDataSet(
const std::string& name,
160 const std::string& newName);
162 void add(
const std::string& ,
164 const std::map<std::string, std::string>& ,
167 void remove(
const std::string& ,
172 const std::vector<std::size_t>& ,
174 const std::map<std::string, std::string>& ,
177 std::auto_ptr<te::gm::Envelope> getExtent(
const std::string& datasetName,
178 const std::string& propertyName);
180 std::auto_ptr<te::gm::Envelope> getExtent(
const std::string& datasetName,
181 std::size_t propertyPos);
195 std::auto_ptr<te::da::PreparedQuery>
getPrepared(
const std::string& ) {
return std::auto_ptr<te::da::PreparedQuery>(); }
197 std::auto_ptr<te::da::BatchExecutor>
getBatchExecutor() {
return std::auto_ptr<te::da::BatchExecutor>(); }
203 std::string
escape(
const std::string& ) {
return std::string(
""); }
206 {
return std::auto_ptr<te::da::PrimaryKey>(); }
214 std::auto_ptr<te::da::ForeignKey>
getForeignKey(
const std::string& ,
const std::string& ) {
return std::auto_ptr<te::da::ForeignKey>(); }
216 std::vector<std::string>
getForeignKeyNames(
const std::string& ) {
return std::vector<std::string>(); }
224 std::auto_ptr<te::da::UniqueKey>
getUniqueKey(
const std::string& ,
const std::string& )
225 {
return std::auto_ptr<te::da::UniqueKey>(); }
228 {
return std::vector<std::string>(); }
237 {
return std::auto_ptr<te::da::CheckConstraint>(); }
240 {
return std::vector<std::string>(); }
248 std::auto_ptr<te::da::Index>
getIndex(
const std::string& ,
const std::string& )
249 {
return std::auto_ptr<te::da::Index>(); }
252 {
return std::vector<std::string>(); }
259 void dropIndex(
const std::string& ,
const std::string& ) {}
265 {
return std::auto_ptr<te::da::Sequence>(); }
268 {
return std::vector<std::string>(); }
274 void optimize(
const std::map<std::string, std::string>& ){}
279 std::auto_ptr<te::da::DataSetType> getType(
const std::string& dsfullname);
280 void getDataSetNames(
const boost::filesystem::path& path, std::vector<std::string>& dsnames);
281 bool hasDataSets(
const boost::filesystem::path& path);
282 size_t getNumberOfDataSets(
const boost::filesystem::path& path);
283 std::auto_ptr<te::da::DataSetType> getDataSetType(
const boost::filesystem::path& path,
const std::string& name, std::string& uri);
289 #endif // __TERRALIB_GDAL_INTERNAL_TRANSACTOR_H
Configuration flags for the GDAL Driver of TerraLib.
void begin()
It starts a new transaction.
It describes an index associated to a DataSetType.
void dropSequence(const std::string &)
It removes the sequence from the data source.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
bool primaryKeyExists(const std::string &, const std::string &)
It checks if a primary key exists in the dataset.
void addCheckConstraint(const std::string &, te::da::CheckConstraint *)
It adds a check constraint to the dataset.
boost::filesystem::path m_path
std::auto_ptr< te::da::BatchExecutor > getBatchExecutor()
It creates a batch command executor.
A Select models a query to be used when retrieving data from a DataSource.
void addSequence(te::da::Sequence *)
It creates a new sequence in the data source.
void addProperty(const std::string &, te::dt::Property *)
It adds a new property to the dataset schema.
bool indexExists(const std::string &, const std::string &)
It checks if an index with the given name exists in 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 > getSequenceNames()
It gets the sequence names available in the data source.
It describes a primary key (pk) constraint.
void execute(const std::string &)
It executes the specifed command in the data source native language.
void dropPrimaryKey(const std::string &)
It removes the primary key constraint from the dataset schema.
It describes a sequence (a number generator).
SpatialRelation
Spatial relations between geometric objects.
It models a foreign key constraint for a DataSetType.
boost::int64_t getLastGeneratedId()
It returns the last id generated by an insertion command.
void addUniqueKey(const std::string &, te::da::UniqueKey *)
It adds a unique key constraint to the dataset.
AccessPolicy
Supported data access policies (can be used as bitfield).
bool isInTransaction() const
It returns true if a transaction is in progress, otherwise, it returns false.
bool checkConstraintExists(const std::string &, const std::string &)
It checks if a check-constraint with the given name exists in the data source.
std::vector< std::string > getForeignKeyNames(const std::string &)
It gets the foreign key names of the given dataset.
std::vector< std::string > getUniqueKeyNames(const std::string &)
It gets the unique key names of the given dataset.
A Query is independent from the data source language/dialect.
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.
std::string escape(const std::string &)
It escapes a string for using in commands and queries.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
std::auto_ptr< te::da::Sequence > getSequence(const std::string &)
It gets the sequence with the given name 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.
void execute(const te::da::Query &)
It executes the specified command using a generic query representation.
std::size_t getNumberOfItems(const std::string &datasetName)
It retrieves the number of items of the given dataset.
void dropIndex(const std::string &, const std::string &)
It removes the index from the dataset schema.
It describes a unique key (uk) constraint.
void commit()
It commits the transaction.
void addIndex(const std::string &, te::da::Index *, const std::map< std::string, std::string > &)
It adds an index to the dataset.
void rollBack()
It aborts the transaction. Any changes will be rolled-back.
std::auto_ptr< te::da::ForeignKey > getForeignKey(const std::string &, const std::string &)
It retrieves the foreign key from the given dataset.
void addPrimaryKey(const std::string &, te::da::PrimaryKey *)
It adds a primary key constraint to the dataset schema.
bool sequenceExists(const std::string &)
It checks if a sequence with the given name exists 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.
TraverseType
A dataset can be traversed in two ways:
void dropProperty(const std::string &, const std::string &)
It removes a property from the given dataset.
std::auto_ptr< te::da::Index > getIndex(const std::string &, const std::string &)
It gets the index with the given name from the dataset.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
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.
A class that models the description of a dataset.
void cancel()
It requests that the data source stop the processing of the current command.
bool uniqueKeyExists(const std::string &, const std::string &)
It checks if a unique key with the given name exists in the dataset.
boost::shared_ptr< DataSetType > DataSetTypePtr
It models a property definition.
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...
void dropUniqueKey(const std::string &, const std::string &)
It removes the unique key constraint from the dataset.
std::vector< std::string > getIndexNames(const std::string &)
It gets the index names of the given dataset.
std::auto_ptr< te::da::PrimaryKey > getPrimaryKey(const std::string &)
It retrieves the primary key of the dataset.
std::vector< std::string > getCheckConstraintNames(const std::string &)
It gets the check constraint names of the given dataset.
A class that describes a check constraint.
An Envelope defines a 2D rectangular region.
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.
void addForeignKey(const std::string &, te::da::ForeignKey *)
It adds a foreign key constraint to 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...
void renameProperty(const std::string &, const std::string &, const std::string &)
It renames a property of the given dataset.
void dropForeignKey(const std::string &, const std::string &)
It removes the foreign key constraint from the dataset schema.
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.