SciDAVis  1.D4
Public Member Functions
Column::Private Class Reference

Private data class of Column. More...

#include <ColumnPrivate.h>

List of all members.

Public Member Functions

void clear ()
 Clear the whole column.
SciDAVis::ColumnMode columnMode () const
 Return the column mode.
QString comment () const
 Return the column comment.
bool copy (const AbstractColumn *other)
 Copy another column of the same type.
bool copy (const AbstractColumn *source, int source_start, int dest_start, int num_rows)
 Copies a part of another column of the same type.
bool copy (const Private *other)
 Copy another column of the same type.
bool copy (const Private *source, int source_start, int dest_start, int num_rows)
 Copies a part of another column of the same type.
void * dataPointer () const
 Return the data pointer.
SciDAVis::ColumnDataType dataType () const
 Return the data type of the column.
IntervalAttribute< QString > formulaAttribute ()
 Return the interval attribute representing the formula strings.
AbstractSimpleFilterinputFilter () const
 Return the input filter (for string -> data type conversion)
void insertRows (int before, int count)
 Insert some empty (or initialized with zero) rows.
bool isReadOnly () const
 Return whether the object is read-only.
IntervalAttribute< bool > maskingAttribute ()
 Return the masking interval attribute.
QString name () const
 Return the column name/label.
AbstractSimpleFilteroutputFilter () const
 Return the output filter (for data type -> string conversion)
SciDAVis::PlotDesignation plotDesignation () const
 Return the column plot designation.
 Private (Column *owner, SciDAVis::ColumnMode mode)
 Ctor.
 Private (Column *owner, SciDAVis::ColumnDataType type, SciDAVis::ColumnMode mode, void *data, IntervalAttribute< bool > validity)
 Special ctor (to be called from Column only!)
void removeRows (int first, int count)
 Remove 'count' rows starting from row 'first'.
void replaceData (void *data, IntervalAttribute< bool > validity)
 Replace data pointer and validity.
void replaceFormulas (IntervalAttribute< QString > formulas)
 Replace the interval attribute for the formula strings.
void replaceMasking (IntervalAttribute< bool > masking)
 Replace the list of intervals of masked rows.
void replaceModeData (SciDAVis::ColumnMode mode, SciDAVis::ColumnDataType type, void *data, AbstractSimpleFilter *in_filter, AbstractSimpleFilter *out_filter, IntervalAttribute< bool > validity)
 Replace all mode related members.
void resizeTo (int new_size)
 Resize the vector to the specified number of rows.
int rowCount () const
 Return the data vector size.
void setColumnMode (SciDAVis::ColumnMode mode, AbstractFilter *conversion_filter)
 Set the column mode.
void setPlotDesignation (SciDAVis::PlotDesignation pd)
 Set the column plot designation.
IntervalAttribute< bool > validityAttribute ()
 Return the validity interval attribute.
 ~Private ()
 Dtor.
IntervalAttribute related functions
bool isInvalid (int row) const
 Return whether a certain row contains an invalid value.
bool isInvalid (Interval< int > i) const
 Return whether a certain interval of rows contains only invalid values.
QList< Interval< int > > invalidIntervals () const
 Return all intervals of invalid rows.
bool isMasked (int row) const
 Return whether a certain row is masked.
bool isMasked (Interval< int > i) const
 Return whether a certain interval of rows rows is fully masked.
QList< Interval< int > > maskedIntervals () const
 Return all intervals of masked rows.
void clearValidity ()
 Clear all validity information.
void clearMasks ()
 Clear all masking information.
void setInvalid (Interval< int > i, bool invalid=true)
 Set an interval invalid or valid.
void setInvalid (int row, bool invalid=true)
 Overloaded function for convenience.
void setMasked (Interval< int > i, bool mask=true)
 Set an interval masked.
void setMasked (int row, bool mask=true)
 Overloaded function for convenience.
Formula related functions
QString formula (int row) const
 Return the formula associated with row 'row'.
QList< Interval< int > > formulaIntervals () const
 Return the intervals that have associated formulas.
void setFormula (Interval< int > i, QString formula)
 Set a formula string for an interval of rows.
void setFormula (int row, QString formula)
 Overloaded function for convenience.
void clearFormulas ()
 Clear all formulas.
type specific functions
QString textAt (int row) const
 Return the content of row 'row'.
void setTextAt (int row, const QString &new_value)
 Set the content of row 'row'.
void replaceTexts (int first, const QStringList &new_values)
 Replace a range of values.
QDate dateAt (int row) const
 Return the date part of row 'row'.
void setDateAt (int row, const QDate &new_value)
 Set the content of row 'row'.
