27 #include "../common/STLUtils.h"
28 #include "../common/StringUtils.h"
29 #include "../common/Translator.h"
30 #include "../dataaccess/dataset/DataSet.h"
31 #include "../dataaccess/dataset/DataSetType.h"
32 #include "../dataaccess/dataset/CheckConstraint.h"
33 #include "../dataaccess/dataset/ForeignKey.h"
34 #include "../dataaccess/dataset/Index.h"
35 #include "../dataaccess/dataset/PrimaryKey.h"
36 #include "../dataaccess/dataset/Sequence.h"
37 #include "../dataaccess/dataset/UniqueKey.h"
38 #include "../datatype/DateTimePeriod.h"
47 #include <boost/format.hpp>
48 #include <boost/lexical_cast.hpp>
67 std::map<std::string, DataSet* >::iterator it = m_datasets.begin();
68 while(it!=m_datasets.end())
76 std::map<std::string, te::da::DataSetType* >::iterator it2 = m_schemas.begin();
77 while(it2!=m_schemas.end())
97 m_connInfo = connInfo;
102 return std::auto_ptr<te::da::DataSourceTransactor>(
new Transactor(
this));
113 std::map<std::string, std::string>::const_iterator it = m_connInfo.find(
"MAX_DATASETS");
115 if(it != m_connInfo.end())
116 m_maxdatasets = boost::lexical_cast<std::size_t>(it->second);
119 it = m_connInfo.find(
"OPERATION_MODE");
133 std::map<std::string, DataSet* >::iterator it = m_datasets.begin();
134 while(it!=m_datasets.end())
142 std::map<std::string, te::da::DataSetType* >::iterator it2 = m_schemas.begin();
143 while(it2!=m_schemas.end())
156 m_transactor.reset(0);
171 return sm_capabilities;
181 m_transactor->add(name, t, d);
188 return m_transactor->getDataSet(name, dt, r, travType, connected, accessPolicy);
197 return m_transactor->getDataSet(name, geom, sr, dt, tr, travType, connected, accessPolicy);
206 return m_transactor->getDataSet(name, e, sr, dt, tr, travType, connected, accessPolicy);
209 std::auto_ptr<te::dt::DateTimePeriod>
212 return m_transactor->getTemporalExtent(name);
233 return std::vector<std::string>();
238 return std::vector<te::common::CharEncoding>();
An implementation of DataSourceTransactor class for the ST In-memory driver.
Implements a DataSource that contains st memory DataSets indexed by space and time.
static const std::string sm_driverIdentifier
The STMEMORY driver identifier.
#define TE_STMEMORY_DRIVER_MAX_DATASETS
The maximum number of datasets to be handled by a data source.
A class that models the description of a dataset.
An exception class for the TerraLib ST memory driver.
std::auto_ptr< te::da::DataSourceTransactor > getTransactor()
It returns an object that can execute transactions in the context of a data source.
const std::map< std::string, std::string > & getConnectionInfo() const
It returns the set of parameters used to set up the access channel to the underlying repository...
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
It represents the SQL query dialect accepted by a given data source.
void add(const std::string &name, te::da::DataSetType *t, DataSet *d)
It adds a new DataSet and DataSetType into the DataSource.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
SpatialRelation
Spatial relations between geometric objects.
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
bool isOpened() const
It returns true if the data source is opened, otherwise it returns false.
void setConnectionInfo(const std::map< std::string, std::string > &connInfo)
It sets the connection information to be used when connecting to the data source. ...
bool isValid() const
It checks if the data source is valid (available for using).
std::string getType() const
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL.
A static class with global definitions for the TerraLib ST In-memory driver.
void open()
It opens the data source and makes it ready for using.
std::vector< std::string > getDataSourceNames(const std::map< std::string, std::string > &info)
It gets the data source names available in a driver.
AccessPolicy
Supported data access policies (can be used as bitfield).
TraverseType
A dataset can be traversed in two ways:
std::auto_ptr< te::da::DataSet > getDataSet(const std::string &name, const te::dt::DateTime *dt, te::dt::TemporalRelation r=te::dt::DURING, te::common::TraverseType travType=te::common::FORWARDONLY, bool connected=false, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It returns a data set with observations whose phenomenon times satisfy a given temporal relation...
static te::da::DataSourceCapabilities sm_capabilities
The Memory data source capabilities.
std::auto_ptr< te::dt::DateTimePeriod > getTemporalExtent(const std::string &name)
It returns the temporal extent associated to a DataSet.
An Envelope defines a 2D rectangular region.
const te::da::SQLDialect * getDialect() const
It returns the data source SQL dialect, if there is one.
bool exists(const std::map< std::string, std::string > &dsInfo)
Check the existence of a data source in a driver.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
An implementation of DataSourceTransactor class for the ST in-memory driver.
Implementation of a in-memory data set that contains spatiotemporal observations indexed by time and ...
const te::da::DataSourceCapabilities & getCapabilities() const
It returns the known capabilities of the data source.
void create(const std::map< std::string, std::string > &dsInfo)
protected Methods
void drop(const std::map< std::string, std::string > &dsInfo)
It removes the data source with the connection information from a driver.
static const te::da::SQLDialect sm_dialect
A dummy dialect.
A dataset is the unit of information manipulated by the data access module of TerraLib.
std::vector< te::common::CharEncoding > getEncodings(const std::map< std::string, std::string > &dsInfo)
It gets the encodings for the data source.
void close()
It closes the data source and clears all the resources used by its internal communication channel...