CuteHMI - Data Acquisition (CuteHMI.DataAcquisition.0)
RecencyCollective.hpp
1 #ifndef H_EXTENSIONS_CUTEHMI_DATAACQUISITION_0_INCLUDE_CUTEHMI_DATAACQUISITION_INTERNAL_RECENCYCOLLECTIVE_HPP
2 #define H_EXTENSIONS_CUTEHMI_DATAACQUISITION_0_INCLUDE_CUTEHMI_DATAACQUISITION_INTERNAL_RECENCYCOLLECTIVE_HPP
3 
4 #include "common.hpp"
5 #include "TagCache.hpp"
6 #include "RecencyTable.hpp"
7 #include "TableCollective.hpp"
8 
9 namespace cutehmi {
10 namespace dataacquisition {
11 namespace internal {
12 
13 class CUTEHMI_DATAACQUISITION_PRIVATE RecencyCollective:
14  public TableCollective
15 {
16  Q_OBJECT
17 
18  public:
20 
21  void update(const RecencyTable<int>::TuplesContainer & tuples);
22 
23  void update(const RecencyTable<bool>::TuplesContainer & tuples);
24 
25  void update(const RecencyTable<double>::TuplesContainer & tuples);
26 
27  protected:
28  void updateSchema(Schema * schema) override;
29 
30  private:
31  template<typename T>
32  void updateTable(const typename RecencyTable<T>::TuplesContainer & tuples, std::unique_ptr<RecencyTable<T>> & table);
33 
34  struct Members
35  {
40  };
41 
42  MPtr<Members> m;
43 };
44 
45 }
46 }
47 }
48 
49 #endif
50 
51 //(c)C: Copyright © 2020, Michał Policht <michal@policht.pl>. All rights reserved.
52 //(c)C: This file is a part of CuteHMI.
53 //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
54 //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
55 //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see <https://www.gnu.org/licenses/>.
cutehmi::dataacquisition::internal::TableCollective
Definition: TableCollective.hpp:13
cutehmi::dataacquisition::internal::RecencyCollective
Definition: RecencyCollective.hpp:13
cutehmi::MPtr< Members >
cutehmi
cutehmi::dataacquisition::internal::RecencyTable
Definition: RecencyTable.hpp:18
std::internal
T internal(T... args)
cutehmi::dataacquisition::Schema
Database schema.
Definition: Schema.hpp:13
QHash
std::unique_ptr