JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches

internally stores information about one data column. See JKQTPDatastore for more information. More...

#include <jkqtpdatastorage.h>

Collaboration diagram for JKQTPColumn:
[legend]

Public Types

typedef JKQTPColumnConstIterator const_iterator
 
typedef JKQTPColumnIterator iterator
 

Public Member Functions

 JKQTPColumn ()
 
 JKQTPColumn (JKQTPDatastore *datastore, const QString &name=QString(""), size_t datastoreItem=0, size_t datastoreOffset=0, size_t imageColumns=1)
 class constructor that binds the column to a specific datastore object.
 
double & at (int n)
 returns a reference to the n -th row in this column (possibly throwing an exception if it does not exist!)
 
const double & at (int n) const
 returns a reference to the n -th row in this column (possibly throwing an exception if it does not exist!)
 
iterator begin ()
 returns an iterator to the internal data
 
const_iterator begin () const
 returns an iterator to the internal data
 
quint16 calculateChecksum () const
 calculates a checksum over the contents of the column (using qChecksum())
 
void copy (const double *data, size_t N, size_t offset=0)
 copy data from the given array into the column
 
QVector< double > copyData ()
 returns a QVector with the contained data (as a copy)
 
void copyData (QVector< double > &copyTo) const
 copies the contained data into a QVector
 
void decValue (size_t n, double decrement=1.0)
 decrement the n'th value from the column
 
iterator end ()
 returns an iterator to the internal data
 
const_iterator end () const
 returns an iterator to the internal data
 
void exchange (double value, double replace)
 exchange every occurence of a given value by a replace value
 
JKQTPDatastoreItemgetDatastoreItem ()
 returns a pointer to the datastore item representing this column
 
const JKQTPDatastoreItemgetDatastoreItem () const
 returns a pointer to the datastore item representing this column
 
size_t getDatastoreItemNum () const
 index of the item in the datastore that contains the data for this column
 
size_t getDatastoreOffset () const
 offset, if the datastore item contains more than one column
 
size_t getImageColumns () const
 number of columns, if interpreted as a row-major image
 
QString getName () const
 a name describing the column
 
double getPixelValue (size_t x, size_t y) const
 returns the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the width imageWidth
 
double * getPointer (size_t n=0)
 gets a pointer to the n-th value in the column
 
const double * getPointer (size_t n=0) const
 gets a pointer to the n-th value in the column
 
size_t getRows () const
 returns the number of rows in this column (accesses the datastore)
 
double getValue (int n) const
 reads the n'th value from the column
 
double getValue (size_t n) const
 reads the n'th value from the column
 
void incValue (size_t n, double increment=1.0)
 increment the n'th value from the column
 
bool isValid () const
 
bool operator== (const JKQTPColumn &other) const
 two columns are equal, if the same memory in the same datastore is referenced
 
void scale (double factor)
 scales all members of the column with the given factor
 
void setAll (double value)
 set all values in the column to a specific value
 
void setImageColumns (size_t imageWidth)
 number of columns, if interpreted as a row-major image
 
void setName (const QString &__value)
 a name describing the column
 
void setPixelValue (size_t x, size_t y, double val)
 sets the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the width imageWidth
 
void setPixelValue (size_t x, size_t y, size_t width, double val)
 sets the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the given width
 
void setValue (size_t n, double val)
 sets the n'th value from the column
 
void subtract (double value)
 subtracts a given value from all members of the column
 

Protected Member Functions

void erase (size_t row)
 removes the entry row
 
void erase (size_t row, size_t rowEnd)
 removes the entries row to rowEnd
 
JKQTPDatastoregetDatastore ()
 
const JKQTPDatastoregetDatastore () const
 
void replaceMemory (size_t datastoreItem_=0, size_t datastoreOffset_=0)
 

Private Attributes

JKQTPDatastoredatastore
 pointer to the datastore object used to manage the data of the plot
 
size_t datastoreItem
 index of the item in the datastore that contains the data for this column
 
size_t datastoreOffset
 offset, if the datastore item contains more than one column
 
size_t imageColumns
 number of columns, if interpreted as a row-major image
 
QString name
 a name describing the column
 
bool valid
 is this item valid?/usable?
 

Friends

