All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::da::DataSetType Class Reference

A class that models the description of a dataset. More...

#include <DataSetType.h>

Inheritance diagram for te::da::DataSetType:
te::dt::CompositeProperty te::dt::Property

Public Member Functions

void add (Property *p)
 It adds a new property to the CompositeProperty. More...
 
void add (const std::vector< Property * > &ps)
 It adds a list of property types to the CompositeProperty. More...
 
void add (const boost::ptr_vector< te::dt::Property > &ps)
 
void copy (const std::vector< Property * > &ps)
 It copies the properties from the vector. More...
 
PropertyfindFirstPropertyOfType (const int t) const
 returns the first property of the given data type. Caller doesn't take ownership of the returned pointer. More...
 
const std::string & getCompositeName () const
 It returns the name of the composite type. More...
 
const std::string & getDatasetName () const
 It returns the name of the propery's dataset. More...
 
unsigned int getId () const
 It returns the property identifier. More...
 
const std::string & getName () const
 It returns the property name. More...
 
PropertygetParent () const
 It returns the parent of this property, or NULL, if it doesn't have one. More...
 
const std::vector< Property * > & getProperties () const
 It returns the list of properties describing the CompositeProperty. More...
 
std::vector< Property * > & getProperties ()
 It returns the list of properties describing the CompositeProperty. More...
 
PropertygetProperty (std::size_t i) const
 It returns the i-th property. More...
 
PropertygetProperty (const std::string &name) const
 It returns the property with the given name or NULL if none is found. More...
 
PropertygetPropertyById (unsigned int id) const
 It searches for a property with the given ID. More...
 
std::size_t getPropertyPosition (const std::string &name) const
 It returns the property position based on its name. More...
 
std::size_t getPropertyPosition (const Property *p) const
 It returns the property position . More...
 
int getType () const
 It returns the property data type. More...
 
bool has (Property *p) const
 It checks if the Property "p" is associated to this property or any other parent. More...
 
bool hasPropertyOfType (const int t) const
 Tells if there is a property of the given data type. More...
 
virtual void remove (Property *p)
 It removes the property from the composite. More...
 
void setCompositeName (const std::string &cname)
 It sets the composite type name. More...
 
void setDatasetName (const std::string &dsName)
 It sets the property name. More...
 
void setId (unsigned int id)
 It sets the property identifier. More...
 
void setName (const std::string &name)
 It sets the property name. More...
 
void setParent (Property *p)
 It associate this property to the informed parent. More...
 
std::size_t size () const
 It returns the number of properties of the CompositeProperty. More...
 
DataSetType Basic Methods

Basic methods for a DataSetType.

 DataSetType (const std::string &name, unsigned int id=0)
 It creates a new DataSetType not associated to any DataSetType or Catalog. More...
 
 DataSetType (const DataSetType &rhs)
 Copy constructor. More...
 
 ~DataSetType ()
 
DataSetTypeoperator= (const DataSetType &rhs)
 Assignment operator not allowed. More...
 
General Descriptive Methods

Methods for obtainning information about a given dataset.

const std::string & getTitle () const
 A human descriptive title for the DataSetType. More...
 
void setTitle (const std::string &title)
 It sets a human descriptive title for the DataSetType. More...
 
bool hasGeom () const
 It returns true if the DataSetType has at least one geometry property; otherwise, it returns false. More...
 
bool hasRaster () const
 It returns true if the DataSetType has at least one raster property; otherwise, it returns false. More...
 
DataSourceCataloggetCatalog () const
 It returns the catalog that owns the DataSetType. More...
 
void setCatalog (DataSourceCatalog *catalog)
 It sets the DataSetType associated catalog. More...
 
int getCategory () const
 It returns the dataset category. More...
 
void setCategory (int c)
 It sets the dataset category. More...
 
Primary Key Methods

Methods for managing Primary Key

void setPrimaryKey (PrimaryKey *pk)
 It sets the primary key constraint. More...
 
PrimaryKeygetPrimaryKey () const
 It returns the primary key associated to the dataset type. More...
 
Constraint Methods

Methods for managing constraints

void add (Constraint *c)
 It adds a new constraint. More...
 
void remove (Constraint *c)
 It removes the constraint. More...
 
Unique Keys Methods

Methods for managing Unique Keys

std::size_t getNumberOfUniqueKeys () const
 It returns the number of unique keys defined for the dataset type. More...
 
void add (const std::vector< UniqueKey * > &uks)
 It adds the unique key constraints. More...
 
UniqueKeygetUniqueKey (std::size_t i) const
 It returns the i-th unique key. More...
 
UniqueKeygetUniqueKey (const std::string &name) const
 It returns a unique key with the given name or NULL if none is found. More...
 
void remove (UniqueKey *uk)
 It removes the unique key. More...
 
void clearUniqueKeys ()
 It removes all unique keys from the dataset type. More...
 
Check Constraint Methods

Methods for managing Check Constraints

std::size_t getNumberOfCheckConstraints () const
 It returns the number of check-constraints defined over the dataset type. More...
 
void add (const std::vector< CheckConstraint * > &ccs)
 It adds the check constraints. More...
 
CheckConstraintgetCheckConstraint (std::size_t i) const
 It returns the i-th check-constraint associated to the dataset type. More...
 
CheckConstraintgetCheckConstraint (const std::string &name) const
 It returns a check-constraint with the given name or NULL if none is found. More...
 
void remove (CheckConstraint *cc)
 It removes the check constraint. More...
 
void clearCheckConstraints ()
 It removes all check constraints. More...
 
Index Methods

Methods for managing Indexes

std::size_t getNumberOfIndexes () const
 It returns the number of indexes defined for the dataset type. More...
 
void add (Index *idx)
 It adds a new index. More...
 
void add (const std::vector< Index * > &idxs)
 It adds all the indexes. More...
 
IndexgetIndex (std::size_t i) const
 It returns the i-th index associated to the dataset type. More...
 
IndexgetIndex (const std::string &name) const
 It returns an index with the given name or NULL if none is found. More...
 
void remove (Index *idx)
 It removes the index. More...
 
void clearIndexes ()
 It removes all indexes from the dataset type. More...
 
Foreign Key Methods

Methods for managing foreign Keys

