ICF 3.1.1.10
Technical documentation of ICF Libraries
CGeneralDataSequence.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef imeas_CGeneralDataSequence_included
7#define imeas_CGeneralDataSequence_included
8
9
10// Qt includes
11#include <QtCore/QVector>
12
13// ICF includes
14#include <istd/TOptDelPtr.h>
16#include <imeas/IDataSequence.h>
17
18
19namespace imeas
20{
21
22
27 virtual public IDataSequence,
28 virtual public imath::ISampledFunction2d
29{
30public:
32
33 const double* GetSamplesBuffer() const;
34 double* GetSamplesBuffer();
35 int GetSamplesBufferSize() const;
36
37 // reimplemented (imeas::IDataSequence)
38 bool CreateSequence(int samplesCount, int channelsCount = 1, std::unique_ptr<const IDataSequenceInfo>&& infoPtr = nullptr) override;
39 const IDataSequenceInfo* GetSequenceInfo() const override;
40 bool IsEmpty() const override;
41 void ResetSequence() override;
42 int GetSamplesCount() const override;
43 int GetChannelsCount() const override;
44 double GetSample(int index, int channel = 0) const override;
45 void SetSample(int index, int channel, double value) override;
46
47 // reimplemented (imath::ISampledFunction2d)
48 bool CreateFunction(double* dataPtr, const ArgumentType& sizes) override;
49 int GetTotalSamplesCount() const override;
50 int GetGridSize(int dimensionIndex) const override;
51 istd::CRange GetLogicalRange(int dimensionIndex) const override;
52 istd::CRange GetResultValueRange(int dimensionIndex, int resultDimension = -1) const override;
53
54 // reimplemented (imath::TIMathFunction)
55 bool GetValueAt(const ArgumentType& argument, ResultType& result) const override;
56 ResultType GetValueAt(const ArgumentType& argument) const override;
57
58 // reimplemented (iser::ISerializable)
59 bool Serialize(iser::IArchive& archive) override;
60
61 // reimplemented (istd::IChangeable)
62 int GetSupportedOperations() const override;
63 bool CopyFrom(const istd::IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
64 std::unique_ptr<istd::IChangeable> CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const override;
65
66private:
67 typedef std::vector<double> Samples;
68 Samples m_samples;
69
70 int m_channelsCount;
71
72 std::unique_ptr<const IDataSequenceInfo> m_sequenceInfoPtr;
73};
74
75
76// inline methods
77
78inline const double* CGeneralDataSequence::GetSamplesBuffer() const
79{
80 return &m_samples[0];
81}
82
83
85{
86 return &m_samples[0];
87}
88
89
91{
92 return int(m_samples.size());
93}
94
95
96} // namespace imeas
97
98
99#endif // !imeas_CGeneralDataSequence_included
100
101
Interface for a resampled function with a regular grid design.
BaseClass::ArgumentType ArgumentType
Implementation of fixed-size mathematical vector with specified type of elements.
Definition TVector.h:32
General implementation of sample sequence interface IDataSequence.
double GetSample(int index, int channel=0) const override
Get sample value at specified index.
int GetSupportedOperations() const override
Get set of flags for supported operations.
const IDataSequenceInfo * GetSequenceInfo() const override
Get additional information about this sequence.
istd::CRange GetLogicalRange(int dimensionIndex) const override
Get logical grid position range for specified dimension.
bool IsEmpty() const override
Return true if this sequence has no sample.
void SetSample(int index, int channel, double value) override
Set sample value at specified index.
bool GetValueAt(const ArgumentType &argument, ResultType &result) const override
ResultType GetValueAt(const ArgumentType &argument) const override
std::unique_ptr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
int GetSamplesCount() const override
Get size of this raster sequence.
int GetTotalSamplesCount() const override
Get number of samples stored in this container.
const double * GetSamplesBuffer() const
bool CreateFunction(double *dataPtr, const ArgumentType &sizes) override
Create function from input data.
istd::CRange GetResultValueRange(int dimensionIndex, int resultDimension=-1) const override
Get range of result value for the given axis.
int GetGridSize(int dimensionIndex) const override
Get number of samples for specified dimension.
bool CreateSequence(int samplesCount, int channelsCount=1, std::unique_ptr< const IDataSequenceInfo > &&infoPtr=nullptr) override
Create container for sample sequence with specified number of samples, channels and sample depth.
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
void ResetSequence() override
Reset this sequence.
int GetChannelsCount() const override
Get number of channels.
bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
Copy this object from another one.
General definition of sequence contains samples in regular time grid.
Stores additional data sequence data used to interpret samples value correctly.
Represent input/output persistence archive.
Definition IArchive.h:34
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
This namespace contains classes for measurement system implementations.

© Witold Gantzke and Kirill Lepskiy