class JKQTPColumnConstIterator
 
class JKQTPColumnIterator
 
class JKQTPDatastore
 

Detailed Description

internally stores information about one data column. See JKQTPDatastore for more information.

See also
JKQTPDatastore

Member Typedef Documentation

◆ const_iterator

◆ iterator

Constructor & Destructor Documentation

◆ JKQTPColumn() [1/2]

JKQTPColumn::JKQTPColumn ( )

◆ JKQTPColumn() [2/2]

JKQTPColumn::JKQTPColumn ( JKQTPDatastore datastore,
const QString &  name = QString(""),
size_t  datastoreItem = 0,
size_t  datastoreOffset = 0,
size_t  imageColumns = 1 
)

class constructor that binds the column to a specific datastore object.

The use of this constructor is mandatory. The default constructor (no arguments) is hidden. Also note that you cannot change the binding of a column to a datastore object after creation of the column.

Member Function Documentation

◆ at() [1/2]

double & JKQTPColumn::at ( int  n)
inline

returns a reference to the n -th row in this column (possibly throwing an exception if it does not exist!)

This method accesses the datastore and returns the double value stored in the n'th row of the according column.

See also
iterator

◆ at() [2/2]

const double & JKQTPColumn::at ( int  n) const
inline

returns a reference to the n -th row in this column (possibly throwing an exception if it does not exist!)

This method accesses the datastore and returns the double value stored in the n'th row of the according column.

See also
const_iterator

◆ begin() [1/2]

JKQTPColumn::iterator JKQTPColumn::begin ( )
inline

returns an iterator to the internal data

See also
JKQTPColumnIterator

◆ begin() [2/2]

JKQTPColumn::const_iterator JKQTPColumn::begin ( ) const
inline

returns an iterator to the internal data

See also
JKQTPColumnIterator

◆ calculateChecksum()

quint16 JKQTPColumn::calculateChecksum ( ) const
inline

calculates a checksum over the contents of the column (using qChecksum())

◆ copy()

void JKQTPColumn::copy ( const double *  data,
size_t  N,
size_t  offset = 0 
)

copy data from the given array into the column

This copies N elements from data into the column where the first overwritten column line is offset, so you can shift the location where the copy process starts.

◆ copyData() [1/2]

QVector< double > JKQTPColumn::copyData ( )

returns a QVector with the contained data (as a copy)

◆ copyData() [2/2]

void JKQTPColumn::copyData ( QVector< double > &  copyTo) const

copies the contained data into a QVector

◆ decValue()

void JKQTPColumn::decValue ( size_t  n,
double  decrement = 1.0 
)
inline

decrement the n'th value from the column

◆ end() [1/2]

JKQTPColumn::iterator JKQTPColumn::end ( )
inline

returns an iterator to the internal data

See also
JKQTPColumnIterator

◆ end() [2/2]

JKQTPColumn::const_iterator JKQTPColumn::end ( ) const
inline

returns an iterator to the internal data

See also
JKQTPColumnIterator

◆ erase() [1/2]

void JKQTPColumn::erase ( size_t  row)
inlineprotected

removes the entry row

◆ erase() [2/2]

void JKQTPColumn::erase ( size_t  row,
size_t  rowEnd 
)
inlineprotected

removes the entries row to rowEnd

◆ exchange()

void JKQTPColumn::exchange ( double  value,
double  replace 
)

exchange every occurence of a given value by a replace value

◆ getDatastore() [1/2]

JKQTPDatastore * JKQTPColumn::getDatastore ( )
inlineprotected

◆ getDatastore() [2/2]

const JKQTPDatastore * JKQTPColumn::getDatastore ( ) const
inlineprotected

◆ getDatastoreItem() [1/2]

JKQTPDatastoreItem * JKQTPColumn::getDatastoreItem ( )
inline

returns a pointer to the datastore item representing this column

◆ getDatastoreItem() [2/2]

const JKQTPDatastoreItem * JKQTPColumn::getDatastoreItem ( ) const
inline

returns a pointer to the datastore item representing this column

◆ getDatastoreItemNum()

size_t JKQTPColumn::getDatastoreItemNum ( ) const
inline

index of the item in the datastore that contains the data for this column

◆ getDatastoreOffset()