std::size_t getNumberOfForeignKeys () const
 It returns the number of foreign keys defined for the dataset type. More...
 
ForeignKeygetForeignKey (std::size_t i) const
 It returns the i-th foreign key associated to the dataset type. More...
 
ForeignKeygetForeignKey (const std::string &name) const
 It returns a foreign key with the given name or NULL if none is found. More...
 
void add (ForeignKey *fk)
 It adds a new foreign key. More...
 
void remove (ForeignKey *fk)
 It removes the foreign key. More...
 
Re-implementation from CompositeProperty

Re-implementation from CompositeProperty.

void remove (Property *p)
 It removes the Property. More...
 
void clear ()
 It clears the DataSetType definition. More...
 
Auxiliary Methods

Auxiliary methods.

void replace (Property *p, Property *pp)
 It replaces the property p by pp and adjust all pointers inclusive in the catalog. More...
 
Implementation From Superclass Property

Methods re-implemented from the superclass Property.

Propertyclone () const
 It returns a clone of the object. More...
 

Protected Member Functions

Protected Helper Methods

Methods for dealing with some regular tasks related to DataSetType constraints.

void removeUniqueKeys (Property *p)
 It removes all unique keys related to the given Property. More...
 
void removeIndexes (Property *p)
 It removes all indexes related to the given Property. More...
 
void removeForeignKeys (Property *p)
 It removes all foreign keys that p takes part and all foreign keys that references p. More...
 

Protected Attributes

std::string m_cname
 The composite type name. More...
 
std::string m_datasetName
 The property's dataset name. More...
 
unsigned int m_id
 An identification number that can be used internally. More...
 
std::string m_name
 The property name. More...
 
Propertym_parent
 The parent property type: it must be a CompositeProperty. More...
 
std::vector< Property * > m_properties
 The list of property types that make the CompositeProperty. More...
 
int m_type
 The property data type. More...
 

Private Attributes

DataSourceCatalogm_catalog
 The associated catalog. More...
 
int m_category
 A category. More...
 
std::vector< CheckConstraint * > m_checkConstraints
 A vector of check constraints. More...
 
std::vector< ForeignKey * > m_foreignKeys
 A vector of foreign key constraints. More...
 
std::vector< Index * > m_idxs
 A vector of indexes. More...
 
PrimaryKeym_pk
 The DataSetType primary key. More...
 
std::string m_title
 A brief description of the DataSetType. More...
 
std::vector< UniqueKey * > m_uniqueKeys
 A vector of unique key constraints. More...
 

Detailed Description

A class that models the description of a dataset.

A DataSetType may be used to describe the dataset schema. It lists the attributes of the dataset, including their names and types.

The information about the properties (or attributes) of datasets are stored in instances of the Property class. To a property it is associated a name, the data type and other metadata necessary to fully specify the type, such as the attribute size.

Note
This class sometimes are referred to as dataset schemas.
See also
DataSet, te::dt::Property, te::dt::CompositeProperty, DataSourceCatalog

Definition at line 72 of file DataSetType.h.

Constructor & Destructor Documentation

te::da::DataSetType::DataSetType ( const std::string &  name,
unsigned int  id = 0 
)

It creates a new DataSetType not associated to any DataSetType or Catalog.

By default the DataSetType doesn't have a geometric property nor a default geometry property.

Parameters
nameThe DataSetType name.
idThe DataSetType identifier.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 45 of file DataSetType.cpp.

te::da::DataSetType::~DataSetType ( )

Destructor

Definition at line 204 of file DataSetType.cpp.

References te::common::FreeContents().

Member Function Documentation

void te::dt::CompositeProperty::add ( Property p)
inherited

It adds a new property to the CompositeProperty.

Parameters
pThe property to be inserted.
Precondition
The Property p must be valid.
The Property p must not be associated to another property.
Postcondition
The property p will be associated to CompositeProperty.
The CompositeProperty takes the ownership of the property.

Definition at line 70 of file CompositeProperty.cpp.

References te::dt::Property::getParent(), and te::dt::Property::setParent().

void te::dt::CompositeProperty::add ( const std::vector< Property * > &  ps)
inherited

It adds a list of property types to the CompositeProperty.

Parameters
psThe list of properties to be added.
Precondition
The properties must be valid.
The properties must not be associated to another property.
Note
The CompositeProperty takes the ownership of the properties.

Definition at line 77 of file CompositeProperty.cpp.

void te::dt::CompositeProperty::add ( const boost::ptr_vector< te::dt::Property > &  ps)
inherited
void te::da::DataSetType::add ( Constraint c)

It adds a new constraint.

A constraint can be a: foreign key, unique key, check constraint or primary key

Parameters
cThe constraint to be added to the DataSetType.
Precondition
Don't inform a NULL pointer.
For foreign keys, if the DataSetType is associated to a DataSourceCatalog the DataSetType referenced in the foreign key must already be in the catalog.
Postcondition
The constraint will be attached to the DataSetType.
The DataSetType will take the ownership of the informed constraint.
For foreign keys, if the DataSetType is associated to a DataSourceCatalog, this method will register in the catalog an association between the foreign key and its referenced DataSetType.
Exceptions
ExceptionFor foreign keys, it throws an exception if the DataSetType is associated to a DataSourceCatalog and the foreign key is referencing another DataSetType that is not.

Definition at line 236 of file DataSetType.cpp.

References te::da::CHECK, te::da::FOREIGN_KEY, te::da::Constraint::getType(), te::da::PRIMARY_KEY, te::da::Constraint::setDataSetType(), and te::da::UNIQUE_KEY.

