This repository has been archived by the owner on May 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Data.h
55 lines (50 loc) · 1.37 KB
/
Data.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef DATA_H
#define DATA_H
/**
* \file
* \brief Definicja klasy Data modelującej kontener vector, dla przechowywania danych wejściowych i wyjściowych.
*
* Plik ten jest częścią projektu currency_calc.
*/
#include <vector>
#include <iterator>
//#include <algorithm>
/**
* \brief Klasa modelująca kontener vector.
*
* Jest to klasa nadrzędna dla innych klas przechowujących dane.
* Zabezpiecza ona przed bezpośrednim dostępem do wektora,
* oferując ograniczony interfejs modyfikacji danych.
*/
class Data
{
private:
std::vector<double> data; ///< Wektor liczb zmiennoprzecinkowych
public:
/**
* \brief Wirtualny destruktor.
*/
virtual ~Data() {}
/**
* \brief Dodaje element do wektora danych.
*/
void push(double value);
/**
* \brief Wyświetla element wektora.
*/
double get(unsigned int i);
/**
* \brief Zwraca iterator na początek.
*/
std::vector<double>::iterator begin();
/**
* \brief Zwraca iterator na koniec.
*/
std::vector<double>::iterator end();
/**
* \brief Zwraca ilość elementów wektora.
*/
std::vector<double>::size_type size();
//void copyData(std::istream_iterator<double> first, std::istream_iterator<double> last);
};
#endif // DATA_H