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

This class has been created to demonstrate unit testing. It is an Interface over a DataSource (a File, a DataBase Table, ...). More...

#include <DataSourceUser.h>

Public Member Functions

virtual std::size_t countRecords () const =0
 Count the number of records into the DataSource. More...
 
virtual double getRecordValue (std::size_t index) const =0
 Fetch the value of the n-th record of the DataSource. More...
 
virtual ~DataSourceInterface ()=default
 

Detailed Description

This class has been created to demonstrate unit testing. It is an Interface over a DataSource (a File, a DataBase Table, ...).

Note that as we test the call to this interface, no implementation is provided.

Definition at line 46 of file DataSourceUser.h.

Constructor & Destructor Documentation

◆ ~DataSourceInterface()

virtual Elements::Examples::DataSourceInterface::~DataSourceInterface ( )
virtualdefault

Member Function Documentation

◆ countRecords()

virtual std::size_t Elements::Examples::DataSourceInterface::countRecords ( ) const
pure virtual

Count the number of records into the DataSource.

Returns
A unsigned integer containing the number of records in the DataSource.

Referenced by Elements::Examples::DataSourceUser::sumRecords().

◆ getRecordValue()

virtual double Elements::Examples::DataSourceInterface::getRecordValue ( std::size_t  index) const
pure virtual

Fetch the value of the n-th record of the DataSource.

Parameters
indexThe zero-based index of the record into the DataSource.
Returns
The value of the record at the provided index.
Exceptions
Elements::ExceptionIf no record exists at the specified index.

Referenced by Elements::Examples::DataSourceUser::sumRecords().


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