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!
te::da::DataSetType::DataSetType ( const DataSetType rhs)

Copy constructor.

Parameters
rhsThe right-hand-side copy that would be used to copy from.
Note
This method is used by clone().
te::da::DataSetType::~DataSetType ( )

Destructor

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.
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.
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.
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.
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.
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.
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.
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.
void te::da::DataSetType::clear ( )
virtual

It clears the DataSetType definition.

Reimplemented from te::dt::CompositeProperty.

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

It removes all check constraints.

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

It removes all indexes from the dataset type.

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

It removes all unique keys from the dataset type.

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.

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.
Property * te::dt::CompositeProperty::findFirstPropertyOfType ( const int  t) const
inlineinherited

returns the first property of the given data type. Caller doesn't take ownership of the returned pointer.

Definition at line 278 of file CompositeProperty.h.

References te::dt::Property::getType(), te::dt::CompositeProperty::m_properties, and te::dt::CompositeProperty::size().

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

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.

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.

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.

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.
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.

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.

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.
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.

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.

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.
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.

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.

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.

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.

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.

Property* te::dt::Property::getParent ( ) const
inlineinherited

It returns the parent of this property, or NULL, if it doesn't have one.

Returns
The parent of this property, or NULL, if it doesn't have one.

Definition at line 168 of file Property.h.

PrimaryKey* te::da::DataSetType::getPrimaryKey ( ) const
inline

It returns the primary key associated to the dataset type.

The primary key associated to the dataset type or NULL if none exists.

Definition at line 214 of file DataSetType.h.

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

It returns the list of properties describing the CompositeProperty.

Returns
The list of Propertys describing the CompositeProperty.

Definition at line 153 of file CompositeProperty.h.

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.

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.
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.
std::size_t te::dt::CompositeProperty::getPropertyPosition ( const std::string &  name) const
inherited

It returns the property position based on its name.

Parameters
nameThe property name.
Returns
A property position in the property array.
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.
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.

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::dt::CompositeProperty::findFirstPropertyOfType().

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.

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.
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.

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.

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.

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.
virtual 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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::setId ( unsigned int  id)
inlineinherited

It sets the property identifier.

Parameters
idA 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 118 of file Property.h.

void te::dt::Property::setName ( const std::string &  name)
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 137 of file Property.h.

void te::dt::Property::setParent ( Property p)
inlineinherited

It associate this property to the informed parent.

Parameters
pTeh parent property.
Warning
Don't use this method without knowing the internal details of its use.

Definition at line 177 of file Property.h.

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.
void te::da::DataSetType::setTitle ( const std::string &  title)
inline

It sets a human descriptive title for the DataSetType.

Parameters
titleThis value can be used to display a human descriptive title for the DataSetType.

Definition at line 137 of file DataSetType.h.

std::size_t te::dt::CompositeProperty::size ( ) const
inlineinherited

It returns the number of properties of the CompositeProperty.

Returns
The number of properties of the CompositeProperty.

Definition at line 146 of file CompositeProperty.h.

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

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.

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

The composite type name.

Definition at line 269 of file CompositeProperty.h.

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

The property's dataset name.

Definition at line 208 of file Property.h.

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

A vector of foreign key constraints.

Definition at line 646 of file DataSetType.h.

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

An identification number that can be used internally.

Definition at line 205 of file Property.h.

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

A vector of indexes.

Definition at line 648 of file DataSetType.h.

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

The property name.

Definition at line 207 of file Property.h.

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.

std::vector<Property*> te::dt::CompositeProperty::m_properties
protectedinherited

The list of property types that make the CompositeProperty.

Definition at line 270 of file CompositeProperty.h.

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

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.

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

A vector of unique key constraints.

Definition at line 649 of file DataSetType.h.


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