CGeneralDataSequence.h
Go to the documentation of this file.
1 #ifndef imeas_CGeneralDataSequence_included
2 #define imeas_CGeneralDataSequence_included
3 
4 
5 // Qt includes
6 #include <QtCore/QVector>
7 
8 // ACF includes
9 #include "istd/TSmartPtr.h"
10 #include "istd/TOptDelPtr.h"
12 
13 #include "imeas/IDataSequence.h"
14 
15 
16 namespace imeas
17 {
18 
19 
24  virtual public IDataSequence,
25  virtual public imath::ISampledFunction2d
26 {
27 public:
29 
30  const double* GetSamplesBuffer() const;
31  double* GetSamplesBuffer();
32  int GetSamplesBufferSize() const;
33 
34  // reimplemented (imeas::IDataSequence)
35  virtual bool CreateSequence(int samplesCount, int channelsCount = 1);
36  virtual bool CreateSequenceWithInfo(
38  int samplesCount = -1,
39  int channelsCount = -1);
40  virtual const IDataSequenceInfo* GetSequenceInfo() const;
41  virtual bool IsEmpty() const;
42  virtual void ResetSequence();
43  virtual int GetSamplesCount() const;
44  virtual int GetChannelsCount() const;
45  virtual double GetSample(int index, int channel = 0) const;
46  virtual void SetSample(int index, int channel, double value);
47 
48  // reimplemented (imath::ISampledFunction2d)
49  virtual bool CreateFunction(double* dataPtr, const ArgumentType& sizes);
50  virtual int GetTotalSamplesCount() const;
51  virtual int GetGridSize(int dimensionIndex) const;
52  virtual istd::CRange GetLogicalRange(int dimensionIndex) const;
53  virtual istd::CRange GetResultValueRange(int dimensionIndex, int resultDimension = -1) const;
54 
55  // reimplemented (imath::TIMathFunction)
56  virtual bool GetValueAt(const ArgumentType& argument, ResultType& result) const;
57  virtual ResultType GetValueAt(const ArgumentType& argument) const;
58 
59  // reimplemented (iser::ISerializable)
60  virtual bool Serialize(iser::IArchive& archive);
61 
62  // reimplemented (istd::IChangeable)
63  virtual int GetSupportedOperations() const;
64  virtual bool CopyFrom(const istd::IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
65  virtual istd::IChangeable* CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const;
66 
67 private:
68  typedef QVector<double> Samples;
69  Samples m_samples;
70 
71  int m_channelsCount;
72 
74 };
75 
76 
77 // inline methods
78 
79 inline const double* CGeneralDataSequence::GetSamplesBuffer() const
80 {
81  return &m_samples[0];
82 }
83 
84 
86 {
87  return &m_samples[0];
88 }
89 
90 
92 {
93  return int(m_samples.size());
94 }
95 
96 
97 } // namespace imeas
98 
99 
100 #endif // !imeas_CGeneralDataSequence_included
101 
102 
virtual bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
virtual int GetGridSize(int dimensionIndex) const
virtual bool CreateFunction(double *dataPtr, const ArgumentType &sizes)
virtual double GetSample(int index, int channel=0) const
Get sample value at specified index.
virtual int GetSupportedOperations() const
General implementation of sample sequence interface IDataSequence.
virtual bool GetValueAt(const ArgumentType &argument, ResultType &result) const
virtual istd::CRange GetLogicalRange(int dimensionIndex) const
virtual void SetSample(int index, int channel, double value)
Set sample value at specified index.
virtual bool Serialize(iser::IArchive &archive)
virtual istd::CRange GetResultValueRange(int dimensionIndex, int resultDimension=-1) const
Stores additional data sequence data used to interpret samples value correctly.
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
virtual int GetChannelsCount() const
Get number of channels.
virtual void ResetSequence()
Reset this sequence.
virtual int GetSamplesCount() const
Get size of this raster sequence.
General definition of sequence contains samples in regular time grid.
Definition: IDataSequence.h:20
virtual const IDataSequenceInfo * GetSequenceInfo() const
Get additional information about this sequence.
virtual int GetTotalSamplesCount() const
virtual bool CreateSequenceWithInfo(const istd::TTransPtr< const IDataSequenceInfo > &infoPtr, int samplesCount=-1, int channelsCount=-1)
Create sequence and set the info object.
virtual bool CreateSequence(int samplesCount, int channelsCount=1)
Create container for sample sequence with specified number of samples, channels and sample depth...
virtual bool IsEmpty() const
Return true if this sequence has no sample.
const double * GetSamplesBuffer() const

© 2007-2011 Witold Gantzke and Kirill Lepskiy