Gaia
analyzer.h
1 /*
2  * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Gaia
5  *
6  * Gaia is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License as published by the Free
8  * Software Foundation (FSF), either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the Affero GNU General Public License
17  * version 3 along with this program. If not, see http://www.gnu.org/licenses/
18  */
19 
20 #ifndef GAIA_ANALYZER_H
21 #define GAIA_ANALYZER_H
22 
23 #include "dataset.h"
24 #include "factory.h"
25 #include "transformation.h"
26 
27 namespace gaia2 {
28 
43 class Analyzer {
44 
45  public:
46 
51  QString name;
52 
53  Analyzer(const ParameterMap& params);
54  virtual ~Analyzer() {};
55 
56  virtual Transformation analyze(const DataSet* dataset) const;
57  virtual Transformation analyze(const DataSet* dataset, const Region& region) const;
58 
65  void checkDataSet(const DataSet* dataset) const;
66 
71  void checkMinPoints(const DataSet* dataset, int n) const;
72 
78  const Region& checkFixedLength(const Region& region, const PointLayout& layout) const;
79 
85  QStringList validParams;
86 
87  protected:
88  ParameterMap _params;
89  QStringList _descriptorNames, _exclude;
90 
91 };
92 
93 
95 
96 void registerAnalyzers();
97 
98 
99 } // namespace gaia2
100 
101 #endif // GAIA_ANALYZER_H
A region is a physical location in the point layout which consists in a list of segments.
Definition: region.h:125
Class containing all info pertaining to a specific transformation, ie: the name of the analyzer class...
Definition: transformation.h:41
void checkMinPoints(const DataSet *dataset, int n) const
Checks that the given dataset as at least the specified number of points.
Definition: analyzer.cpp:90
This class represents a dataset and all related information.
Definition: dataset.h:91
QStringList validParams
List of valid parameters this analyzer accepts.
Definition: analyzer.h:85
const Region & checkFixedLength(const Region &region, const PointLayout &layout) const
Checks that the given Region only contains fixed-length descriptors and throws an exception if not...
Definition: analyzer.cpp:99
This class describes the layout of a point.
Definition: pointlayout.h:60
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
Definition: factory.h:98
the Analyzer abstract base class.
Definition: analyzer.h:43
Definition: parameter.h:34
void registerAnalyzers()
Registers all the analyzers available inside the AnalyzerFactory.
Definition: analyzer.cpp:52
QString name
Name for the algorithm, usually the key that was used to instantiate it from the factory.
Definition: analyzer.h:51
void checkDataSet(const DataSet *dataset) const
Checks that the given dataset is valid.
Definition: analyzer.cpp:83