Elements  5.10
A C++ base framework for the Euclid Software.
DataSourceUser.h
Go to the documentation of this file.
1 
27 #ifndef ELEMENTSEXAMPLES_ELEMENTSEXAMPLES_DATASOURCEUSER_H_
28 #define ELEMENTSEXAMPLES_ELEMENTSEXAMPLES_DATASOURCEUSER_H_
29 
30 #include <cstdlib> // for std::size_t
31 
32 #include "ElementsKernel/Export.h" // For ELEMENTS_API
33 
34 namespace Elements {
35 namespace Examples {
36 
47 
48 public:
55  virtual std::size_t countRecords() const = 0;
56 
68  virtual double getRecordValue(std::size_t index) const = 0;
69 
70  virtual ~DataSourceInterface() = default;
71 };
72 
79 
80 public:
90  double sumRecords(const DataSourceInterface& data_source);
91 
92 };
93 
94 } // namespace Examples
95 } // namespace Elements
96 
97 #endif // ELEMENTSEXAMPLES_ELEMENTSEXAMPLES_DATASOURCEUSER_H_
98 
virtual double getRecordValue(std::size_t index) const =0
Fetch the value of the n-th record of the DataSource.
defines the macros to be used for explicit export of the symbols
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
This class has been created to demonstrate unit testing. It manipulates an object implementing DataSo...
virtual std::size_t countRecords() const =0
Count the number of records into the DataSource.
This class has been created to demonstrate unit testing. It is an Interface over a DataSource (a File...