Elements  6.2
A C++ base framework for the Euclid Software.
Public Member Functions | List of all members
Elements::Examples::TemplatedDataSourceUser Class Reference

This class has been created to demonstrate unit testing. It manipulate an object representing a DataSource using template to achieve polymorphism. More...

#include <TemplatedDataSourceUser.h>

Public Member Functions

template<typename T >
double sumRecords (const T &data_source)
 Compute the sum of the values of the records stored into the provided DataSource. More...
 

Detailed Description

This class has been created to demonstrate unit testing. It manipulate an object representing a DataSource using template to achieve polymorphism.

Examples
ElementsExamples/tests/src/GMock/TemplatedDataSourceUser_test.cpp.

Definition at line 39 of file TemplatedDataSourceUser.h.

Member Function Documentation

◆ sumRecords()

template<typename T >
double Elements::Examples::TemplatedDataSourceUser::sumRecords ( const T &  data_source)

Compute the sum of the values of the records stored into the provided DataSource.

Template Parameters
TA type representing a DataSource. The type must declare the methods
  • size_t countRecords() const
  • double getRecordValue(size_t index) const
Parameters
data_sourceA reference to a DataSource object.
Returns
The sum of the values of the records into the DataSource object
Examples
ElementsExamples/tests/src/GMock/TemplatedDataSourceUser_test.cpp.

The documentation for this class was generated from the following file: