SciDAVis
1.D4
|
Interface definition for data with column logic. More...
#include <AbstractColumn.h>
Signals | |
void | aboutToBeDestroyed (const AbstractColumn *source) |
Emitted shortly before this data source is deleted. | |
void | aboutToBeReplaced (const AbstractColumn *source, const AbstractColumn *new_col) |
The column will be replaced. | |
void | dataAboutToChange (const AbstractColumn *source) |
Data (including validity) of the column will be changed. | |
void | dataChanged (const AbstractColumn *source) |
Data (including validity) of the column has changed. | |
void | maskingAboutToChange (const AbstractColumn *source) |
IntervalAttribute related signal. | |
void | maskingChanged (const AbstractColumn *source) |
IntervalAttribute related signal. | |
void | modeAboutToChange (const AbstractColumn *source) |
Column mode (possibly also the data type) will be changed. | |
void | modeChanged (const AbstractColumn *source) |
Column mode (possibly also the data type) changed. | |
void | plotDesignationAboutToChange (const AbstractColumn *source) |
Column plot designation will be changed. | |
void | plotDesignationChanged (const AbstractColumn *source) |
Column plot designation changed. | |
void | rowsAboutToBeInserted (const AbstractColumn *source, int before, int count) |
Rows will be inserted. | |
void | rowsAboutToBeRemoved (const AbstractColumn *source, int first, int count) |
Rows will be deleted. | |
void | rowsInserted (const AbstractColumn *source, int before, int count) |
Rows have been inserted. | |
void | rowsRemoved (const AbstractColumn *source, int first, int count) |
Rows have been deleted. | |
Signals inherited from AbstractAspect | |
void | aspectAboutToBeAdded (const AbstractAspect *parent, int index) |
Emit this when a parent aspect is about to get a new child inserted. | |
void | aspectAboutToBeRemoved (const AbstractAspect *aspect) |
Emit this from an aspect about to be removed from its parent's children. | |
void | aspectAboutToBeRemoved (const AbstractAspect *parent, int index) |
Emit this from a parent before removing its child. | |
void | aspectAdded (const AbstractAspect *aspect) |
Emit this from a newly added aspect. | |
void | aspectAdded (const AbstractAspect *parent, int index) |
Emit this from a parent after adding a new child to it. | |
void | aspectDescriptionAboutToChange (const AbstractAspect *aspect) |
Emit this before the name, comment or caption spec is changed. | |
void | aspectDescriptionChanged (const AbstractAspect *aspect) |
Emit this when the name, comment or caption spec changed. | |
void | aspectRemoved (const AbstractAspect *parent, int index) |
Emit this from the parent after removing a child. | |
void | statusInfo (const QString &text) |
Emit this to give status information to the user. |
Public Member Functions | |||||||||
AbstractColumn (const QString &name) | |||||||||
Ctor. | |||||||||
virtual void | clear () | ||||||||
Set the column plot designation. | |||||||||
virtual SciDAVis::ColumnMode | columnMode () const =0 | ||||||||
Return the column mode. | |||||||||
virtual bool | copy (const AbstractColumn *other) | ||||||||
Copy another column of the same type. | |||||||||
virtual bool | copy (const AbstractColumn *source, int source_start, int dest_start, int num_rows) | ||||||||
Copies part of another column of the same type. | |||||||||
virtual SciDAVis::ColumnDataType | dataType () const =0 | ||||||||
Return the data type of the column. | |||||||||
virtual void | insertRows (int before, int count) | ||||||||
Insert some empty (or initialized with zero) rows. | |||||||||
virtual bool | isReadOnly () const | ||||||||
Return whether the object is read-only. | |||||||||
virtual void | notifyReplacement (const AbstractColumn *replacement) | ||||||||
This must be called before the column is replaced by another. | |||||||||
virtual SciDAVis::PlotDesignation | plotDesignation () const =0 | ||||||||
Return the column plot designation. | |||||||||
virtual void | removeRows (int first, int count) | ||||||||
Remove 'count' rows starting from row 'first'. | |||||||||
virtual int | rowCount () const =0 | ||||||||
Return the data vector size. | |||||||||
virtual void | setColumnMode (SciDAVis::ColumnMode mode) | ||||||||
Set the column mode. | |||||||||
virtual | ~AbstractColumn () | ||||||||
Dtor. | |||||||||
IntervalAttribute related functions | |||||||||
virtual bool | isInvalid (int row) const | ||||||||
Return whether a certain row contains an invalid value. | |||||||||
virtual bool | isInvalid (Interval< int > i) const | ||||||||
Return whether a certain interval of rows contains only invalid values. | |||||||||
virtual QList< Interval< int > > | invalidIntervals () const | ||||||||
Return all intervals of invalid rows. | |||||||||
virtual bool | isMasked (int row) const | ||||||||
Return whether a certain row is masked. | |||||||||
virtual bool | isMasked (Interval< int > i) const | ||||||||
Return whether a certain interval of rows rows is fully masked. | |||||||||
virtual QList< Interval< int > > | maskedIntervals () const | ||||||||
Return all intervals of masked rows. | |||||||||
virtual void | clearValidity () | ||||||||
Clear all validity information. | |||||||||
virtual void | clearMasks () | ||||||||
Clear all masking information. | |||||||||
Formula related functions | |||||||||
Set an interval invalid or valid
| |||||||||
virtual QString | formula (int row) const | ||||||||
Return the formula associated with row 'row'. | |||||||||
virtual QList< Interval< int > > | formulaIntervals () const | ||||||||
Return the intervals that have associated formulas. | |||||||||
virtual void | clearFormulas () | ||||||||
Set a formula string for an interval of rows. | |||||||||
type specific functions | |||||||||
virtual QString | textAt (int row) const | ||||||||
Return the content of row 'row'. | |||||||||
virtual void | replaceTexts (int first, const QStringList &new_values) | ||||||||
Set the content of row 'row'. | |||||||||
virtual QDate | dateAt (int row) const | ||||||||
Return the date part of row 'row'. | |||||||||
virtual QTime | timeAt (int row) const | ||||||||
Set the content of row 'row'. | |||||||||
virtual QDateTime | dateTimeAt (int row) const | ||||||||
Set the content of row 'row'. | |||||||||
virtual void | replaceDateTimes (int first, const QList< QDateTime > &new_values) | ||||||||
Set the content of row 'row'. | |||||||||
virtual double | valueAt (int row) const | ||||||||
Return the double value in row 'row'. | |||||||||
virtual void | replaceValues (int first, const QVector< double > &new_values) | ||||||||
Set the content of row 'row'. | |||||||||
Public Member Functions inherited from AbstractAspect | |||||||||
AbstractAspect (const QString &name) | |||||||||
void | addChild (AbstractAspect *child) | ||||||||
Add the given Aspect to my list of children. | |||||||||
QString | caption () const | ||||||||
QString | captionSpec () const | ||||||||
Return the specification string used for constructing the caption(). | |||||||||
AbstractAspect * | child (int index) const | ||||||||
Get a child by its position in my list of children. | |||||||||
int | childCount () const | ||||||||
Return the number of child Aspects. | |||||||||
QString | comment () const | ||||||||
virtual QMenu * | createContextMenu () const | ||||||||
Return a new context menu. | |||||||||
QDateTime | creationTime () const | ||||||||
QList< AbstractAspect * > | descendantsThatInherit (const char *class_name) | ||||||||
Get all descendents that inherit the given class. | |||||||||
future::Folder * | folder () | ||||||||
Return the folder the Aspect is contained in or 0 if not. | |||||||||
virtual QIcon | icon () const | ||||||||
Return an icon to be used for decorating my views. | |||||||||
void | importV0x0001XXCreationTime (const QString &str) | ||||||||
int | index () const | ||||||||
Return my position in my parent's list of children. | |||||||||
int | indexOfChild (const AbstractAspect *child) const | ||||||||
Return the position of child in my list of children. | |||||||||
void | insertChild (AbstractAspect *child, int index) | ||||||||
Insert the given Aspect at a specific position in my list of children. | |||||||||
bool | isDescendantOf (AbstractAspect *other) | ||||||||
Return whether the there is a path upwards to the given aspect. | |||||||||
void | moveChild (int from, int to) | ||||||||
Change the positon of a child in my list of children. | |||||||||
QString | name () const | ||||||||
AbstractAspect * | parentAspect () const | ||||||||
Return my parent Aspect or 0 if I currently don't have one. | |||||||||
virtual QString | path () const | ||||||||
Return the path that leads from the top-most Aspect (usually a Project) to me. | |||||||||
virtual const Project * | project () const | ||||||||
Return the Project this Aspect belongs to, or 0 if it is currently not part of one. | |||||||||
virtual Project * | project () | ||||||||
Return the Project this Aspect belongs to, or 0 if it is currently not part of one. | |||||||||
virtual void | removeAllChildAspects () | ||||||||
Remove all child aspects. | |||||||||
void | removeChild (AbstractAspect *child, bool detach=false) | ||||||||
Remove the given Aspect from my list of children. | |||||||||
void | removeChild (int index) | ||||||||
Remove the Aspect at the given index from my list of children. | |||||||||
void | reparentChild (AbstractAspect *new_parent, AbstractAspect *child, int d_new_index) | ||||||||
Move a child to another aspect and transfer ownership. | |||||||||
void | reparentChild (AbstractAspect *new_parent, AbstractAspect *child) | ||||||||
Move a child to another aspect and transfer ownership. | |||||||||
virtual | ~AbstractAspect () | ||||||||
virtual QUndoStack * | undoStack () const | ||||||||
Return the undo stack of the Project, or 0 if this Aspect is not part of a Project. | |||||||||
void | exec (QUndoCommand *command) | ||||||||
Execute the given command, pushing it on the undoStack() if available. | |||||||||
void | beginMacro (const QString &text) | ||||||||
Begin an undo stack macro (series of commands) | |||||||||
void | endMacro () | ||||||||
End the undo stack macro. | |||||||||
virtual void | save (QXmlStreamWriter *) const | ||||||||
Save as XML. | |||||||||
virtual bool | load (XmlStreamReader *) | ||||||||
Load from XML. |
Friends | |
class | AbstractSimpleFilter |
class | ColumnPrivate |
class | SimpleCopyThroughFilter |
class | SimpleMappingFilter |
Additional Inherited Members | |
Public Slots inherited from AbstractAspect | |
virtual void | remove () |
Remove me from my parent's list of children. | |
void | setCaptionSpec (const QString &value) |
Set the specification string used for constructing the caption(). | |
void | setComment (const QString &value) |
void | setName (const QString &value) |
QString | uniqueNameFor (const QString ¤t_name) const |
Make the specified name unique among my children by incrementing a trailing number. | |
Static Public Member Functions inherited from AbstractAspect | |
static QVariant | global (const QString &key) |
Retrieve a global setting. | |
static void | setGlobal (const QString &key, const QVariant &value) |
Update a global setting. | |
static void | setGlobalDefault (const QString &key, const QVariant &value) |
Set default value for a global setting. | |
Protected Member Functions inherited from AbstractAspect | |
virtual void | completeAspectInsertion (AbstractAspect *aspect, int index) |
Called after a new child has been inserted or added. | |
void | info (const QString &text) |
Implementations should call this whenever status information should be given to the user. | |
virtual void | prepareAspectRemoval (AbstractAspect *aspect) |
Called before a child is removed. | |
void | setCreationTime (const QDateTime &time) |
Set the creation time. | |
bool | readBasicAttributes (XmlStreamReader *reader) |
Load name, creation time and caption spec from XML. | |
void | writeBasicAttributes (QXmlStreamWriter *writer) const |
Save name, creation time and caption spec to XML. | |
void | writeCommentElement (QXmlStreamWriter *writer) const |
Save the comment to XML. | |
bool | readCommentElement (XmlStreamReader *reader) |
Load comment from an XML element. |
Interface definition for data with column logic.
This is an abstract base class for column-based data, i.e. mathematically a vector or technically a 1D array or list. It only defines the interface but has no data members itself.
Classes derived from this are typically table columns or outputs of filters which can be chained between table columns and plots. From the point of view of the plot functions there will be no difference between a table column and a filter output since both use this interface.
Classes derived from this will either store a vector with entries of one certain data type, e.g. double, QString, QDateTime, or generate such values on demand. To determine the data type of a class derived from this, use the dataType() function. AbstractColumn defines all access functions for all supported data types but only those corresponding to the return value of dataType() will return a meaningful value. Calling functions not belonging to the data type of the column is safe, but will do nothing (writing function) or return some default value (reading functions).
This class also defines all signals which indicate a data change. Any class whose output values are subject to change over time must emit the according signals. These signals notify any object working with the column before and after a change of the column. In some cases it will be necessary for a class using the column to connect aboutToBeDestroyed(), to react to a column's deletion, e.g. a filter's reaction to a table deletion.
All writing functions have a "do nothing" standard implementation to make deriving a read-only class very easy without bothering about the writing interface.
|
inline |
Ctor.
|
inlinevirtual |
Dtor.
References aboutToBeDestroyed().
|
signal |
Emitted shortly before this data source is deleted.
source | the object emitting this signal |
This is needed by AbstractFilter.
Referenced by ~AbstractColumn().
|
signal |
The column will be replaced.
This is used then a column is replaced by another column, possibly of another type.
new_col | Pointer to the column this one is to be replaced with. |
source | is always a pointer to the column that emitted this signal. This way it's easier to use one handler for lots of columns. |
Referenced by notifyReplacement(), and Column::notifyReplacement().
|
inlinevirtual |
|
inlinevirtual |
Set a formula string for an interval of rows.
Overloaded function for convenience Clear all formulas
Reimplemented in Column.
|
inlinevirtual |
Clear all masking information.
Reimplemented in SimpleFilterColumn, and Column.
|
inlinevirtual |
Clear all validity information.
Reimplemented in Column.
|
pure virtual |
Return the column mode.
Implemented in ColumnStringIO, SimpleFilterColumn, and Column.
Referenced by ColumnStringIO::copy(), AbstractFilter::input(), and ColumnFullCopyCmd::redo().
|
inlinevirtual |
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.
Reimplemented in ColumnStringIO, and Column.
|
inlinevirtual |
Copies 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.
other | pointer to the column to copy |
src_start | first row to copy in the column to copy |
dest_start | first row to copy in |
num_rows | the number of rows to copy |
Reimplemented in ColumnStringIO, and Column.
|
signal |
Data (including validity) of the column will be changed.
'source' is always the this pointer of the column that emitted this signal. This way it's easier to use one handler for lots of columns.
Referenced by AbstractSimpleFilter::inputDataAboutToChange(), and AbstractSimpleFilter::inputModeAboutToChange().
|
signal |
Data (including validity) of the column has changed.
Important: When data has changed also the number of rows in the column may have changed without any other signal emission. 'source' is always the this pointer of the column that emitted this signal. This way it's easier to use one handler for lots of columns.
Referenced by AbstractSimpleFilter::inputDataChanged(), AbstractSimpleFilter::inputModeChanged(), and Column::notifyDisplayChange().
|
pure virtual |
Return the data type of the column.
Implemented in ColumnStringIO, SimpleFilterColumn, and Column.
Referenced by Column::Private::copy(), Column::copy(), DayOfWeek2DoubleFilter::inputAcceptable(), Month2DoubleFilter::inputAcceptable(), DateTime2DoubleFilter::inputAcceptable(), Double2DayOfWeekFilter::inputAcceptable(), Double2MonthFilter::inputAcceptable(), Double2DateTimeFilter::inputAcceptable(), Double2StringFilter::inputAcceptable(), String2DoubleFilter::inputAcceptable(), DateTime2StringFilter::inputAcceptable(), String2MonthFilter::inputAcceptable(), String2DateTimeFilter::inputAcceptable(), and String2DayOfWeekFilter::inputAcceptable().
|
inlinevirtual |
Return the date part of row 'row'.
Use this only when dataType() is QDateTime
Reimplemented in SimpleFilterColumn, and Column.
|
inlinevirtual |
Set the content of row 'row'.
Use this only when dataType() is QDateTime Return the QDateTime in row 'row' Use this only when dataType() is QDateTime
Reimplemented in SimpleFilterColumn, and Column.
Referenced by Column::Private::copy().
|
inlinevirtual |
Return the formula associated with row 'row'.
Reimplemented in Column.
|
inlinevirtual |
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:
Reimplemented in Column.
|
inlinevirtual |
Insert some empty (or initialized with zero) rows.
Reimplemented in Column.
|
inlinevirtual |
Return all intervals of invalid rows.
Reimplemented in SimpleFilterColumn, and Column.
Referenced by Column::Private::copy().
|
inlinevirtual |
Return whether a certain row contains an invalid value.
Reimplemented in ColumnStringIO, SimpleFilterColumn, and Column.
References rowCount().
Referenced by Column::Private::copy(), String2MonthFilter::isInvalid(), String2DateTimeFilter::isInvalid(), and String2DayOfWeekFilter::isInvalid().
|
inlinevirtual |
Return whether a certain interval of rows contains only invalid values.
Reimplemented in SimpleFilterColumn, and Column.
References rowCount().
|
inlinevirtual |
Return whether a certain row is masked.
Reimplemented in SimpleFilterColumn, and Column.
|
inlinevirtual |
Return whether a certain interval of rows rows is fully masked.
Reimplemented in SimpleFilterColumn, and Column.
|
inlinevirtual |
Return whether the object is read-only.
Reimplemented in Column.
|
inlinevirtual |
Return all intervals of masked rows.
Reimplemented in SimpleFilterColumn, and Column.
|
signal |
IntervalAttribute related signal.
Referenced by AbstractSimpleFilter::clearMasks(), SimpleCopyThroughFilter::inputMaskingAboutToChange(), and AbstractSimpleFilter::setMasked().
|
signal |
IntervalAttribute related signal.
Referenced by AbstractSimpleFilter::clearMasks(), SimpleCopyThroughFilter::inputMaskingChanged(), and AbstractSimpleFilter::setMasked().
|
signal |
Column mode (possibly also the data type) will be changed.
'source' is always the this pointer of the column that emitted this signal. This way it's easier to use one handler for lots of columns.
Referenced by Column::Private::setColumnMode().
|
signal |
Column mode (possibly also the data type) changed.
'source' is always the this pointer of the column that emitted this signal. This way it's easier to use one handler for lots of columns.
|
inlinevirtual |
This must be called before the column is replaced by another.
Reimplemented in Column.
References aboutToBeReplaced().
|
pure virtual |
Return the column plot designation.
Implemented in ColumnStringIO, SimpleFilterColumn, and Column.
|
signal |
Column plot designation will be changed.
'source' is always the this pointer of the column that emitted this signal. This way it's easier to use one handler for lots of columns.
Referenced by AbstractSimpleFilter::inputPlotDesignationAboutToChange().
|
signal |
Column plot designation changed.
'source' is always the this pointer of the column that emitted this signal. This way it's easier to use one handler for lots of columns.
Referenced by AbstractSimpleFilter::inputPlotDesignationChanged().
|
inlinevirtual |
Remove 'count' rows starting from row 'first'.
Reimplemented in Column.
|
inlinevirtual |
Set the content of row 'row'.
Use this only when dataType() is QDateTime Replace a range of values Use this only when dataType() is QDateTime
Reimplemented in Column.
|
inlinevirtual |
Set the content of row 'row'.
Use this only when dataType() is QString Replace a range of values Use this only when dataType() is QString
Reimplemented in ColumnStringIO, and Column.
|
inlinevirtual |
Set the content of row 'row'.
Use this only when dataType() is double Replace a range of values Use this only when dataType() is double
|
pure virtual |
Return the data vector size.
Implemented in ColumnStringIO, SimpleFilterColumn, and Column.
Referenced by Column::Private::copy(), future::Table::handleDataChange(), future::Table::handleRowsAboutToBeInserted(), future::Table::handleRowsInserted(), future::Table::handleRowsRemoved(), and isInvalid().
|
signal |
Rows will be inserted.
source | the column that emitted the signal |
before | the row to insert before |
count | the number of rows to be inserted |
Referenced by AbstractSimpleFilter::inputRowsAboutToBeInserted().
|
signal |
Rows will be deleted.
source | the column that emitted the signal |
first | the first row to be deleted |
count | the number of rows to be deleted |
Referenced by AbstractSimpleFilter::inputRowsAboutToBeRemoved().
|
signal |
Rows have been inserted.
source | the column that emitted the signal |
before | the row to insert before |
count | the number of rows to be inserted |
Referenced by AbstractSimpleFilter::inputRowsInserted().
|
signal |
Rows have been deleted.
source | the column that emitted the signal |
first | the first row that was deleted |
count | the number of deleted rows |
Referenced by AbstractSimpleFilter::inputRowsRemoved().
|
inlinevirtual |
Set the column mode.
This sets the column mode and, if necessary, converts it to another datatype.
|
inlinevirtual |
Return the content of row 'row'.
Use this only when dataType() is QString
Reimplemented in ColumnStringIO, SimpleFilterColumn, and Column.
Referenced by Column::Private::copy(), and future::Table::text().
|
inlinevirtual |
Set the content of row 'row'.
Use this only when dataType() is QDateTime Return the time part of row 'row' Use this only when dataType() is QDateTime
Reimplemented in SimpleFilterColumn, and Column.
|
inlinevirtual |
Return the double value in row 'row'.
Use this only when dataType() is double
Reimplemented in SimpleFilterColumn, and Column.
Referenced by Column::Private::copy().
|
friend |
Reimplemented in SimpleFilterColumn.
|
friend |
|
friend |
Referenced by Column::Private::Private(), and Column::Private::setColumnMode().
|
friend |