Public Member Functions

Processor Class Reference

A column processor able to use a column strategy to manipulate data. More...

#include <importfilemodel.h>

Collaboration diagram for Processor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Processor ()
 Processor (const Processor &original)
 ~Processor ()
const QVariant operator() (const QVariant &input) const
void setStrategy (const Strategy::StrategyType &type)
void setStrategyFormat (const QVariant &data, const Strategy::StrategyFormatTypes &fType)
const Strategy::StrategyType currentStrategy () const

Detailed Description

A column processor able to use a column strategy to manipulate data.

QVector sometimes, when resizing, copies the Processors. Therefore, the processors copy-constructor should be implemented decently!


Constructor & Destructor Documentation

Processor::Processor (  ) 

                     : strategy(0)
{
    setStrategy(Strategy::StrategyNone);
}

Processor::Processor ( const Processor original  ) 

                                              : m_settings(original.m_settings)
{
    setStrategy(original.currentStrategy());
}

Processor::~Processor (  ) 

{
    if (strategy) delete strategy;
}


Member Function Documentation

const Strategy::StrategyType Processor::currentStrategy (  )  const

Referenced by Processor().

{
    return strategy->name();
}

const QVariant Processor::operator() ( const QVariant input  )  const

{
    Q_ASSERT(strategy != 0);
    return strategy->process(input);
}

void Processor::setStrategy ( const Strategy::StrategyType type  ) 

Referenced by Processor().

{
    switch (type){
        if (strategy) delete strategy;
    case Strategy::StrategyNone: strategy = new Strategy(m_settings); break;
    case Strategy::StrategyTimestamp: strategy = new TimestampStrategy(m_settings); break;
    case Strategy::StrategySensorData: strategy = new DataStrategy(m_settings); Q_ASSERT(false); break;
    case Strategy::StrategySensorSqlData: strategy = new SqlDataStrategy(m_settings); break;
    }
}

void Processor::setStrategyFormat ( const QVariant data,
const Strategy::StrategyFormatTypes fType 
)

{
    m_settings.insert(fType, data);
    strategy->reconfigure();
}


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