svcore
1.9
|
#include <Transform.h>
Public Types | |
enum | Type { FeatureExtraction, RealTimeEffect } |
enum | SummaryType { Minimum = 0, Maximum = 1, Mean = 2, Median = 3, Mode = 4, Sum = 5, Variance = 6, StandardDeviation = 7, Count = 8, NoSummary = 999 } |
typedef std::map< QString, float > | ParameterMap |
typedef std::map< QString, QString > | ConfigurationMap |
Public Member Functions | |
Transform () | |
Construct a new Transform with default data and no identifier. | |
Transform (QString xml) | |
Construct a Transform by parsing the given XML data string. | |
virtual | ~Transform () |
bool | operator== (const Transform &) const |
Compare two Transforms. | |
bool | operator< (const Transform &) const |
Order two Transforms, so that they can be used as keys in containers. | |
void | setIdentifier (TransformId id) |
TransformId | getIdentifier () const |
Type | getType () const |
QString | getPluginIdentifier () const |
QString | getOutput () const |
void | setPluginIdentifier (QString pluginIdentifier) |
void | setOutput (QString output) |
const ParameterMap & | getParameters () const |
void | setParameters (const ParameterMap &pm) |
void | setParameter (QString name, float value) |
const ConfigurationMap & | getConfiguration () const |
void | setConfiguration (const ConfigurationMap &cm) |
void | setConfigurationValue (QString name, QString value) |
SummaryType | getSummaryType () const |
void | setSummaryType (SummaryType type) |
QString | getPluginVersion () const |
void | setPluginVersion (QString version) |
QString | getProgram () const |
void | setProgram (QString program) |
int | getStepSize () const |
void | setStepSize (int s) |
int | getBlockSize () const |
void | setBlockSize (int s) |
WindowType | getWindowType () const |
void | setWindowType (WindowType type) |
RealTime | getStartTime () const |
void | setStartTime (RealTime t) |
RealTime | getDuration () const |
void | setDuration (RealTime d) |
float | getSampleRate () const |
void | setSampleRate (float rate) |
void | toXml (QTextStream &stream, QString indent="", QString extraAttributes="") const |
Stream this exportable object out to XML on a text stream. | |
void | setFromXmlAttributes (const QXmlAttributes &) |
Set the main transform data from the given XML attributes. | |
virtual QString | toXmlString (QString indent="", QString extraAttributes="") const |
Convert this exportable object to XML in a string. | |
Static Public Member Functions | |
static TransformId | getIdentifierForPluginOutput (QString pluginIdentifier, QString output="") |
static SummaryType | stringToSummaryType (QString) |
static QString | summaryTypeToString (SummaryType) |
static QString | encodeEntities (QString) |
static QString | encodeColour (int r, int g, int b) |
static int | getObjectExportId (const void *) |
Protected Member Functions | |
template<typename A , typename B > | |
bool | mapLessThan (const std::map< A, B > &a, const std::map< A, B > &b) const |
Static Protected Member Functions | |
static QString | createIdentifier (QString type, QString soName, QString label, QString output) |
static void | parseIdentifier (QString identifier, QString &type, QString &soName, QString &label, QString &output) |
Protected Attributes | |
TransformId | m_id |
ParameterMap | m_parameters |
ConfigurationMap | m_configuration |
SummaryType | m_summaryType |
QString | m_pluginVersion |
QString | m_program |
int | m_stepSize |
int | m_blockSize |
WindowType | m_windowType |
RealTime | m_startTime |
RealTime | m_duration |
float | m_sampleRate |
Definition at line 34 of file Transform.h.
typedef std::map<QString, float> Transform::ParameterMap |
Definition at line 85 of file Transform.h.
typedef std::map<QString, QString> Transform::ConfigurationMap |
Definition at line 91 of file Transform.h.
enum Transform::Type |
Definition at line 70 of file Transform.h.
Definition at line 97 of file Transform.h.
Construct a new Transform with default data and no identifier.
The Transform object will be meaningless until some data and an identifier have been set on it.
To construct a Transform for use with a particular transform identifier, use TransformFactory::getDefaultTransformFor.
Definition at line 33 of file Transform.cpp.
Transform::Transform | ( | QString | xml | ) |
Construct a Transform by parsing the given XML data string.
This is the inverse of toXml.
Definition at line 42 of file Transform.cpp.
References setConfigurationValue(), setFromXmlAttributes(), and setParameter().
Transform::~Transform | ( | ) | [virtual] |
Definition at line 107 of file Transform.cpp.
bool Transform::operator== | ( | const Transform & | t | ) | const |
Compare two Transforms.
They only compare equal if every data element matches.
Definition at line 112 of file Transform.cpp.
References m_blockSize, m_configuration, m_duration, m_id, m_parameters, m_program, m_sampleRate, m_startTime, m_stepSize, m_summaryType, and m_windowType.
bool Transform::operator< | ( | const Transform & | t | ) | const |
Order two Transforms, so that they can be used as keys in containers.
Definition at line 137 of file Transform.cpp.
References m_blockSize, m_configuration, m_duration, m_id, m_parameters, m_program, m_sampleRate, m_startTime, m_stepSize, m_summaryType, and m_windowType.
void Transform::setIdentifier | ( | TransformId | id | ) |
Definition at line 176 of file Transform.cpp.
References m_id.
Referenced by TransformFactory::getDefaultTransformFor(), TransformFactory::getTransformInputDomain(), TransformFactory::instantiateDefaultPluginFor(), and setFromXmlAttributes().
TransformId Transform::getIdentifier | ( | ) | const |
Definition at line 182 of file Transform.cpp.
References m_id.
Referenced by ModelTransformerFactory::getConfigurationForTransform(), TransformFactory::getPluginConfigurationXml(), TransformFactory::instantiatePluginFor(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), TransformFactory::setParametersFromPluginConfigurationXml(), CSVFeatureWriter::write(), RDFFeatureWriter::write(), RDFFeatureWriter::writeDenseRDF(), RDFFeatureWriter::writeLocalFeatureTypes(), and RDFFeatureWriter::writeSparseRDF().
Transform::Type Transform::getType | ( | ) | const |
Definition at line 206 of file Transform.cpp.
References FeatureExtraction, getPluginIdentifier(), FeatureExtractionPluginFactory::instanceFor(), and RealTimeEffect.
Referenced by TransformFactory::getTransformInputDomain(), and TransformFactory::instantiateDefaultPluginFor().
QString Transform::getPluginIdentifier | ( | ) | const |
Definition at line 218 of file Transform.cpp.
References m_id.
Referenced by ModelTransformerFactory::getConfigurationForTransform(), getType(), FeatureExtractionModelTransformer::initialise(), TransformFactory::instantiateDefaultPluginFor(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), setOutput(), RDFFeatureWriter::write(), and RDFTransformFactoryImpl::writeTransformToRDF().
QString Transform::getOutput | ( | ) | const |
Definition at line 224 of file Transform.cpp.
References m_id.
Referenced by areTransformsSimilar(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), setPluginIdentifier(), and RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setPluginIdentifier | ( | QString | pluginIdentifier | ) |
Definition at line 230 of file Transform.cpp.
References getOutput(), and m_id.
Referenced by RDFTransformFactoryImpl::getTransforms().
void Transform::setOutput | ( | QString | output | ) |
Definition at line 236 of file Transform.cpp.
References getPluginIdentifier(), and m_id.
Referenced by areTransformsSimilar(), and RDFTransformFactoryImpl::setOutput().
TransformId Transform::getIdentifierForPluginOutput | ( | QString | pluginIdentifier, |
QString | output = "" |
||
) | [static] |
Definition at line 242 of file Transform.cpp.
Referenced by TransformFactory::populateUninstalledTransforms().
const Transform::ParameterMap & Transform::getParameters | ( | ) | const |
Definition at line 249 of file Transform.cpp.
References m_parameters.
Referenced by TransformFactory::setPluginParameters(), and RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setParameters | ( | const ParameterMap & | pm | ) |
Definition at line 255 of file Transform.cpp.
References m_parameters.
Referenced by TransformFactory::setParametersFromPlugin().
void Transform::setParameter | ( | QString | name, |
float | value | ||
) |
Definition at line 261 of file Transform.cpp.
References m_parameters.
Referenced by RDFTransformFactoryImpl::setParameters(), and Transform().
const Transform::ConfigurationMap & Transform::getConfiguration | ( | ) | const |
Definition at line 268 of file Transform.cpp.
References m_configuration.
Referenced by TransformFactory::setPluginParameters().
void Transform::setConfiguration | ( | const ConfigurationMap & | cm | ) |
Definition at line 274 of file Transform.cpp.
References m_configuration.
Referenced by TransformFactory::setParametersFromPlugin().
void Transform::setConfigurationValue | ( | QString | name, |
QString | value | ||
) |
Definition at line 280 of file Transform.cpp.
References m_configuration, and SVDEBUG.
Referenced by Transform().
Definition at line 311 of file Transform.cpp.
References m_summaryType.
Referenced by RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setSummaryType | ( | SummaryType | type | ) |
Definition at line 317 of file Transform.cpp.
References m_summaryType.
Referenced by RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().
QString Transform::getPluginVersion | ( | ) | const |
Definition at line 287 of file Transform.cpp.
References m_pluginVersion.
Referenced by FeatureExtractionModelTransformer::initialise().
void Transform::setPluginVersion | ( | QString | version | ) |
Definition at line 293 of file Transform.cpp.
References m_pluginVersion.
Referenced by TransformFactory::getDefaultTransformFor(), and setFromXmlAttributes().
QString Transform::getProgram | ( | ) | const |
Definition at line 299 of file Transform.cpp.
References m_program.
Referenced by TransformFactory::setPluginParameters(), and RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setProgram | ( | QString | program | ) |
Definition at line 305 of file Transform.cpp.
References m_program.
Referenced by RDFTransformFactoryImpl::getTransforms(), setFromXmlAttributes(), and TransformFactory::setParametersFromPlugin().
int Transform::getStepSize | ( | ) | const |
Definition at line 323 of file Transform.cpp.
References m_stepSize.
Referenced by FeatureExtractionModelTransformer::initialise(), TransformFactory::makeContextConsistentWithPlugin(), FeatureExtractionModelTransformer::run(), RDFFeatureWriter::writeDenseRDF(), and RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setStepSize | ( | int | s | ) |
Definition at line 329 of file Transform.cpp.
References m_stepSize.
Referenced by RDFTransformFactoryImpl::getTransforms(), FeatureExtractionModelTransformer::initialise(), TransformFactory::makeContextConsistentWithPlugin(), and setFromXmlAttributes().
int Transform::getBlockSize | ( | ) | const |
Definition at line 335 of file Transform.cpp.
References m_blockSize.
Referenced by FeatureExtractionModelTransformer::initialise(), TransformFactory::makeContextConsistentWithPlugin(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), FeatureExtractionModelTransformer::run(), RDFFeatureWriter::writeDenseRDF(), and RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setBlockSize | ( | int | s | ) |
Definition at line 341 of file Transform.cpp.
References m_blockSize.
Referenced by RDFTransformFactoryImpl::getTransforms(), FeatureExtractionModelTransformer::initialise(), TransformFactory::makeContextConsistentWithPlugin(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), and setFromXmlAttributes().
WindowType Transform::getWindowType | ( | ) | const |
Definition at line 347 of file Transform.cpp.
References m_windowType.
Referenced by FeatureExtractionModelTransformer::run().
void Transform::setWindowType | ( | WindowType | type | ) |
Definition at line 353 of file Transform.cpp.
References m_windowType.
Referenced by RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().
RealTime Transform::getStartTime | ( | ) | const |
Definition at line 359 of file Transform.cpp.
References m_startTime.
Referenced by RealTimeEffectModelTransformer::run(), FeatureExtractionModelTransformer::run(), RDFFeatureWriter::writeDenseRDF(), and RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setStartTime | ( | RealTime | t | ) |
Definition at line 365 of file Transform.cpp.
References m_startTime.
Referenced by RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().
RealTime Transform::getDuration | ( | ) | const |
Definition at line 371 of file Transform.cpp.
References m_duration.
Referenced by RealTimeEffectModelTransformer::run(), FeatureExtractionModelTransformer::run(), RDFFeatureWriter::writeDenseRDF(), and RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setDuration | ( | RealTime | d | ) |
Definition at line 377 of file Transform.cpp.
References m_duration.
Referenced by RDFTransformFactoryImpl::getTransforms().
float Transform::getSampleRate | ( | ) | const |
Definition at line 383 of file Transform.cpp.
References m_sampleRate.
Referenced by TransformFactory::instantiatePluginFor(), CSVFeatureWriter::write(), RDFFeatureWriter::writeDenseRDF(), and RDFTransformFactoryImpl::writeTransformToRDF().
void Transform::setSampleRate | ( | float | rate | ) |
Definition at line 389 of file Transform.cpp.
References m_sampleRate.
Referenced by TransformFactory::getDefaultTransformFor(), RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().
void Transform::toXml | ( | QTextStream & | stream, |
QString | indent = "" , |
||
QString | extraAttributes = "" |
||
) | const [virtual] |
Stream this exportable object out to XML on a text stream.
Implements XmlExportable.
Definition at line 395 of file Transform.cpp.
References XmlExportable::encodeEntities(), m_blockSize, m_configuration, m_duration, m_id, m_parameters, m_pluginVersion, m_program, m_sampleRate, m_startTime, m_stepSize, m_summaryType, m_windowType, NoSummary, summaryTypeToString(), and RealTime::toString().
void Transform::setFromXmlAttributes | ( | const QXmlAttributes & | attrs | ) |
Set the main transform data from the given XML attributes.
This does not set the parameters or configuration, which are exported to separate XML elements rather than attributes of the transform element.
Note that this only sets those attributes which are actually present in the argument. Any attributes not defined in the attribute will remain unchanged in the Transform. If your aim is to create a transform exactly matching the given attributes, ensure you start from an empty transform rather than one that has already been configured.
Definition at line 491 of file Transform.cpp.
References RealTime::fromString(), setBlockSize(), setIdentifier(), setPluginVersion(), setProgram(), setSampleRate(), setStartTime(), setStepSize(), setSummaryType(), setWindowType(), and stringToSummaryType().
Referenced by Transform().
Transform::SummaryType Transform::stringToSummaryType | ( | QString | str | ) | [static] |
Definition at line 450 of file Transform.cpp.
References Count, Maximum, Mean, Median, Minimum, Mode, NoSummary, StandardDeviation, Sum, SVDEBUG, and Variance.
Referenced by RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().
QString Transform::summaryTypeToString | ( | SummaryType | type | ) | [static] |
Definition at line 470 of file Transform.cpp.
References Count, Maximum, Mean, Median, Minimum, Mode, NoSummary, StandardDeviation, Sum, SVDEBUG, and Variance.
Referenced by toXml(), and RDFTransformFactoryImpl::writeTransformToRDF().
QString Transform::createIdentifier | ( | QString | type, |
QString | soName, | ||
QString | label, | ||
QString | output | ||
) | [static, protected] |
Definition at line 188 of file Transform.cpp.
void Transform::parseIdentifier | ( | QString | identifier, |
QString & | type, | ||
QString & | soName, | ||
QString & | label, | ||
QString & | output | ||
) | [static, protected] |
Definition at line 196 of file Transform.cpp.
bool Transform::mapLessThan | ( | const std::map< A, B > & | a, |
const std::map< A, B > & | b | ||
) | const [inline, protected] |
Definition at line 173 of file Transform.h.
QString XmlExportable::toXmlString | ( | QString | indent = "" , |
QString | extraAttributes = "" |
||
) | const [virtual, inherited] |
Convert this exportable object to XML in a string.
The default implementation calls toXml and returns the result as a string. Do not override this unless you really know what you're doing.
Definition at line 25 of file XmlExportable.cpp.
References XmlExportable::toXml().
Referenced by ModelTransformerFactory::getConfigurationForTransform(), and RDFTransformFactoryImpl::getTransforms().
QString XmlExportable::encodeEntities | ( | QString | s | ) | [static, inherited] |
Definition at line 41 of file XmlExportable.cpp.
Referenced by TextMatcher::test(), PluginXml::toXml(), OneDimensionalPoint::toXml(), TimeValuePoint::toXml(), TextPoint::toXml(), ImagePoint::toXml(), RegionRec::toXml(), Note::toXml(), FlexiNote::toXml(), WritableWaveFileModel::toXml(), WaveFileModel::toXml(), SparseValueModel< RegionRec >::toXml(), toXml(), and Model::toXml().
QString XmlExportable::encodeColour | ( | int | r, |
int | g, | ||
int | b | ||
) | [static, inherited] |
Definition at line 54 of file XmlExportable.cpp.
int XmlExportable::getObjectExportId | ( | const void * | object | ) | [static, inherited] |
Definition at line 71 of file XmlExportable.cpp.
References mutex.
Referenced by FFTDataServer::generateFileBasename(), AlignmentModel::toXml(), EditableDenseThreeDimensionalModel::toXml(), and Model::toXml().
TransformId Transform::m_id [protected] |
Definition at line 163 of file Transform.h.
Referenced by getIdentifier(), getOutput(), getPluginIdentifier(), operator<(), operator==(), setIdentifier(), setOutput(), setPluginIdentifier(), and toXml().
ParameterMap Transform::m_parameters [protected] |
Definition at line 187 of file Transform.h.
Referenced by getParameters(), operator<(), operator==(), setParameter(), setParameters(), and toXml().
ConfigurationMap Transform::m_configuration [protected] |
Definition at line 188 of file Transform.h.
Referenced by getConfiguration(), operator<(), operator==(), setConfiguration(), setConfigurationValue(), and toXml().
SummaryType Transform::m_summaryType [protected] |
Definition at line 189 of file Transform.h.
Referenced by getSummaryType(), operator<(), operator==(), setSummaryType(), and toXml().
QString Transform::m_pluginVersion [protected] |
Definition at line 190 of file Transform.h.
Referenced by getPluginVersion(), setPluginVersion(), and toXml().
QString Transform::m_program [protected] |
Definition at line 191 of file Transform.h.
Referenced by getProgram(), operator<(), operator==(), setProgram(), and toXml().
int Transform::m_stepSize [protected] |
Definition at line 192 of file Transform.h.
Referenced by getStepSize(), operator<(), operator==(), setStepSize(), and toXml().
int Transform::m_blockSize [protected] |
Definition at line 193 of file Transform.h.
Referenced by getBlockSize(), operator<(), operator==(), setBlockSize(), and toXml().
WindowType Transform::m_windowType [protected] |
Definition at line 194 of file Transform.h.
Referenced by getWindowType(), operator<(), operator==(), setWindowType(), and toXml().
RealTime Transform::m_startTime [protected] |
Definition at line 195 of file Transform.h.
Referenced by getStartTime(), operator<(), operator==(), setStartTime(), and toXml().
RealTime Transform::m_duration [protected] |
Definition at line 196 of file Transform.h.
Referenced by getDuration(), operator<(), operator==(), setDuration(), and toXml().
float Transform::m_sampleRate [protected] |
Definition at line 197 of file Transform.h.
Referenced by getSampleRate(), operator<(), operator==(), setSampleRate(), and toXml().