#include <Transform.h>

Inheritance diagram for Transform:
Inheritance graph
Collaboration diagram for Transform:
Collaboration graph

Public Types

enum  Type { FeatureExtraction, RealTimeEffect, UnknownType }
 
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
 
enum  { NO_ID = -1 }
 
typedef int ExportId
 

Public Member Functions

 Transform ()
 Construct a new Transform with default data and no identifier. More...
 
 Transform (QString xml)
 Construct a Transform by parsing the given XML data string. More...
 
virtual ~Transform ()
 
bool operator== (const Transform &) const
 Compare two Transforms. More...
 
bool operator< (const Transform &) const
 Order two Transforms, so that they can be used as keys in containers. More...
 
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 ParameterMapgetParameters () const
 
void setParameters (const ParameterMap &pm)
 
void setParameter (QString name, float value)
 
const ConfigurationMapgetConfiguration () 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)
 
sv_samplerate_t getSampleRate () const
 
void setSampleRate (sv_samplerate_t rate)
 
void toXml (QTextStream &stream, QString indent="", QString extraAttributes="") const override
 Stream this exportable object out to XML on a text stream. More...
 
void setFromXmlAttributes (const QXmlAttributes &)
 Set the main transform data from the given XML attributes. More...
 
QString getErrorString () const
 
ExportId getExportId () const
 Return the numerical export identifier for this object. More...
 
virtual QString toXmlString (QString indent="", QString extraAttributes="") const
 Convert this exportable object to XML in a string. More...
 

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)
 

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
 
sv_samplerate_t m_sampleRate
 
QString m_errorString
 

Detailed Description

Definition at line 34 of file Transform.h.

Member Typedef Documentation

typedef std::map<QString, float> Transform::ParameterMap

Definition at line 86 of file Transform.h.

typedef std::map<QString, QString> Transform::ConfigurationMap

Definition at line 92 of file Transform.h.

typedef int XmlExportable::ExportId
inherited

Definition at line 33 of file XmlExportable.h.

Member Enumeration Documentation

Enumerator
FeatureExtraction 
RealTimeEffect 
UnknownType 

Definition at line 71 of file Transform.h.

Enumerator
Minimum 
Maximum 
Mean 
Median 
Mode 
Sum 
Variance 
StandardDeviation 
Count 
NoSummary 

Definition at line 98 of file Transform.h.

anonymous enum
inherited
Enumerator
NO_ID 

Definition at line 28 of file XmlExportable.h.

Constructor & Destructor Documentation

Transform::Transform ( )

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 34 of file Transform.cpp.

Transform::Transform ( QString  xml)

Construct a Transform by parsing the given XML data string.

This is the inverse of toXmlString. If this fails, getErrorString() will return a non-empty string.

Definition at line 43 of file Transform.cpp.

References m_errorString, setConfigurationValue(), setFromXmlAttributes(), and setParameter().

Transform::~Transform ( )
virtual

Definition at line 104 of file Transform.cpp.

Member Function Documentation

bool Transform::operator== ( const Transform t) const

Compare two Transforms.

They only compare equal if every data element matches.

Definition at line 109 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 134 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::setPluginIdentifier ( QString  pluginIdentifier)

Definition at line 225 of file Transform.cpp.

References getOutput(), and m_id.

Referenced by RDFTransformFactoryImpl::getTransforms().

void Transform::setOutput ( QString  output)

Definition at line 231 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 237 of file Transform.cpp.

Referenced by TransformFactory::populateUninstalledTransforms().

const Transform::ParameterMap & Transform::getParameters ( ) const
void Transform::setParameters ( const ParameterMap pm)

Definition at line 250 of file Transform.cpp.

References m_parameters.

Referenced by TransformFactory::setParametersFromPlugin().

void Transform::setParameter ( QString  name,
float  value 
)

Definition at line 256 of file Transform.cpp.

References m_parameters.

Referenced by RDFTransformFactoryImpl::setParameters(), and Transform().

const Transform::ConfigurationMap & Transform::getConfiguration ( ) const

Definition at line 263 of file Transform.cpp.

References m_configuration.

Referenced by TransformFactory::setPluginParameters().

void Transform::setConfiguration ( const ConfigurationMap cm)

Definition at line 269 of file Transform.cpp.

References m_configuration.

Referenced by TransformFactory::setParametersFromPlugin().

void Transform::setConfigurationValue ( QString  name,
QString  value 
)

Definition at line 275 of file Transform.cpp.

References m_configuration, and SVDEBUG.

Referenced by Transform().

Transform::SummaryType Transform::getSummaryType ( ) const

Definition at line 306 of file Transform.cpp.

References m_summaryType.

Referenced by RDFTransformFactoryImpl::writeTransformToRDF().

void Transform::setSummaryType ( SummaryType  type)

Definition at line 312 of file Transform.cpp.

References m_summaryType.

Referenced by RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().

QString Transform::getPluginVersion ( ) const
void Transform::setPluginVersion ( QString  version)
QString Transform::getProgram ( ) const
void Transform::setProgram ( QString  program)
void Transform::setStepSize ( int  s)
WindowType Transform::getWindowType ( ) const
void Transform::setWindowType ( WindowType  type)