size_t JKQTPColumn::getDatastoreOffset ( ) const
inline

offset, if the datastore item contains more than one column

◆ getImageColumns()

size_t JKQTPColumn::getImageColumns ( ) const
inline

number of columns, if interpreted as a row-major image

◆ getName()

QString JKQTPColumn::getName ( ) const

a name describing the column

◆ getPixelValue()

double JKQTPColumn::getPixelValue ( size_t  x,
size_t  y 
) const
inline

returns the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the width imageWidth

This method accesses the datastore and returns the double value stored in the (y*imageColumns+x)'th row of the according column.

◆ getPointer() [1/2]

double * JKQTPColumn::getPointer ( size_t  n = 0)

gets a pointer to the n-th value in the column

◆ getPointer() [2/2]

const double * JKQTPColumn::getPointer ( size_t  n = 0) const

gets a pointer to the n-th value in the column

◆ getRows()

size_t JKQTPColumn::getRows ( ) const

returns the number of rows in this column (accesses the datastore)

◆ getValue() [1/2]

double JKQTPColumn::getValue ( int  n) const
inline

reads the n'th value from the column

This method accesses the datastore and returns the double value stored in the n'th row of the according column.

◆ getValue() [2/2]

double JKQTPColumn::getValue ( size_t  n) const
inline

reads the n'th value from the column

This method accesses the datastore and returns the double value stored in the n'th row of the according column.

◆ incValue()

void JKQTPColumn::incValue ( size_t  n,
double  increment = 1.0 
)
inline

increment the n'th value from the column

◆ isValid()

bool JKQTPColumn::isValid ( ) const
inline

◆ operator==()

bool JKQTPColumn::operator== ( const JKQTPColumn other) const
inline

two columns are equal, if the same memory in the same datastore is referenced

◆ replaceMemory()

void JKQTPColumn::replaceMemory ( size_t  datastoreItem_ = 0,
size_t  datastoreOffset_ = 0 
)
inlineprotected

◆ scale()

void JKQTPColumn::scale ( double  factor)

scales all members of the column with the given factor

◆ setAll()

void JKQTPColumn::setAll ( double  value)

set all values in the column to a specific value

◆ setImageColumns()

void JKQTPColumn::setImageColumns ( size_t  imageWidth)

number of columns, if interpreted as a row-major image

◆ setName()

void JKQTPColumn::setName ( const QString &  __value)

a name describing the column

◆ setPixelValue() [1/2]

void JKQTPColumn::setPixelValue ( size_t  x,
size_t  y,
double  val 
)
inline

sets the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the width imageWidth

This method accesses the datastore and returns the double value stored in the (y*imageColumns+x)'th row of the according column.

◆ setPixelValue() [2/2]

void JKQTPColumn::setPixelValue ( size_t  x,
size_t  y,
size_t  width,
double  val 
)
inline

sets the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the given width

This method accesses the datastore and returns the double value stored in the (y*width+x)'th row of the according column.

◆ setValue()

void JKQTPColumn::setValue ( size_t  n,
double  val 
)
inline

sets the n'th value from the column

This method accesses the datastore and sets the value stored in the n'th row of the according column.

◆ subtract()

void JKQTPColumn::subtract ( double  value)

subtracts a given value from all members of the column

Friends And Related Symbol Documentation

◆ JKQTPColumnConstIterator

friend class JKQTPColumnConstIterator
friend

◆ JKQTPColumnIterator

friend class JKQTPColumnIterator
friend

◆ JKQTPDatastore

friend class JKQTPDatastore
friend

Member Data Documentation

◆ datastore

JKQTPDatastore* JKQTPColumn::datastore
private

pointer to the datastore object used to manage the data of the plot

◆ datastoreItem

size_t JKQTPColumn::datastoreItem
private

index of the item in the datastore that contains the data for this column

◆ datastoreOffset

size_t JKQTPColumn::datastoreOffset
private

offset, if the datastore item contains more than one column

◆ imageColumns

size_t JKQTPColumn::imageColumns
private

number of columns, if interpreted as a row-major image

◆ name

QString JKQTPColumn::name
private

a name describing the column

◆ valid

bool JKQTPColumn::valid
private

is this item valid?/usable?


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