QTime timeAt (int row) const
 Return the time part of row 'row'.
void setTimeAt (int row, const QTime &new_value)
 Set the content of row 'row'.
QDateTime dateTimeAt (int row) const
 Return the QDateTime in row 'row'.
void setDateTimeAt (int row, const QDateTime &new_value)
 Set the content of row 'row'.
void replaceDateTimes (int first, const QList< QDateTime > &new_values)
 Replace a range of values.
double valueAt (int row) const
 Return the double value in row 'row'.
void setValueAt (int row, double new_value)
 Set the content of row 'row'.
void replaceValues (int first, const QVector< qreal > &new_values)
 Replace a range of values.

Private Attributes

data members
SciDAVis::ColumnDataType d_data_type
 Data type string.
SciDAVis::ColumnMode d_column_mode
 The column mode.
void * d_data
 Pointer to the data vector.
AbstractSimpleFilterd_input_filter
 The input filter (for string -> data type conversion)
AbstractSimpleFilterd_output_filter
 The output filter (for data type -> string conversion)
IntervalAttribute< bool > d_validity
IntervalAttribute< bool > d_masking
IntervalAttribute< QString > d_formulas
SciDAVis::PlotDesignation d_plot_designation
 The plot designation.
Columnd_owner
 The owner column.

Detailed Description

Private data class of Column.

The writing interface defined here is only to be used by column commands and Column contructors.


Constructor & Destructor Documentation

Column::Private::Private ( Column owner,
SciDAVis::ColumnMode  mode 
)
Column::Private::~Private ( )
Column::Private::Private ( Column owner,
SciDAVis::ColumnDataType  type,
SciDAVis::ColumnMode  mode,
void *  data,
IntervalAttribute< bool >  validity 
)

Member Function Documentation

void Column::Private::clear ( )

Clear the whole column.

References Column::removeRows(), and Column::rowCount().

void Column::Private::clearFormulas ( )

Clear all formulas.

Referenced by ColumnClearFormulasCmd::redo().

void Column::Private::clearMasks ( )

Clear all masking information.

Referenced by ColumnClearMasksCmd::redo().

void Column::Private::clearValidity ( )

Clear all validity information.

Referenced by ColumnClearValidityCmd::redo().

SciDAVis::ColumnMode Column::Private::columnMode ( ) const
inline

Return the column mode.

This function is most used by tables but can also be used by plots. The column mode specifies how to interpret the values in the column additional to the data type.

References d_column_mode.

Referenced by Column::columnMode(), ColumnSetModeCmd::redo(), ColumnPartialCopyCmd::redo(), and ColumnRemoveRowsCmd::redo().

QString Column::Private::comment ( ) const

Return the column comment.

bool Column::Private::copy ( const AbstractColumn other)

Copy another column of the same type.

This function will return false if the data type of 'other' is not the same as the type of 'this'. The validity information for the rows is also copied. Use a filter to convert a column to another type.

References AbstractColumn::dataType(), Column::dataType(), AbstractColumn::dateTimeAt(), AbstractColumn::invalidIntervals(), AbstractColumn::rowCount(), AbstractColumn::textAt(), SciDAVis::TypeDouble, SciDAVis::TypeQDateTime, SciDAVis::TypeQString, and AbstractColumn::valueAt().

Referenced by ColumnFullCopyCmd::redo(), ColumnPartialCopyCmd::redo(), ColumnPartialCopyCmd::undo(), and ColumnRemoveRowsCmd::undo().

bool Column::Private::copy ( const AbstractColumn source,
int  source_start,
int  dest_start,
int  num_rows 
)

Copies a part of another column of the same type.

This function will return false if the data type of 'other' is not the same as the type of 'this'. The validity information for the rows is also copied.

Parameters:
otherpointer to the column to copy
src_startfirst row to copy in the column to copy
dest_startfirst row to copy in
num_rowsthe number of rows to copy

References AbstractColumn::dataType(), Column::dataType(), AbstractColumn::dateTimeAt(), AbstractColumn::isInvalid(), Column::rowCount(), AbstractColumn::textAt(), SciDAVis::TypeDouble, SciDAVis::TypeQDateTime, SciDAVis::TypeQString, and AbstractColumn::valueAt().

bool Column::Private::copy ( const Private other)

Copy another column of the same type.

This function will return false if the data type of 'other' is not the same as the type of 'this'. The validity information for the rows is also copied. Use a filter to convert a column to another type.

References Column::dataType(), SciDAVis::TypeDouble, SciDAVis::TypeQDateTime, and SciDAVis::TypeQString.