Referenced by te::stmem::Transactor::addPrimaryKey(), te::da::CheckConstraint::CheckConstraint(), te::sqlite::Convert2TerraLib(), te::ogr::Convert2TerraLib(), te::ado::DataSource::create(), te::cellspace::CellularSpacesOperations::createCellularDataSetType(), te::vp::IntersectionMemory::createDataSetType(), te::graph::DataSourceGraphMetadata::createGraphAttributesTable(), te::graph::DataSourceGraphMetadata::createGraphMetadataTable(), te::graph::DataSourceGraphMetadata::createGraphTableEdgeModel(), te::graph::DataSourceGraphMetadata::createVertexAttrTable(), te::pgis::Transactor::getConstraints(), te::vp::BufferOp::GetDataSetType(), te::vp::GeometricOp::GetDataSetType(), te::cl::ROISet::getDataSetType(), te::wcs::Transactor::getDataSetType(), te::wms::Transactor::getDataSetType(), te::pgis::Transactor::getDataSetType(), te::sqlite::DataSourceCatalogLoader::getIndex(), te::ado::Transactor::getIndexes(), te::attributefill::VectorToVectorMemory::getOutputDataSetType(), te::ado::Transactor::getProperties(), te::map::RasterLayer::getSchema(), te::gdal::Transactor::getType(), te::sqlite::DataSourceCatalogLoader::getUniqueKey(), te::da::Index::Index(), te::da::LoadFull(), te::da::LoadProperties(), te::da::PrimaryKey::PrimaryKey(), terralib4::TableDataSet::TableDataSet(), te::da::UniqueKey::UniqueKey(), and terralib4::VectorDataSet::VectorDataSet().

void te::da::DataSetType::add ( const std::vector< UniqueKey * > &  uks)

It adds the unique key constraints.

Parameters
uksThe unique key constraints to be added to the DataSetType.
Precondition
Don't inform NULL pointers in the list.
Postcondition
The unique key constraints will be attached to the DataSetType.
The DataSetType will take the ownership of the informed unique key constraints.

Definition at line 292 of file DataSetType.cpp.

void te::da::DataSetType::add ( const std::vector< CheckConstraint * > &  ccs)

It adds the check constraints.

Parameters
ccsThe check constraints to be added to the DataSetType.
Precondition
Don't inform NULL pointers in the list.
Postcondition
The check constraints will be attached to the DataSetType.
The DataSetType will take the ownership of the informed check constraints.

Definition at line 334 of file DataSetType.cpp.

void te::da::DataSetType::add ( Index idx)

It adds a new index.

Parameters
idxThe index to be added to the DataSetType.
Precondition
Don't inform a NULL pointer.
Postcondition
The index will be attached to the DataSetType.
The DataSetType will take the ownership of the informed index.

Definition at line 376 of file DataSetType.cpp.

References te::da::Index::setDataSetType().

void te::da::DataSetType::add ( const std::vector< Index * > &  idxs)

It adds all the indexes.

Parameters
idxsA list of indexes to be added to the DataSetType.
Precondition
Don't inform a NULL pointer in the list.
Postcondition
The indexes will be attached to the DataSetType.
The DataSetType will take the ownership of the informed indexes.

Definition at line 383 of file DataSetType.cpp.

void te::da::DataSetType::add ( ForeignKey fk)

It adds a new foreign key.

Parameters
fkThe foreign key to be added to the DataSetType.
Precondition
Don't inform a NULL pointer or a fk associated to another DataSetType.
If the DataSetType is associated to a DataSourceCatalog the DataSetType referenced in the foreign key must already be in the catalog.
Postcondition
The foreign key will be attached to the DataSetType.
The DataSetType will take the ownership of the informed foreign key.
If the DataSetType is associated to a DataSourceCatalog, this method will register in the catalog an association between the fk and its referenced DataSetType.
Exceptions
ExceptionIt throws an exception if the DataSetType is associated to a DataSourceCatalog and the fk is referencing another DataSetType that is not.

Definition at line 480 of file DataSetType.cpp.

References te::da::Constraint::setDataSetType().

void te::da::DataSetType::clear ( )
virtual

It clears the DataSetType definition.

Reimplemented from te::dt::CompositeProperty.

Definition at line 539 of file DataSetType.cpp.

void te::da::DataSetType::clearCheckConstraints ( )

It removes all check constraints.

Definition at line 370 of file DataSetType.cpp.

References te::common::FreeContents().

void te::da::DataSetType::clearIndexes ( )

It removes all indexes from the dataset type.

Definition at line 442 of file DataSetType.cpp.

Referenced by te::sqlite::DataSourceCatalogLoader::getIndexes().

void te::da::DataSetType::clearUniqueKeys ( )

It removes all unique keys from the dataset type.

Definition at line 328 of file DataSetType.cpp.

References te::common::FreeContents().

Referenced by te::sqlite::DataSourceCatalogLoader::getUniqueKeys().

te::dt::Property * te::da::DataSetType::clone ( ) const
virtual

It returns a clone of the object.

The new DataSetType will not be associated to any DataSourceCatalog. All associated constraints names, like indexes, unique keys, primary keys, foreign keys and check constraints will preserve the name. This is also true for the DataSetType name. So, be carefull when trying to persist the DataSetType in the same data source as the cloned dataset type.

Foreign keys are copied and will reference the same objects as the cloned object.

Returns
A clone of the object.

Reimplemented from te::dt::CompositeProperty.

Definition at line 616 of file DataSetType.cpp.

Referenced by te::stmem::Transactor::getDataSetType().

void te::dt::CompositeProperty::copy ( const std::vector< Property * > &  ps)
inherited

It copies the properties from the vector.

Parameters
psThe list of properties to be copied.
Note
The CompositeProperty will not take the ownership of the properties, it will clone each one. So, it is the caller responsability to release them.

Definition at line 164 of file CompositeProperty.cpp.

References te::dt::Property::clone(), and te::dt::Property::setParent().

Referenced by te::dt::CompositeProperty::CompositeProperty().

Property * te::dt::CompositeProperty::findFirstPropertyOfType ( const int  t) const
inlineinherited
DataSourceCatalog* te::da::DataSetType::getCatalog ( ) const
inline

It returns the catalog that owns the DataSetType.

Returns
The catalog associated to the DataSetType.

Definition at line 158 of file DataSetType.h.

Referenced by te::da::DataSourceCatalog::remove(), and te::da::DataSourceCatalog::rename().

int te::da::DataSetType::getCategory ( ) const
inline

It returns the dataset category.

Some drivers and applications can use this value to refine their functionalities.

Returns
The dataset category.

Definition at line 177 of file DataSetType.h.

Referenced by te::sqlite::DataSourceCatalogLoader::getSpatialIndexes().

CheckConstraint* te::da::DataSetType::getCheckConstraint ( std::size_t  i) const
inline

It returns the i-th check-constraint associated to the dataset type.

