Workspace 6.21.5
Public Types | Public Member Functions | Public Attributes | List of all members
NamedDimensionRange Class Reference

A name and range of a dimension, generally used with an ArrayNd object. More...

#include <DataAnalysis/DataStructures/nameddimensionrange.h>

Inheritance diagram for NamedDimensionRange:
[legend]

Public Types

typedef int size_type
 

Public Member Functions

 NamedDimensionRange (const NamedDimensionRange &other)
 
 NamedDimensionRange (const QString &dimensionName="<noname>", size_type firstElem=0, size_type lastElem=0)
 
NamedDimensionRangeclone () const override
 
size_type numElements () const
 
NamedDimensionRangeoperator= (const NamedDimensionRange &rhs)
 
- Public Member Functions inherited from ObjectGroup
 ~ObjectGroup () override
 
bool add (const QString &name, DataObject &obj)
 
bool canSerialize () const override
 
ObjectGroupclone () const override=0
 
bool empty () const
 
void ensureGroupHasData ()
 
void erase (int index)
 
DataObjectgetChild (const QString &name)
 
const DataObjectgetChild (const QString &name) const
 
DataObjectgetDataObject (int index)
 
const DataObjectgetDataObject (int index) const
 
int getIndex (const QString &name) const
 
const QString & getName (int index) const
 
virtual QString getPreferedWidget (const QString &name) const
 
bool hasData () const
 
bool haveName (const QString &name) const
 
bool insert (const QString &name, DataObject &obj, int index=-1)
 
bool load (const QJsonDocument &doc)
 
bool load (const SerializedItem &item) override
 
bool save (QJsonDocument &doc) const
 
bool save (SerializedItem &item) const override
 
unsigned size () const
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 
- Public Member Functions inherited from Serialize
virtual ~Serialize ()=default
 
virtual bool canSerialize () const =0
 
virtual bool load (const SerializedItem &item)=0
 
virtual bool save (SerializedItem &item) const =0
 

Public Attributes

DataExecution::TypedObject< size_typefirst
 
DataExecution::TypedObject< ArrayNdDimensionLabelslabels
 
DataExecution::TypedObject< size_typelast
 
DataExecution::TypedObject< QString > name
 
DataExecution::TypedObject< bool > unlimited
 

Additional Inherited Members

- Protected Member Functions inherited from ObjectGroup
 ObjectGroup ()
 
void clear ()
 
ObjectGroupoperator= (const ObjectGroup &rhs)
 
bool operator== (const ObjectGroup &rhs) const
 
void swap (ObjectGroup &rhs)
 

Detailed Description

The NamedDimensionRange class allows us to specify a name and a dimension range for a single dimension. When combined with other dimensions, we have a set of bounding coordinates that define a range in a dataset. It can therefore be used to define the sections of an ArrayNd structure that we read from / wrte to.

Member Typedef Documentation

◆ size_type

typedef int size_type

size_type is used to represent the size, number of elements and indices of the dimension range. We have chosen a 64bit integer here, as some of the known datasets we work with are larger than 4 gigabytes in size.

Constructor & Destructor Documentation

◆ NamedDimensionRange() [1/2]

NamedDimensionRange ( const QString &  dimensionName = "<noname>",
NamedDimensionRange::size_type  firstElem = 0,
NamedDimensionRange::size_type  lastElem = 0 
)

Constructor with default arguments.

Exceptions
std::runtime_errorIf constructor is called with an empty dimensionName.

◆ NamedDimensionRange() [2/2]

Member Function Documentation

◆ clone()

NamedDimensionRange * clone ( ) const
overridevirtual
Returns
A clone of this object.
Note
Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.

We redeclare this function only so that the more derived return type is available without casting.

Implements ObjectGroup.

◆ numElements()

size_type numElements ( ) const
inline
Returns
The number of elements that make up the dimension.

◆ operator=()

NamedDimensionRange & operator= ( const NamedDimensionRange rhs)
inline

Member Data Documentation

◆ first

◆ labels

◆ last

◆ name

◆ unlimited

DataExecution::TypedObject<bool> unlimited