bool Column::Private::copy ( const Private source,
int  source_start,
int  dest_start,
int  num_rows 
)

Copies a part of another column of the same type.

This function will return false if the data type of 'other' is not the same as the type of 'this'. The validity information for the rows is also copied.

Parameters:
otherpointer to the column to copy
src_startfirst row to copy in the column to copy
dest_startfirst row to copy in
num_rowsthe number of rows to copy

References Column::dataType(), Column::rowCount(), SciDAVis::TypeDouble, SciDAVis::TypeQDateTime, and SciDAVis::TypeQString.

void* Column::Private::dataPointer ( ) const
inline
SciDAVis::ColumnDataType Column::Private::dataType ( ) const
inline

Return the data type of the column.

References d_data_type.

Referenced by Column::dataType(), ColumnSetModeCmd::redo(), and ColumnClearCmd::redo().

QDate Column::Private::dateAt ( int  row) const

Return the date part of row 'row'.

Use this only when dataType() is QDateTime

References Column::dateTimeAt().

Referenced by Column::dateAt().

QDateTime Column::Private::dateTimeAt ( int  row) const

Return the QDateTime in row 'row'.

Use this only when dataType() is QDateTime

References SciDAVis::TypeQDateTime.

Referenced by Column::dateTimeAt(), and ColumnSetDateTimeCmd::redo().

QString Column::Private::formula ( int  row) const
inline

Return the formula associated with row 'row'.

References d_formulas, and IntervalAttribute< T >::value().

Referenced by Column::formula().

IntervalAttribute<QString> Column::Private::formulaAttribute ( )
inline

Return the interval attribute representing the formula strings.

References d_formulas.

Referenced by ColumnRemoveRowsCmd::redo(), ColumnSetFormulaCmd::redo(), and ColumnClearFormulasCmd::redo().

QList< Interval<int> > Column::Private::formulaIntervals ( ) const
inline

Return the intervals that have associated formulas.

This can be used to make a list of formulas with their intervals. Here is some example code:

QStringList list;
QList< Interval<int> > intervals = my_column.formulaIntervals();
foreach(Interval<int> interval, intervals)
list << QString(interval.toString() + ": " + my_column.formula(interval.start()));

References d_formulas, and IntervalAttribute< T >::intervals().

Referenced by Column::formulaIntervals().

AbstractSimpleFilter* Column::Private::inputFilter ( ) const
inline

Return the input filter (for string -> data type conversion)

References d_input_filter.

Referenced by Column::Column(), ColumnSetModeCmd::redo(), Column::save(), Column::setColumnMode(), and Column::XmlReadInputFilter().

void Column::Private::insertRows ( int  before,
int  count 
)

Insert some empty (or initialized with zero) rows.

References Column::rowCount(), SciDAVis::TypeDouble, SciDAVis::TypeQDateTime, and SciDAVis::TypeQString.

Referenced by ColumnInsertEmptyRowsCmd::redo(), and ColumnRemoveRowsCmd::undo().

QList< Interval<int> > Column::Private::invalidIntervals ( ) const
inline

Return all intervals of invalid rows.

References d_validity, and IntervalAttribute< bool >::intervals().

Referenced by Column::invalidIntervals(), and ColumnFullCopyCmd::redo().

bool Column::Private::isInvalid ( int  row) const
inline

Return whether a certain row contains an invalid value.

References d_validity, and IntervalAttribute< bool >::isSet().

Referenced by Column::isInvalid().

bool Column::Private::isInvalid ( Interval< int >  i) const
inline

Return whether a certain interval of rows contains only invalid values.

References d_validity, and IntervalAttribute< bool >::isSet().

bool Column::Private::isMasked ( int  row) const
inline

Return whether a certain row is masked.

References d_masking, and IntervalAttribute< bool >::isSet().

Referenced by Column::isMasked().

bool Column::Private::isMasked ( Interval< int >  i) const
inline

Return whether a certain interval of rows rows is fully masked.

References d_masking, and IntervalAttribute< bool >::isSet().

bool Column::Private::isReadOnly ( ) const
inline

Return whether the object is read-only.

QList< Interval<int> > Column::Private::maskedIntervals ( ) const
inline

Return all intervals of masked rows.

References d_masking, and IntervalAttribute< bool >::intervals().

Referenced by Column::maskedIntervals().

IntervalAttribute<bool> Column::Private::maskingAttribute ( )
inline

Return the masking interval attribute.

References d_masking.

Referenced by ColumnRemoveRowsCmd::redo(), ColumnClearMasksCmd::redo(), and ColumnSetMaskedCmd::redo().

