Essentia  2.1-beta5-dev
accumulatoralgorithm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Essentia
5  *
6  * Essentia 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 ESSENTIA_ACCUMULATORALGORITHM_H
21 #define ESSENTIA_ACCUMULATORALGORITHM_H
22 
23 #include "streamingalgorithm.h"
24 
25 namespace essentia {
26 namespace streaming {
27 
62  public:
64 
66 
67  void reset();
68 
69  virtual void consume() = 0;
70  virtual void finalProduce() = 0;
71 
72  void declareInputStream(SinkBase& sink, const std::string& name, const std::string& desc,
73  int preferredAcquireSize = 4096);
74 
75  void declareOutputResult(SourceBase& source, const std::string& name, const std::string& desc);
76 
77  protected:
80 
81  // shadow those methods to prevent people from using them
82  void declareInput();
83  void declareOutput();
84 };
85 
86 
87 } // namespace streaming
88 } // namespace essentia
89 
90 
91 #endif // ESSENTIA_ACCUMULATORALGORITHM_H
Definition: sourcebase.h:52
const std::string & name() const
Definition: configurable.h:48
void declareOutputResult(SourceBase &source, const std::string &name, const std::string &desc)
void declareInputStream(SinkBase &sink, const std::string &name, const std::string &desc, int preferredAcquireSize=4096)
Definition: sinkbase.h:52
Definition: accumulatoralgorithm.h:61
AlgorithmStatus
Definition: streamingalgorithm.h:106
int _preferredSize
Definition: accumulatoralgorithm.h:78
Definition: algorithm.h:28
Definition: streamingalgorithm.h:140
SinkBase * _inputStream
Definition: accumulatoralgorithm.h:79