Parameters
iThe check-constraint position.
Returns
The i-th check-constraint associated to the dataset type.
Precondition
i must be in the valid range [0, getNumberOfCheckConstraints()).

Definition at line 354 of file DataSetType.h.

Referenced by te::pgis::Transactor::createDataSet(), and DSInfo::getCheckConstraintInfo().

te::da::CheckConstraint * te::da::DataSetType::getCheckConstraint ( const std::string &  name) const

It returns a check-constraint with the given name or NULL if none is found.

Parameters
nameThe check-constraint name.
Returns
A check-constraint with the given name or NULL if none exist.

Definition at line 342 of file DataSetType.cpp.

const std::string& te::dt::CompositeProperty::getCompositeName ( ) const
inlineinherited

It returns the name of the composite type.

Returns
The name of the composite type.
Note
This name may be different from the property name (returned by getName method)!

Definition at line 96 of file CompositeProperty.h.

const std::string& te::dt::Property::getDatasetName ( ) const
inlineinherited

It returns the name of the propery's dataset.

Returns
The the propery's dataset name.

Definition at line 144 of file Property.h.

Referenced by te::da::GetOIDDatasetProps().

ForeignKey* te::da::DataSetType::getForeignKey ( std::size_t  i) const
inline

It returns the i-th foreign key associated to the dataset type.

Parameters
iThe foreign key position.
Returns
The i-th foreign key associated to the dataset type.
Precondition
i must be in the valid range [0, getNumberOfForeignKeys()).
Note
It doesn't make range check!

Definition at line 480 of file DataSetType.h.

Referenced by te::da::DataSourceCatalog::checkFKsDependency(), te::sqlite::DataSourceTransactor::createDataSet(), te::pgis::Transactor::createDataSet(), DSInfo::getForeignKeyInfo(), and te::da::DataSourceCatalog::indexFKs().

te::da::ForeignKey * te::da::DataSetType::getForeignKey ( const std::string &  name) const

It returns a foreign key with the given name or NULL if none is found.

Parameters
nameThe foreign key name.
Returns
A foreign key with the given name or NULL if none exist.

Definition at line 467 of file DataSetType.cpp.

unsigned int te::dt::Property::getId ( ) const
inlineinherited

It returns the property identifier.

Returns
A number used to identify the property.
Warning
The identifier value may be used by data source implementations. So, don't rely on its value!

Definition at line 109 of file Property.h.

Referenced by te::da::DataSetTypeConverter::DataSetTypeConverter(), te::pgis::Transactor::getConstraints(), te::pgis::Transactor::getIndexes(), te::pgis::Transactor::getPropertyId(), and te::serialize::xml::Save().

Index* te::da::DataSetType::getIndex ( std::size_t  i) const
inline

It returns the i-th index associated to the dataset type.

Parameters
iThe index position.
Returns
The i-th index associated to the dataset type.
Precondition
i must be in the valid range [0, getNumberOfIndexes()).
Note
It doesn't make range check!

Definition at line 428 of file DataSetType.h.

Referenced by te::pgis::Transactor::createDataSet(), and DSInfo::getIndexesKeyInfo().

te::da::Index * te::da::DataSetType::getIndex ( const std::string &  name) const

It returns an index with the given name or NULL if none is found.

Parameters
nameThe index name.
Returns
An index with the given name or NULL.

Definition at line 391 of file DataSetType.cpp.

const std::string& te::dt::Property::getName ( ) const
inlineinherited

It returns the property name.

Returns
The property name.
Note
For DataSetTypes the name can have namespace prefix or schema name prefix, it will depend on the data source implementation.