QString Column::Private::name ( ) const
AbstractSimpleFilter* Column::Private::outputFilter ( ) const
inline

Return the output filter (for data type -> string conversion)

References d_output_filter.

Referenced by Column::outputFilter(), and ColumnSetModeCmd::redo().

SciDAVis::PlotDesignation Column::Private::plotDesignation ( ) const
inline

Return the column plot designation.

References d_plot_designation.

Referenced by Column::plotDesignation(), and ColumnSetPlotDesignationCmd::redo().

void Column::Private::removeRows ( int  first,
int  count 
)
void Column::Private::replaceData ( void *  data,
IntervalAttribute< bool >  validity 
)
void Column::Private::replaceDateTimes ( int  first,
const QList< QDateTime > &  new_values 
)

Replace a range of values.

Use this only when dataType() is QDateTime

References Column::rowCount(), and SciDAVis::TypeQDateTime.

Referenced by ColumnReplaceDateTimesCmd::redo(), and ColumnReplaceDateTimesCmd::undo().

void Column::Private::replaceFormulas ( IntervalAttribute< QString >  formulas)

Replace the interval attribute for the formula strings.

Referenced by ColumnRemoveRowsCmd::undo(), ColumnSetFormulaCmd::undo(), and ColumnClearFormulasCmd::undo().

void Column::Private::replaceMasking ( IntervalAttribute< bool >  masking)

Replace the list of intervals of masked rows.

Referenced by ColumnRemoveRowsCmd::undo(), ColumnClearMasksCmd::undo(), and ColumnSetMaskedCmd::undo().

void Column::Private::replaceModeData ( SciDAVis::ColumnMode  mode,
SciDAVis::ColumnDataType  type,
void *  data,
AbstractSimpleFilter in_filter,
AbstractSimpleFilter out_filter,
IntervalAttribute< bool >  validity 
)

Replace all mode related members.

Replace column mode, data type, data pointer, validity and filters directly

References SciDAVis::DateTime, SciDAVis::Day, AbstractFilter::input(), SciDAVis::Month, Column::notifyDisplayChange(), SciDAVis::Numeric, and AbstractAspect::setName().

Referenced by ColumnSetModeCmd::redo(), and ColumnSetModeCmd::undo().

void Column::Private::replaceTexts ( int  first,
const QStringList &  new_values 
)

Replace a range of values.

Use this only when dataType() is QString

References Column::rowCount(), and SciDAVis::TypeQString.

Referenced by ColumnReplaceTextsCmd::redo(), and ColumnReplaceTextsCmd::undo().

void Column::Private::replaceValues ( int  first,
const QVector< qreal > &  new_values 
)

Replace a range of values.

Use this only when dataType() is double

References Column::rowCount(), and SciDAVis::TypeDouble.

Referenced by ColumnReplaceValuesCmd::redo(), and ColumnReplaceValuesCmd::undo().

void Column::Private::resizeTo ( int  new_size)

Resize the vector to the specified number of rows.

Since selecting and masking rows higher than the real internal number of rows is supported, this does not change the interval attributes. Also no signal is emitted. If the new rows are filled with values AbstractColumn::dataChanged() must be emitted.

References Column::rowCount(), SciDAVis::TypeDouble, SciDAVis::TypeQDateTime, and SciDAVis::TypeQString.

Referenced by ColumnPartialCopyCmd::undo(), ColumnRemoveRowsCmd::undo(), ColumnSetTextCmd::undo(), ColumnSetValueCmd::undo(), ColumnSetDateTimeCmd::undo(), ColumnReplaceTextsCmd::undo(), ColumnReplaceValuesCmd::undo(), and ColumnReplaceDateTimesCmd::undo().

int Column::Private::rowCount ( ) const

Return the data vector size.

This returns the number of rows that actually contain data. Rows beyond this can be masked etc. but should be ignored by filters, plots etc.

References SciDAVis::TypeDouble, SciDAVis::TypeQDateTime, and SciDAVis::TypeQString.

Referenced by ColumnPartialCopyCmd::redo(), ColumnRemoveRowsCmd::redo(), ColumnSetTextCmd::redo(), ColumnSetValueCmd::redo(), ColumnSetDateTimeCmd::redo(), ColumnReplaceTextsCmd::redo(), ColumnReplaceValuesCmd::redo(), ColumnReplaceDateTimesCmd::redo(), and Column::rowCount().

void Column::Private::setColumnMode ( SciDAVis::ColumnMode  mode,
AbstractFilter conversion_filter 
)
void Column::Private::setDateAt ( int  row,
const QDate &  new_value 
)

Set the content of row 'row'.