Definition at line 348 of file Transform.cpp.

References m_windowType.

Referenced by RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().

void Transform::setStartTime ( RealTime  t)

Definition at line 360 of file Transform.cpp.

References m_startTime.

Referenced by RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().

void Transform::setDuration ( RealTime  d)

Definition at line 372 of file Transform.cpp.

References m_duration.

Referenced by RDFTransformFactoryImpl::getTransforms(), and setFromXmlAttributes().

void Transform::setSampleRate ( sv_samplerate_t  rate)
void Transform::toXml ( QTextStream &  stream,
QString  indent = "",
QString  extraAttributes = "" 
) const
overridevirtual
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 486 of file Transform.cpp.

References RealTime::fromString(), setBlockSize(), setDuration(), setIdentifier(), setPluginVersion(), setProgram(), setSampleRate(), setStartTime(), setStepSize(), setSummaryType(), setWindowType(), and stringToSummaryType().

Referenced by Transform().

QString Transform::getErrorString ( ) const
inline

Definition at line 160 of file Transform.h.

References m_errorString, stringToSummaryType(), and summaryTypeToString().

Transform::SummaryType Transform::stringToSummaryType ( QString  str)
static
QString Transform::summaryTypeToString ( SummaryType  type)
static
QString Transform::createIdentifier ( QString  type,
QString  soName,
QString  label,
QString  output 
)
staticprotected

Definition at line 185 of file Transform.cpp.

References PluginIdentifier::createIdentifier().

void Transform::parseIdentifier ( QString  identifier,
QString &  type,
QString &  soName,
QString &  label,
QString &  output 
)
staticprotected

Definition at line 193 of file Transform.cpp.

References PluginIdentifier::parseIdentifier().

template<typename A , typename B >
bool Transform::mapLessThan ( const std::map< A, B > &  a,
const std::map< A, B > &  b 
) const
inlineprotected

Definition at line 176 of file Transform.h.

int XmlExportable::getExportId ( ) const
inherited

Return the numerical export identifier for this object.

It's allocated the first time this is called, so objects on which this is never called do not get allocated one.

Definition at line 71 of file XmlExportable.cpp.

References XmlExportable::m_exportId, and mutex.

Referenced by EditableDenseThreeDimensionalModel::toXml(), BasicCompressedDenseThreeDimensionalModel::toXml(), EventSeries::toXml(), ImageModel::toXml(), TextModel::toXml(), Model::toXml(), SparseOneDimensionalModel::toXml(), RegionModel::toXml(), BoxModel::toXml(), SparseTimeValueModel::toXml(), NoteModel::toXml(), and XmlExportable::~XmlExportable().

QString XmlExportable::toXmlString ( QString  indent = "",
QString  extraAttributes = "" 
) const
virtualinherited

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(), RDFTransformFactoryImpl::getTransforms(), and XmlExportable::~XmlExportable().

QString XmlExportable::encodeColour ( int  r,
int  g,
int  b 
)
staticinherited

Definition at line 54 of file XmlExportable.cpp.

Referenced by XmlExportable::~XmlExportable().

Member Data Documentation

ParameterMap Transform::m_parameters
protected

Definition at line 190 of file Transform.h.

Referenced by getParameters(), operator<(), operator==(), setParameter(), setParameters(), and toXml().

ConfigurationMap Transform::m_configuration
protected
SummaryType Transform::m_summaryType
protected

Definition at line 192 of file Transform.h.

Referenced by getSummaryType(), operator<(), operator==(), setSummaryType(), and toXml().

QString Transform::m_pluginVersion
protected

Definition at line 193 of file Transform.h.

Referenced by getPluginVersion(), setPluginVersion(), and toXml().

QString Transform::m_program
protected

Definition at line 194 of file Transform.h.

Referenced by getProgram(), operator<(), operator==(), setProgram(), and toXml().

int Transform::m_stepSize
protected

Definition at line 195 of file Transform.h.

Referenced by getStepSize(), operator<(), operator==(), setStepSize(), and toXml().

int Transform::m_blockSize
protected

Definition at line 196 of file Transform.h.

Referenced by getBlockSize(), operator<(), operator==(), setBlockSize(), and toXml().

WindowType Transform::m_windowType
protected

Definition at line 197 of file Transform.h.

Referenced by getWindowType(), operator<(), operator==(), setWindowType(), and toXml().

RealTime Transform::m_startTime
protected

Definition at line 198 of file Transform.h.

Referenced by getStartTime(), operator<(), operator==(), setStartTime(), and toXml().

RealTime Transform::m_duration
protected

Definition at line 199 of file Transform.h.

Referenced by getDuration(), operator<(), operator==(), setDuration(), and toXml().

sv_samplerate_t Transform::m_sampleRate
protected

Definition at line 200 of file Transform.h.

Referenced by getSampleRate(), operator<(), operator==(), setSampleRate(), and toXml().

QString Transform::m_errorString
protected

Definition at line 201 of file Transform.h.

Referenced by getErrorString(), and Transform().


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