Definition at line 127 of file Property.h.

Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::DataSourceGraphMetadata::addEdgeProperty(), te::ado::Transactor::addForeignKey(), te::pgis::Transactor::addForeignKey(), te::sa::AddGraphEdgeAttribute(), te::sa::AddGraphVertexAttribute(), te::ado::Transactor::addPrimaryKey(), te::mem::DataSource::addProperty(), te::ogr::Transactor::addProperty(), te::sqlite::DataSourceTransactor::addProperty(), te::ado::Transactor::addProperty(), terralib4::Transactor::addProperty(), te::pgis::Transactor::addProperty(), te::graph::AddRasterAttribute::AddRasterAttribute(), te::da::DataSourceCatalog::addRef(), te::pgis::Transactor::addSequence(), te::ado::Transactor::addUniqueKey(), te::graph::DataSourceGraphMetadata::addVertexProperty(), te::vp::PolygonToLineOp::buildOutDataSetType(), te::vp::LineToPolygonOp::buildOutDataSetType(), te::sa::KernelMapOperation::buildTree(), te::sa::KernelRatioOperation::buildTree(), te::da::DataSourceCatalog::checkFKsDependency(), te::da::DataSourceCatalog::checkSequenceDependency(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::qt::widgets::ConstraintWidget::ConstraintWidget(), te::ogr::Convert2OGR(), te::sqlite::Convert2SQLCreate(), te::da::Create(), te::da::CreateAdapter(), te::mem::DataSource::createDataSet(), te::gdal::Transactor::createDataSet(), te::ogr::Transactor::createDataSet(), te::sqlite::DataSourceTransactor::createDataSet(), te::ado::Transactor::createDataSet(), te::pgis::Transactor::createDataSet(), te::vp::IntersectionMemory::createDataSetType(), te::sa::GeneralizedProximityMatrix::createDataSetType(), DataSetAdapterLayerReader(), DataSetAdapterLayerWriter(), te::qt::widgets::DataSetOptionsWizardPage::datasetPressed(), DataSetType(), te::da::DataSetTypeConverter::DataSetTypeConverter(), te::qt::widgets::DataSetDisplay::draw(), te::map::QueryLayerRenderer::draw(), te::map::AbstractLayerRenderer::draw(), te::map::DrawGeometries(), te::map::DrawRaster(), te::da::DataSourceCatalog::dropDependentSequenceEntry(), te::da::DataSourceCatalog::dropDependentSequences(), te::ado::Transactor::dropProperty(), te::qt::widgets::DataExchangerWizard::exchange(), te::qt::widgets::DirectExchangerDialog::exchangeToDatabase(), te::qt::widgets::Selection::executeSelection(), te::qt::widgets::DataSetCategoryItem::fetchMore(), te::qt::widgets::DataSetGroupItem::fetchMore(), te::qt::widgets::DataSetAdapterWidget::fillDataSetTable(), generateLayer(), te::ado::Transactor::getCheckConstraints(), te::pgis::Transactor::getConstraints(), terralib4::Transactor::getDataSetType(), te::sa::GPMWeightsAbstractStrategy::getDistanceAttributeIndex(), te::da::GetEmptyOIDSet(), te::sqlite::DataSourceCatalogLoader::getGeometryInfo(), te::pgis::Transactor::getGeometryInfo(), te::sa::GeneralizedProximityMatrix::getGPMPropertyMap(), te::sa::GetGraphEdgeAttrIndex(), te::sa::GetGraphVertexAttrIndex(), te::sqlite::DataSourceCatalogLoader::getIndex(), te::sqlite::DataSourceCatalogLoader::getIndexes(), te::ado::Transactor::getIndexes(), te::pgis::Transactor::getIndexes(), te::qt::widgets::Info::getInfo(), te::qt::widgets::ClassifierWizardPage::getInputParams(), te::qt::widgets::ClippingWizardPage::getLayerClipping(), te::attributefill::VectorToVectorMemory::getOutputDataSetType(), te::sqlite::DataSourceCatalogLoader::getPrimaryKey(), te::ado::Transactor::getPrimaryKey(), te::ado::Transactor::getProperties(), te::pgis::Transactor::getPropertyId(), te::da::GetPropertyInfo(), te::attributefill::VectorToVectorMemory::getPropertyName(), te::stmem::Transactor::getPropertyNames(), te::da::GetPropertyPos(), te::pgis::Transactor::getRasterInfo(), te::map::QueryLayer::getSchema(), te::sqlite::DataSourceCatalogLoader::getSpatialIndexes(), te::da::GetSQLValueNames(), te::sqlite::DataSourceCatalogLoader::getUniqueKey(), te::sqlite::DataSourceCatalogLoader::getUniqueKeys(), te::ado::Transactor::getUniqueKeys(), te::da::DataSourceCatalog::indexFKs(), te::da::DataSourceCatalog::indexSequenceDependency(), te::qt::widgets::IndexWidget::IndexWidget(), te::edit::FeatureAttributesDialog::initialize(), te::ado::Transactor::insertIntoGeometryColumns(), te::qt::widgets::ChartLayerWidget::listAttributes(), te::qt::widgets::GroupingWidget::listAttributes(), te::da::LoadFull(), te::da::LoadProperties(), te::qt::widgets::GroupingWidget::onImportPushButtonClicked(), te::qt::widgets::DatapPropertiesWidget::onInputDataToolButtonTriggered(), te::sa::SpatialStatisticsDialog::onOkPushButtonClicked(), te::qt::widgets::SHP2PostGISDialog::onOkPushButtonClicked(), te::qt::widgets::DataPropertiesDialog::onOkPushButtonClicked(), te::qt::widgets::ROIManagerWidget::onPointPicked(), te::attributefill::RasterToVectorDialog::onRasterComboBoxChanged(), te::qt::widgets::DataSet2Layer::operator()(), te::da::DataSourceCatalog::remove(), te::graph::DataSourceGraphMetadata::removeEdgeProperty(), te::da::DataSourceCatalog::removeRef(), te::graph::DataSourceGraphMetadata::removeVertexProperty(), te::da::DataSourceCatalog::rename(), te::qt::widgets::DataSetTableView::retypeColumn(), te::vp::LineToPolygonMemory::run(), te::vp::PolygonToLineMemory::run(), te::vp::AggregationQuery::run(), te::vp::BufferQuery::run(), te::vp::IntersectionQuery::run(), te::vp::AggregationMemory::run(), te::attributefill::VectorToRaster::run(), te::attributefill::RasterToVector::run(), te::addressgeocoding::AddressGeocodingOp::run(), te::attributefill::VectorToVectorMemory::run(), te::serialize::xml::Save(), te::qt::widgets::DataSetOptionsWizardPage::set(), te::qt::widgets::PropertyConverterDialog::set(), te::attributefill::VectorToVectorDialog::setFunctionsByLayer(), and terralib4::TableDataSet::TableDataSet().

std::size_t te::da::DataSetType::getNumberOfCheckConstraints ( ) const
inline

It returns the number of check-constraints defined over the dataset type.

Returns
The number of check-constraints defined over the dataset type.

Definition at line 331 of file DataSetType.h.

Referenced by te::pgis::Transactor::createDataSet(), and DSInfo::getCheckConstraintInfo().

std::size_t te::da::DataSetType::getNumberOfForeignKeys ( ) const
inline

It returns the number of foreign keys defined for the dataset type.

Returns
The number of foreign keys defined for the dataset type.

Definition at line 467 of file DataSetType.h.

Referenced by te::da::DataSourceCatalog::checkFKsDependency(), te::sqlite::DataSourceTransactor::createDataSet(), te::pgis::Transactor::createDataSet(), DSInfo::getForeignKeyInfo(), and te::da::DataSourceCatalog::indexFKs().

std::size_t te::da::DataSetType::getNumberOfIndexes ( ) const
inline

It returns the number of indexes defined for the dataset type.

Returns
The number of indexes defined for the dataset type.

Definition at line 391 of file DataSetType.h.

Referenced by te::pgis::Transactor::createDataSet(), and DSInfo::getIndexesKeyInfo().

std::size_t te::da::DataSetType::getNumberOfUniqueKeys ( ) const
inline

It returns the number of unique keys defined for the dataset type.

Returns
The number of unique keys defined for the dataset type.

Definition at line 269 of file DataSetType.h.

Referenced by te::pgis::Transactor::createDataSet(), te::sqlite::DataSourceCatalogLoader::getIndex(), te::da::GetOIDPropertyNames(), and DSInfo::getUniqueKeyInfo().

std::vector<Property*>& te::dt::CompositeProperty::getProperties ( )
inlineinherited

It returns the list of properties describing the CompositeProperty.

Returns
The list of Propertys describing the CompositeProperty.

Definition at line 160 of file CompositeProperty.h.

Property* te::dt::CompositeProperty::getProperty ( std::size_t  i) const
inlineinherited

It returns the i-th property.

Parameters
iThe property position in the property array.
Returns
A pointer to the i-th property. Don't delete it, as it belongs to the CompositeProperty.
Precondition
i must be in the valid range [0, size()).

Definition at line 171 of file CompositeProperty.h.

Referenced by te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::qt::widgets::ConstraintWidget::ConstraintWidget(), te::da::CreateAdapter(), te::gdal::Transactor::createDataSet(), te::ogr::Transactor::createDataSet(), te::sqlite::DataSourceTransactor::createDataSet(), te::ado::Transactor::createDataSet(), te::pgis::Transactor::createDataSet(), te::stmem::DataSet::DataSet(), te::mem::DataSet::DataSet(), te::da::DataSetTypeConverter::DataSetTypeConverter(), te::qt::widgets::DataSetAdapterWidget::fillDataSetTable(), te::da::GetEmptyOIDSet(), te::da::GetFirstSpatialProperty(), te::sqlite::DataSourceCatalogLoader::getIndex(), te::ado::Transactor::getIndexes(), te::pgis::GetLoadDataRow(), te::sqlite::DataSourceCatalogLoader::getPrimaryKey(), te::ado::Transactor::getPrimaryKey(), te::stmem::Transactor::getProperties(), te::stmem::Transactor::getProperty(), te::da::GetPropertyInfo(), te::stmem::Transactor::getPropertyNames(), te::da::GetPropertyPos(), te::sqlite::DataSourceCatalogLoader::getSpatialIndexes(), te::da::GetSQLValueNames(), te::pgis::GetSQLValues(), te::vp::IntersectionOp::getTabularProps(), te::sqlite::DataSourceCatalogLoader::getUniqueKey(), te::ado::Transactor::getUniqueKeys(), te::qt::widgets::IndexWidget::IndexWidget(), te::stmem::Transactor::propertyExists(), te::serialize::xml::Save(), te::qt::widgets::PropertyConverterDialog::set(), and terralib4::TableDataSet::TableDataSet().

te::dt::Property * te::dt::CompositeProperty::getProperty ( const std::string &  name) const
inherited

It returns the property with the given name or NULL if none is found.

Parameters
nameThe name of the property we are looking for.
Returns
A pointer to a property or NULL if none is found. Don't delete it, as it belongs to the CompositeProperty.

Definition at line 120 of file CompositeProperty.cpp.

te::dt::Property * te::dt::CompositeProperty::getPropertyById ( unsigned int  id) const
inherited

It searches for a property with the given ID.

Parameters
idThe property ID.
Returns
A pointer to the first property with the given ID if found or NULL otherwise. Don't delete it, as it belongs to the CompositeProperty.

Definition at line 153 of file CompositeProperty.cpp.

Referenced by te::pgis::Transactor::getConstraints(), and te::pgis::Transactor::getIndexes().

std::size_t te::dt::CompositeProperty::getPropertyPosition ( const std::string &  name) const
inherited
std::size_t te::dt::CompositeProperty::getPropertyPosition ( const Property p) const
inherited

It returns the property position .

Parameters
pThe property.
Returns
A property position in the property array.

Definition at line 142 of file CompositeProperty.cpp.

const std::string& te::da::DataSetType::getTitle ( ) const
inline

A human descriptive title for the DataSetType.

Returns
This value may be a concatenation of the DataSetType name or a more human readable text.

Definition at line 130 of file DataSetType.h.

Referenced by te::vp::IntersectionMemory::createDataSetType(), te::qt::widgets::DataSetOptionsWizardPage::datasetPressed(), te::vp::IntersectionMemory::pairwiseIntersection(), and te::serialize::xml::Save().

int te::dt::Property::getType ( ) const
inlineinherited

It returns the property data type.

Returns
The property data type.

Definition at line 161 of file Property.h.

Referenced by te::ado::Transactor::addForeignKey(), te::ado::Transactor::addPrimaryKey(), te::mem::DataSource::addProperty(), te::ogr::Transactor::addProperty(), te::sqlite::DataSourceTransactor::addProperty(), te::ado::Transactor::addProperty(), terralib4::Transactor::addProperty(), te::pgis::Transactor::addProperty(), te::ado::Transactor::addUniqueKey(), te::ogr::Transactor::changePropertyDefinition(), te::graph::LayerRenderer::checkEdgeGeometryProperty(), te::da::DataSourceCatalog::checkSequenceDependency(), te::graph::LayerRenderer::checkVertexGeometryProperty(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::ogr::Convert2OGR(), te::da::CreateAdapter(), te::sqlite::DataSourceTransactor::createDataSet(), te::graph::DataSourceGraphMetadata::createGraphTableEdgeModel(), te::graph::DataSourceGraphMetadata::createVertexAttrTable(), te::da::DataSetTypeConverter::DataSetTypeConverter(), te::da::DataSourceCatalog::dropDependentSequenceEntry(), te::da::DataSourceCatalog::dropDependentSequences(), te::ado::Transactor::dropProperty(), te::qt::widgets::DataSetCategoryItem::fetchMore(), te::qt::widgets::DataSetGroupItem::fetchMore(), te::qt::widgets::DataSetAdapterWidget::fillDataSetTable(), te::dt::CompositeProperty::findFirstPropertyOfType(), te::sqlite::DataSourceCatalogLoader::getDataSetType(), te::da::GetEmptyOIDSet(), te::qt::widgets::WhereClauseWidget::getExpression(), te::da::GetFirstSpatialProperty(), te::vp::MultipartToSinglepart::getOutDst(), te::attributefill::VectorToVectorMemory::getOutputDataSetType(), te::pgis::Transactor::getProperties(), te::pgis::Transactor::getProperty(), te::pgis::Transactor::getPropertyId(), te::da::GetPropertyInfo(), te::sqlite::DataSourceCatalogLoader::getSpatialIndexes(), te::sqlite::GetSQLType(), te::pgis::GetSQLValue(), te::vp::IntersectionOp::getTabularProps(), te::da::DataSourceCatalog::indexSequenceDependency(), te::qt::widgets::ChartLayerWidget::listAttributes(), te::qt::widgets::GroupingWidget::listAttributes(), te::da::DataSetTypeConverter::needConverter(), te::qt::widgets::GroupingWidget::onImportPushButtonClicked(), te::sa::SpatialStatisticsDialog::onOkPushButtonClicked(), te::qt::widgets::DataSetTableView::retypeColumn(), te::attributefill::VectorToVectorMemory::run(), te::graph::DataSourceGraphMetadata::saveProperty(), te::vp::GeometricOpMemory::SetAggregByAttribute(), te::pgis::SetColumnDef(), and te::attributefill::VectorToVectorDialog::setFunctionsByLayer().

UniqueKey* te::da::DataSetType::getUniqueKey ( std::size_t  i) const
inline

It returns the i-th unique key.

Parameters
iThe unique key position.
Returns
The i-th unique key.
Precondition
i must be in the valid range [0, getNumberOfUniqueKeys()).
Note
It doesn't make range check!

Definition at line 294 of file DataSetType.h.

Referenced by te::pgis::Transactor::createDataSet(), te::sqlite::DataSourceCatalogLoader::getIndex(), te::pgis::Transactor::getIndexes(), te::da::GetOIDPropertyNames(), and DSInfo::getUniqueKeyInfo().

te::da::UniqueKey * te::da::DataSetType::getUniqueKey ( const std::string &  name) const

It returns a unique key with the given name or NULL if none is found.

Parameters
nameThe unique key name.
Returns
A unique key with the given name or NULL.

Definition at line 300 of file DataSetType.cpp.

bool te::dt::CompositeProperty::has ( Property p) const
virtualinherited

It checks if the Property "p" is associated to this property or any other parent.

Parameters
pThe Property we are checking.
Returns
True if the given Property "p" is associated to to this Property, otherwise, returns false.

Implements te::dt::Property.

Definition at line 186 of file CompositeProperty.cpp.

bool te::da::DataSetType::hasGeom ( ) const
inline

It returns true if the DataSetType has at least one geometry property; otherwise, it returns false.

Returns
True if the DataSetType has at least one geometry property; otherwise, it returns false.

Definition at line 655 of file DataSetType.h.

References te::dt::GEOMETRY_TYPE.

Referenced by te::ogr::Convert2OGR(), te::ogr::Transactor::createDataSet(), te::ogr::DataSet::DataSet(), te::qt::widgets::DataSetOptionsWizardPage::datasetPressed(), and te::map::DrawGeometries().

bool te::dt::CompositeProperty::hasPropertyOfType ( const int  t) const
inlineinherited

Tells if there is a property of the given data type.

Definition at line 273 of file CompositeProperty.h.

References te::dt::CompositeProperty::findFirstPropertyOfType().

Referenced by hasRaster().

bool te::da::DataSetType::hasRaster ( ) const
inline

It returns true if the DataSetType has at least one raster property; otherwise, it returns false.

Returns
True if the DataSetType has at least one raster property; otherwise, it returns false.

Definition at line 660 of file DataSetType.h.

References te::dt::CompositeProperty::hasPropertyOfType(), and te::dt::RASTER_TYPE.

Referenced by te::map::DrawRaster().

te::da::DataSetType & te::da::DataSetType::operator= ( const DataSetType rhs)

Assignment operator not allowed.

Parameters
rhsThe right-hand-side copy that would be used to copy from.
Returns
A reference to this object.

Definition at line 213 of file DataSetType.cpp.

References TE_TR.

void te::dt::CompositeProperty::remove ( Property p)
virtualinherited

It removes the property from the composite.

Parameters
pThe property to be removed from the composite.
Postcondition
The property pointer will be invalidated.

Definition at line 105 of file CompositeProperty.cpp.

void te::da::DataSetType::remove ( Constraint c)

It removes the constraint.

A constraint can be a: foreign key, unique key, check constraint or primary key

Parameters
cThe constraint to be removed from the DataSetType.
Precondition
Don't inform a NULL pointer or a unique key that doesn't belong to the DataSetType.
Postcondition
The constraint pointer will be invalidated.

Definition at line 265 of file DataSetType.cpp.

References te::da::CHECK, te::da::FOREIGN_KEY, te::da::Constraint::getType(), te::da::PRIMARY_KEY, and te::da::UNIQUE_KEY.

Referenced by te::da::DataSourceCatalog::dropDependentFKs(), te::attributefill::VectorToVectorMemory::getOutputDataSetType(), and removeForeignKeys().

void te::da::DataSetType::remove ( UniqueKey uk)

It removes the unique key.

Parameters
ukThe unique key to be removed from the DataSetType.
Precondition
Don't inform a NULL pointer or a unique key that doesn't belong to the DataSetType.
Postcondition
The unique key pointer will be invalidated.

Definition at line 313 of file DataSetType.cpp.

void te::da::DataSetType::remove ( CheckConstraint cc)

It removes the check constraint.

Parameters
ccThe check constraint to be removed from the DataSetType.
Precondition
Don't inform a NULL pointer or a check constraint that doesn't belong to the DataSetType.
Postcondition
The check constraint pointer will be invalidated.

Definition at line 355 of file DataSetType.cpp.

void te::da::DataSetType::remove ( Index idx)

It removes the index.

Parameters
idxThe index to be removed from the DataSetType.
Precondition
Don't inform a NULL pointer or a index that doesn't belong to the DataSetType.
Postcondition
If there is a primary key referencing the index it will be released.
If there is a unique key referencing the index it will be released.
The index pointer will be invalidated.

Definition at line 402 of file DataSetType.cpp.

void te::da::DataSetType::remove ( ForeignKey fk)

It removes the foreign key.

Parameters
fkThe foreign key to be removed from the DataSetType.
Precondition
Don't pass a NULL pointer or a foreign key that doesn't belong to the DataSetType.
Postcondition
The foreign key pointer will be invalidated.
If the DataSetType is associated to a DataSourceCatalog, this method will unregister in the catalog the association between the fk and its referenced DataSetType.
Exceptions
ExceptionIt throws an exception if the fk can not be removed.

Definition at line 491 of file DataSetType.cpp.

References te::da::Constraint::getDataSetType(), and TE_TR.

void te::da::DataSetType::remove ( Property p)

It removes the Property.

This method may propagate changes to: indexes, unique keys, primary key, foreign key, check-constraints, sequences and catalog.

If the property to be removed is a geometry this method will take care of the default geometry property finding the first onde available or setting it to NULL if no other geometry property exists.

Parameters
pThe Property to be removed.
Postcondition
Any association with Primary Keys, and other stuffs will be automatically removed.
The Property pointer will be invalidated.

Definition at line 514 of file DataSetType.cpp.

void te::da::DataSetType::removeForeignKeys ( Property p)
protected

It removes all foreign keys that p takes part and all foreign keys that references p.

This method may change this DataSetType and all other DataSetTypes in the DataSourceCatalog that has a foreign key referencing this property.

Parameters
pA Property that may take part of a foreign key.
Note
If the DataSetType is associated to a DataSourceCatalog it can propagate changes for other foreign keys. It is like a cascade deletion of related foreign keys and attributes.

Definition at line 657 of file DataSetType.cpp.

References remove().

void te::da::DataSetType::removeIndexes ( Property p)
protected

It removes all indexes related to the given Property.

Parameters
pA Property that may take part of a index.

Definition at line 639 of file DataSetType.cpp.

void te::da::DataSetType::removeUniqueKeys ( Property p)
protected

It removes all unique keys related to the given Property.

Parameters
pA Property that may take part of a unique key.

Definition at line 621 of file DataSetType.cpp.

void te::da::DataSetType::replace ( Property p,
Property pp 
)

It replaces the property p by pp and adjust all pointers inclusive in the catalog.

Parameters
pThe property to be replaced.
ppThe property that will be added in the datasettype.
Note
If the property p is the owner of a sequence, the new property pp will take the ownership.
The caller of this method will take the ownership of p pointer. So, it is the caller responsability to free it!
The DataSetType will take the ownership of pp pointer.

Definition at line 543 of file DataSetType.cpp.

void te::da::DataSetType::setCatalog ( DataSourceCatalog catalog)
inline

It sets the DataSetType associated catalog.

Parameters
catalogThe catalog associated to the DataSetType.
Warning
Take care when calling this method. If the DataSetType belongs to a DataSourceCatalog remember to detach it from the catalog before calling this method.

Definition at line 168 of file DataSetType.h.

void te::da::DataSetType::setCategory ( int  c)
inline

It sets the dataset category.

Parameters
cThe dataset category.

Definition at line 184 of file DataSetType.h.

void te::dt::CompositeProperty::setCompositeName ( const std::string &  cname)
inlineinherited

It sets the composite type name.

Parameters
nameThe composite type name.

Definition at line 103 of file CompositeProperty.h.

void te::dt::Property::setDatasetName ( const std::string &  dsName)
inlineinherited

It sets the property name.

Parameters
nameThe new property name.
Warning
Take care when calling this method for a DataSetType associated to a DataSourceCatalog. Prefer using the rename method on the DataSourceCatalog API instead of using this method.

Definition at line 154 of file Property.h.

void te::dt::Property::setName ( const std::string &  name)
inlineinherited
void te::da::DataSetType::setPrimaryKey ( PrimaryKey pk)

It sets the primary key constraint.

Parameters
pkThe primary key constraint.
Precondition
The pk must not be associated to another DataSetType.
Postcondition
The DataSetType will take the ownership of the primary key.
The primary key will be automatically attached to the DataSetType.
Note
If another primary key has been already set, it will destroy it and set the new one as the valid primary key.
If you inform a NULL pointer, it ill just release the internal primary key.

Definition at line 223 of file DataSetType.cpp.

References te::da::Constraint::setDataSetType().

Referenced by te::vp::IntersectionMemory::createDataSetType(), te::vp::BufferOp::GetDataSetType(), te::vp::GeometricOp::GetDataSetType(), te::sqlite::DataSourceCatalogLoader::getPrimaryKey(), and te::ado::Transactor::getPrimaryKey().

void te::da::DataSetType::setTitle ( const std::string &  title)
inline

Member Data Documentation

DataSourceCatalog* te::da::DataSetType::m_catalog
private

The associated catalog.

Definition at line 643 of file DataSetType.h.

int te::da::DataSetType::m_category
private

A category.

Definition at line 650 of file DataSetType.h.

std::vector<CheckConstraint*> te::da::DataSetType::m_checkConstraints
private

A vector of check constraints.

Definition at line 647 of file DataSetType.h.

Referenced by DataSetType().

std::string te::dt::CompositeProperty::m_cname
protectedinherited

The composite type name.

Definition at line 269 of file CompositeProperty.h.

Referenced by te::dt::CompositeProperty::operator=().

std::string te::dt::Property::m_datasetName
protectedinherited

The property's dataset name.

Definition at line 208 of file Property.h.

Referenced by te::dt::Property::operator=().

std::vector<ForeignKey*> te::da::DataSetType::m_foreignKeys
private

A vector of foreign key constraints.

Definition at line 646 of file DataSetType.h.

Referenced by DataSetType().

unsigned int te::dt::Property::m_id
protectedinherited

An identification number that can be used internally.

Definition at line 205 of file Property.h.

Referenced by te::dt::Property::operator=().

std::vector<Index*> te::da::DataSetType::m_idxs
private

A vector of indexes.

Definition at line 648 of file DataSetType.h.

Referenced by DataSetType().

std::string te::dt::Property::m_name
protectedinherited

The property name.

Definition at line 207 of file Property.h.

Referenced by te::dt::Property::operator=().

Property* te::dt::Property::m_parent
protectedinherited

The parent property type: it must be a CompositeProperty.

Definition at line 204 of file Property.h.

PrimaryKey* te::da::DataSetType::m_pk
private

The DataSetType primary key.

Definition at line 644 of file DataSetType.h.

Referenced by DataSetType().

std::vector<Property*> te::dt::CompositeProperty::m_properties
protectedinherited
std::string te::da::DataSetType::m_title
private

A brief description of the DataSetType.

Definition at line 645 of file DataSetType.h.

int te::dt::Property::m_type
protectedinherited

The property data type.

Definition at line 206 of file Property.h.

Referenced by te::dt::Property::operator=().

std::vector<UniqueKey*> te::da::DataSetType::m_uniqueKeys
private

A vector of unique key constraints.

Definition at line 649 of file DataSetType.h.

Referenced by DataSetType().


The documentation for this class was generated from the following files: