An converter for DataSetType. More...
#include <DataSetTypeConverter.h>
Public Member Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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 given property name. More... | |
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 given property name. More... | |
const std::vector< std::vector< std::size_t > > & | getConvertedPropertyIndexes () const |
DataSetType * | getConvertee () |
This method returns the pointer to the DataSetType that is handled by the converter. More... | |
std::string | getConverterName (std::size_t propertyPos) |
This method tells which Attribute Converter was used in the porperty position. More... | |
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. More... | |
void | getNonConvertedProperties (std::vector< std::size_t > &propertyPos) const |
This method returns the position of the properties that have not yet been converted. More... | |
DataSetType * | getResult () const |
void | remove (const std::string &propertyName) |
This method removes a property of DataSetTypeConverter. More... | |
void | remove (std::size_t propertyPos) |
This method removes a property of DataSetTypeConverter. More... | |
Constructor/Destructor | |
Initilizer methods. | |
DataSetTypeConverter (DataSetType *type) | |
Constructor. More... | |
DataSetTypeConverter (DataSetType *type, const DataSourceCapabilities &capabilities, te::core::EncodingType et=te::core::EncodingType::UTF8) | |
Constructor. More... | |
~DataSetTypeConverter () | |
Destructor. More... | |
Static Public Member Functions | |
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 capabilities. More... | |
Private Member Functions | |
bool | isConverted (std::size_t i) const |
Private Attributes | |
std::vector< std::size_t > | m_convertedProperties |
Internal vector to count the references to converted properties. More... | |
std::vector< AttributeConverter > | m_converters |
A vector that stores the attribute converters functions. More... | |
std::vector< std::string > | m_functionsNames |
A vector that stores the attribute converters functions names. More... | |
DataSetType * | m_inDataSetType |
A pointer to DataSetType that will be converted. More... | |
DataSetType * | m_outDataSetType |
The converted DataSetType. More... | |
std::vector< std::vector< std::size_t > > | m_propertyIndexes |
A vector that stores the converted property indexes. More... | |
Friends | |
class | DataSetAdapter |
An converter for DataSetType.
Definition at line 59 of file DataSetTypeConverter.h.
te::da::DataSetTypeConverter::DataSetTypeConverter | ( | DataSetType * | type | ) |
Constructor.
type | A pointer to the DataSetType that will be converted. |
te::da::DataSetTypeConverter::DataSetTypeConverter | ( | DataSetType * | type, |
const DataSourceCapabilities & | capabilities, | ||
te::core::EncodingType | et = te::core::EncodingType::UTF8 |
||
) |
Constructor.
type | A pointer to the DataSetType that will be converted. |
capabilities | A data source capabilities of the data source that the user intend use. e.g. the data source where the given data set type will be saved. |
ce | The destintion character encoding. |
te::da::DataSetTypeConverter::~DataSetTypeConverter | ( | ) |
Destructor.
void te::da::DataSetTypeConverter::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.
propertyName | The property name that will be converted. |
p | The converted property. |
attributeConverterName | The function name that will be used to do the property values conversion. |
void te::da::DataSetTypeConverter::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.
propertyPos | The property position that will be converted. |
p | The converted property. |
attributeConverterName | The function name that will be used to do the property values conversion. |
void te::da::DataSetTypeConverter::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.
propertyPos | The property position that will be converted. |
p | The converted property. |
conv | The function that will be used to do the property values conversion. |
void te::da::DataSetTypeConverter::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.
propertyNames | The property names that will be converted. |
p | The converted property. |
attributeConverterName | The function name that will be used to do the property values conversion. |
void te::da::DataSetTypeConverter::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.
propertyPos | The property positions that will be converted. |
p | The converted property. |
attributeConverterName | The function name that will be used to do the property values conversion. |
void te::da::DataSetTypeConverter::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.
propertyPos | The property positions that will be converted. |
p | The converted property. |
conv | The function that will be used to do the property values conversion. |
void te::da::DataSetTypeConverter::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 given property name.
propertyName | A property name of the DataSetTypeConverter. |
convertedPropertyPos | A vector that will be filled with the property positions of the input data set type have been converted. |
void te::da::DataSetTypeConverter::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 given property name.
propertyPos | A property position of the DataSetTypeConverter. |
convertedPropertyPos | A vector that will be filled with the property positions of the input data set type have been converted. |
const std::vector<std::vector<std::size_t> >& te::da::DataSetTypeConverter::getConvertedPropertyIndexes | ( | ) | const |
DataSetType* te::da::DataSetTypeConverter::getConvertee | ( | ) |
This method returns the pointer to the DataSetType that is handled by the converter.
std::string te::da::DataSetTypeConverter::getConverterName | ( | std::size_t | propertyPos | ) |
This method tells which Attribute Converter was used in the porperty position.
propertyPos | A property position of the DataSetTypeConverter. |
const std::vector<AttributeConverter>& te::da::DataSetTypeConverter::getConverters | ( | ) | const |
void te::da::DataSetTypeConverter::getNonConvertedProperties | ( | std::vector< std::string > & | propertyNames | ) | const |
This method returns the name of the properties that have not yet been converted.
propertyNames | A vector that will be filled with the name of the properties that have not yet been converted. |
void te::da::DataSetTypeConverter::getNonConvertedProperties | ( | std::vector< std::size_t > & | propertyPos | ) | const |
This method returns the position of the properties that have not yet been converted.
propertyPos | A vector that will be filled with the position of the properties that have not yet been converted. |
DataSetType* te::da::DataSetTypeConverter::getResult | ( | ) | const |
|
private |
|
static |
Static method that verifies if the given data set type need an converter based on given data source capabilities.
type | The data set type that will be verified. |
capabilities | The data source capabilities that will be used. |
void te::da::DataSetTypeConverter::remove | ( | const std::string & | propertyName | ) |
This method removes a property of DataSetTypeConverter.
propertyName | The property name of the DataSetTypeConverter that will be removed. |
void te::da::DataSetTypeConverter::remove | ( | std::size_t | propertyPos | ) |
This method removes a property of DataSetTypeConverter.
propertyPos | The property position of the DataSetTypeConverter that will be removed. |
|
friend |
Definition at line 61 of file DataSetTypeConverter.h.
|
private |
Internal vector to count the references to converted properties.
Definition at line 250 of file DataSetTypeConverter.h.
|
private |
A vector that stores the attribute converters functions.
Definition at line 248 of file DataSetTypeConverter.h.
|
private |
A vector that stores the attribute converters functions names.
Definition at line 249 of file DataSetTypeConverter.h.
|
private |
A pointer to DataSetType that will be converted.
Definition at line 245 of file DataSetTypeConverter.h.
|
private |
The converted DataSetType.
Definition at line 246 of file DataSetTypeConverter.h.
|
private |
A vector that stores the converted property indexes.
Definition at line 247 of file DataSetTypeConverter.h.