26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_DATASETTYPECONVERTER_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_DATASETTYPECONVERTER_H
30 #include "../Config.h"
32 #include "../../core/encoding/CharEncoding.h"
50 class DataSourceCapabilities;
167 void remove(
const std::string& propertyName);
183 void add(
const std::string& propertyName,
te::dt::Property* p,
const std::string& attributeConverterName =
"GenericAttributeConverter");
192 void add(std::size_t propertyPos,
te::dt::Property* p,
const std::string& attributeConverterName =
"GenericAttributeConverter");
210 void add(
const std::vector<std::string>& propertyNames,
te::dt::Property* p,
const std::string& attributeConverterName =
"GenericAttributeConverter");
219 void add(
const std::vector<std::size_t>& propertyPos,
te::dt::Property* p,
const std::string& attributeConverterName =
"GenericAttributeConverter");
Definition of attribute converter and a set of them.
te::da::DataSourceCapabilities capabilities
An converter for DataSetType.
void add(const std::vector< std::size_t > &propertyPos, te::dt::Property *p, AttributeConverter conv)
It adds a conversion to the given properties of the input data set type.
static bool needConverter(DataSetType *type, const DataSourceCapabilities &capabilities)
Static method that verifies if the given data set type need an converter based on given data source c...
std::vector< AttributeConverter > m_converters
A vector that stores the attribute converters functions.
void getConvertedProperties(std::size_t propertyPos, std::vector< std::size_t > &convertedPropertyPos)
This method tells which properties of the input data set type that have been converted based on the g...
DataSetTypeConverter(const DataSetType *type)
Constructor.
void add(const std::vector< std::size_t > &propertyPos, te::dt::Property *p, const std::string &attributeConverterName="GenericAttributeConverter")
It adds a conversion to the given properties of the input data set type.
~DataSetTypeConverter()
Destructor.
te::core::EncodingType m_encondingType
The enconding type used.
void getConvertedProperties(const std::string &propertyName, std::vector< std::size_t > &convertedPropertyPos)
This method tells which properties of the input data set type that have been converted based on the g...
std::vector< std::string > m_functionsNames
A vector that stores the attribute converters functions names.
void remove(std::size_t propertyPos)
This method removes a property of DataSetTypeConverter.
DataSetTypeConverter(const DataSetTypeConverter &other)
void add(std::size_t propertyPos, te::dt::Property *p, const std::string &attributeConverterName="GenericAttributeConverter")
It adds a conversions to the given property of the input data set type.
void setEncodingType(te::core::EncodingType et)
It changes all encoding types from m_converters property that are CharEncodingConverter type.
const std::vector< std::vector< std::size_t > > & getConvertedPropertyIndexes() const
te::core::EncodingType getEncodingType()
It gets the encoding type used to convert.
std::vector< std::vector< std::size_t > > m_propertyIndexes
A vector that stores the converted property indexes.
void remove(const std::string &propertyName)
This method removes a property of DataSetTypeConverter.
DataSetType * getResult() const
std::string getConverterName(std::size_t propertyPos)
This method tells which Attribute Converter was used in the porperty position.
void getNonConvertedProperties(std::vector< std::size_t > &propertyPos) const
This method returns the position of the properties that have not yet been converted.
const std::vector< AttributeConverter > & getConverters() const
void getNonConvertedProperties(std::vector< std::string > &propertyNames) const
This method returns the name of the properties that have not yet been converted.
DataSetTypeConverter(const DataSetType *type, const DataSourceCapabilities &capabilities, te::core::EncodingType et=te::core::EncodingType::UTF8)
Constructor.
void add(const std::vector< std::string > &propertyNames, te::dt::Property *p, const std::string &attributeConverterName="GenericAttributeConverter")
It adds a conversion to the given properties of the input data set type.
void add(const std::string &propertyName, te::dt::Property *p, const std::string &attributeConverterName="GenericAttributeConverter")
It adds a conversions to the given property of the input data set type.
DataSetType * m_inDataSetType
A pointer to DataSetType that will be converted.
std::vector< std::size_t > m_convertedProperties
Internal vector to count the references to converted properties.
DataSetType * getConvertee()
This method returns the pointer to the DataSetType that is handled by the converter.
bool isConverted(std::size_t i) const
DataSetType * m_outDataSetType
The converted DataSetType.
void add(std::size_t propertyPos, te::dt::Property *p, AttributeConverter conv)
It adds a conversions to the given property of the input data set type.
DataSetTypeConverter & operator=(const DataSetTypeConverter &other)
A class that models the description of a dataset.
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
It models a property definition.
EncodingType
Supported character encodings.
boost::function3< te::dt::AbstractData *, DataSet *, const std::vector< std::size_t > &, int > AttributeConverter
The type of attribute converter functions.
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.