SciDAVis  1.D4
Signals | Public Member Functions | Friends
AbstractColumn Class Reference

Interface definition for data with column logic. More...

#include <AbstractColumn.h>

Inheritance diagram for AbstractColumn:
AbstractAspect Column ColumnStringIO SimpleFilterColumn

List of all members.

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

Parameters:
ithe interval
invalidtrue: set invalid, false: set valid Overloaded function for convenience Set an interval masked
ithe interval
masktrue: mask, false: unmask Overloaded function for convenience
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().
AbstractAspectchild (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::Folderfolder ()
 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
AbstractAspectparentAspect () 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 Projectproject () const
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
virtual Projectproject ()
 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 &current_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.

Detailed Description

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.


Constructor & Destructor Documentation

AbstractColumn::AbstractColumn ( const QString &  name)
inline

Ctor.

virtual AbstractColumn::~AbstractColumn ( )
inlinevirtual

Dtor.

References aboutToBeDestroyed().


Member Function Documentation

void AbstractColumn::aboutToBeDestroyed ( const AbstractColumn source)
signal

Emitted shortly before this data source is deleted.

Parameters:
sourcethe object emitting this signal

This is needed by AbstractFilter.

Referenced by ~AbstractColumn().

void AbstractColumn::aboutToBeReplaced ( const AbstractColumn source,
const AbstractColumn new_col 
)
signal

The column will be replaced.

This is used then a column is replaced by another column, possibly of another type.

Parameters:
new_colPointer to the column this one is to be replaced with.
sourceis 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().

virtual void AbstractColumn::clear ( )
inlinevirtual

Set the column plot designation.

Clear the whole column

Reimplemented in Column.

virtual void AbstractColumn::clearFormulas ( )
inlinevirtual

Set a formula string for an interval of rows.

Overloaded function for convenience Clear all formulas

Reimplemented in Column.

virtual void AbstractColumn::clearMasks ( )
inlinevirtual

Clear all masking information.

Reimplemented in SimpleFilterColumn, and Column.

virtual void AbstractColumn::clearValidity ( )
inlinevirtual

Clear all validity information.

Reimplemented in Column.

virtual SciDAVis::ColumnMode AbstractColumn::columnMode ( ) const
pure virtual

Return the column mode.

Implemented in ColumnStringIO, SimpleFilterColumn, and Column.

Referenced by ColumnStringIO::copy(), AbstractFilter::input(), and ColumnFullCopyCmd::redo().

virtual bool AbstractColumn::copy ( const AbstractColumn other)
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.

virtual bool AbstractColumn::copy ( const AbstractColumn source,
int  source_start,
int  dest_start,
int  num_rows 
)
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.

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

Reimplemented in ColumnStringIO, and Column.

void AbstractColumn::dataAboutToChange ( const AbstractColumn source)
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().

void AbstractColumn::dataChanged ( const AbstractColumn source)
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().

virtual SciDAVis::ColumnDataType AbstractColumn::dataType ( ) const
pure virtual
virtual QDate AbstractColumn::dateAt ( int  row) const
inlinevirtual

Return the date part of row 'row'.

Use this only when dataType() is QDateTime

Reimplemented in SimpleFilterColumn, and Column.

virtual QDateTime AbstractColumn::dateTimeAt ( int  row) const
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().

virtual QString AbstractColumn::formula ( int  row) const
inlinevirtual

Return the formula associated with row 'row'.

Reimplemented in Column.

virtual QList< Interval<int> > AbstractColumn::formulaIntervals ( ) const
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:

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

Reimplemented in Column.

virtual void AbstractColumn::insertRows ( int  before,
int  count 
)
inlinevirtual

Insert some empty (or initialized with zero) rows.

Reimplemented in Column.

virtual QList< Interval<int> > AbstractColumn::invalidIntervals ( ) const
inlinevirtual

Return all intervals of invalid rows.

Reimplemented in SimpleFilterColumn, and Column.

Referenced by Column::Private::copy().

virtual bool AbstractColumn::isInvalid ( int  row) const
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().

virtual bool AbstractColumn::isInvalid ( Interval< int >  i) const
inlinevirtual

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

Reimplemented in SimpleFilterColumn, and Column.

References rowCount().

virtual bool AbstractColumn::isMasked ( int  row) const
inlinevirtual

Return whether a certain row is masked.

Reimplemented in SimpleFilterColumn, and Column.

virtual bool AbstractColumn::isMasked ( Interval< int >  i) const
inlinevirtual

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

Reimplemented in SimpleFilterColumn, and Column.

virtual bool AbstractColumn::isReadOnly ( ) const
inlinevirtual

Return whether the object is read-only.

Reimplemented in Column.

virtual QList< Interval<int> > AbstractColumn::maskedIntervals ( ) const
inlinevirtual

Return all intervals of masked rows.

Reimplemented in SimpleFilterColumn, and Column.

void AbstractColumn::maskingAboutToChange ( const AbstractColumn source)
signal
void AbstractColumn::maskingChanged ( const AbstractColumn source)
signal
void AbstractColumn::modeAboutToChange ( const AbstractColumn source)
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().

void AbstractColumn::modeChanged ( const AbstractColumn source)
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.

virtual void AbstractColumn::notifyReplacement ( const AbstractColumn replacement)
inlinevirtual

This must be called before the column is replaced by another.

Reimplemented in Column.

References aboutToBeReplaced().

virtual SciDAVis::PlotDesignation AbstractColumn::plotDesignation ( ) const
pure virtual

Return the column plot designation.

Implemented in ColumnStringIO, SimpleFilterColumn, and Column.

void AbstractColumn::plotDesignationAboutToChange ( const AbstractColumn source)
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().

void AbstractColumn::plotDesignationChanged ( const AbstractColumn source)
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().

virtual void AbstractColumn::removeRows ( int  first,
int  count 
)
inlinevirtual

Remove 'count' rows starting from row 'first'.

Reimplemented in Column.

virtual void AbstractColumn::replaceDateTimes ( int  first,
const QList< QDateTime > &  new_values 
)
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.

virtual void AbstractColumn::replaceTexts ( int  first,
const QStringList &  new_values 
)
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.

virtual void AbstractColumn::replaceValues ( int  first,
const QVector< double > &  new_values 
)
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

virtual int AbstractColumn::rowCount ( ) const
pure virtual
void AbstractColumn::rowsAboutToBeInserted ( const AbstractColumn source,
int  before,
int  count 
)
signal

Rows will be inserted.

Parameters:
sourcethe column that emitted the signal
beforethe row to insert before
countthe number of rows to be inserted

Referenced by AbstractSimpleFilter::inputRowsAboutToBeInserted().

void AbstractColumn::rowsAboutToBeRemoved ( const AbstractColumn source,
int  first,
int  count 
)
signal

Rows will be deleted.

Parameters:
sourcethe column that emitted the signal
firstthe first row to be deleted
countthe number of rows to be deleted

Referenced by AbstractSimpleFilter::inputRowsAboutToBeRemoved().

void AbstractColumn::rowsInserted ( const AbstractColumn source,
int  before,
int  count 
)
signal

Rows have been inserted.

Parameters:
sourcethe column that emitted the signal
beforethe row to insert before
countthe number of rows to be inserted

Referenced by AbstractSimpleFilter::inputRowsInserted().

void AbstractColumn::rowsRemoved ( const AbstractColumn source,
int  first,
int  count 
)
signal

Rows have been deleted.

Parameters:
sourcethe column that emitted the signal
firstthe first row that was deleted
countthe number of deleted rows

Referenced by AbstractSimpleFilter::inputRowsRemoved().

virtual void AbstractColumn::setColumnMode ( SciDAVis::ColumnMode  mode)
inlinevirtual

Set the column mode.

This sets the column mode and, if necessary, converts it to another datatype.

virtual QString AbstractColumn::textAt ( int  row) const
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().

virtual QTime AbstractColumn::timeAt ( int  row) const
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.

virtual double AbstractColumn::valueAt ( int  row) const
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().


Friends And Related Function Documentation

friend class AbstractSimpleFilter
friend

Reimplemented in SimpleFilterColumn.

friend class ColumnPrivate
friend
friend class SimpleCopyThroughFilter
friend
friend class SimpleMappingFilter
friend

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