Use this only when dataType() is QDateTime

References Column::setDateTimeAt(), Column::timeAt(), and SciDAVis::TypeQDateTime.

void Column::Private::setDateTimeAt ( int  row,
const QDateTime &  new_value 
)

Set the content of row 'row'.

Use this only when dataType() is QDateTime

References Interval< T >::isValid(), Column::rowCount(), and SciDAVis::TypeQDateTime.

Referenced by ColumnSetDateTimeCmd::redo(), and ColumnSetDateTimeCmd::undo().

void Column::Private::setFormula ( Interval< int >  i,
QString  formula 
)

Set a formula string for an interval of rows.

Referenced by ColumnSetFormulaCmd::redo().

void Column::Private::setFormula ( int  row,
QString  formula 
)

Overloaded function for convenience.

References Column::setFormula().

void Column::Private::setInvalid ( Interval< int >  i,
bool  invalid = true 
)

Set an interval invalid or valid.

Parameters:
ithe interval
invalidtrue: set invalid, false: set valid

Referenced by ColumnSetInvalidCmd::redo().

void Column::Private::setInvalid ( int  row,
bool  invalid = true 
)

Overloaded function for convenience.

References Column::setInvalid().

void Column::Private::setMasked ( Interval< int >  i,
bool  mask = true 
)

Set an interval masked.

Parameters:
ithe interval
masktrue: mask, false: unmask

Referenced by ColumnSetMaskedCmd::redo().

void Column::Private::setMasked ( int  row,
bool  mask = true 
)

Overloaded function for convenience.

References Column::setMasked().

void Column::Private::setPlotDesignation ( SciDAVis::PlotDesignation  pd)

Set the column plot designation.

Referenced by ColumnSetPlotDesignationCmd::redo(), and ColumnSetPlotDesignationCmd::undo().

void Column::Private::setTextAt ( int  row,
const QString &  new_value 
)

Set the content of row 'row'.

Use this only when dataType() is QString

References Column::rowCount(), and SciDAVis::TypeQString.

Referenced by ColumnSetTextCmd::redo(), and ColumnSetTextCmd::undo().

void Column::Private::setTimeAt ( int  row,
const QTime &  new_value 
)

Set the content of row 'row'.

Use this only when dataType() is QDateTime

References Column::dateAt(), Column::setDateTimeAt(), and SciDAVis::TypeQDateTime.

void Column::Private::setValueAt ( int  row,
double  new_value 
)

Set the content of row 'row'.

Use this only when dataType() is double

References Column::rowCount(), and SciDAVis::TypeDouble.

Referenced by ColumnSetValueCmd::redo(), and ColumnSetValueCmd::undo().

QString Column::Private::textAt ( int  row) const

Return the content of row 'row'.

Use this only when dataType() is QString

References SciDAVis::TypeQString.

Referenced by ColumnSetTextCmd::redo(), and Column::textAt().

QTime Column::Private::timeAt ( int  row) const

Return the time part of row 'row'.

Use this only when dataType() is QDateTime

References Column::dateTimeAt().

Referenced by Column::timeAt().

IntervalAttribute<bool> Column::Private::validityAttribute ( )
inline
double Column::Private::valueAt ( int  row) const

Return the double value in row 'row'.

References SciDAVis::TypeDouble.

Referenced by ColumnSetValueCmd::redo(), and Column::valueAt().


Member Data Documentation

SciDAVis::ColumnMode Column::Private::d_column_mode
private

The column mode.

The column mode specifies how to interpret the values in the column additional to the data type.

Referenced by columnMode(), and Private().

void* Column::Private::d_data
private

Pointer to the data vector.

This will point to a QVector<double>, QStringList or QList<QDateTime> depending on the stored data type.

Referenced by dataPointer(), and Private().

SciDAVis::ColumnDataType Column::Private::d_data_type
private

Data type string.

double, QString, or QDateTime

Referenced by dataType(), and Private().

IntervalAttribute<QString> Column::Private::d_formulas
private
AbstractSimpleFilter* Column::Private::d_input_filter
private

The input filter (for string -> data type conversion)

Referenced by inputFilter(), and Private().

IntervalAttribute<bool> Column::Private::d_masking
private
AbstractSimpleFilter* Column::Private::d_output_filter
private

The output filter (for data type -> string conversion)

Referenced by outputFilter(), and Private().

Column* Column::Private::d_owner
private

The owner column.

Referenced by Private().

SciDAVis::PlotDesignation Column::Private::d_plot_designation
private

The plot designation.

Referenced by plotDesignation(), and Private().

IntervalAttribute<bool> Column::Private::d_validity
private

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