-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbarista_file_getter.h
More file actions
42 lines (34 loc) · 1.1 KB
/
barista_file_getter.h
File metadata and controls
42 lines (34 loc) · 1.1 KB
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
#ifndef CAFE_BARISTA_FILE_GETTER_H_
#define CAFE_BARISTA_FILE_GETTER_H_
#include "barista_getter.h"
namespace cafe {
/**
* Allows for getting the required amound of barista's
* descriptions which reads from the given file.
*/
class BaristaFileGetter : public BaristaGetter {
public:
BaristaFileGetter(const std::string file_name)
: file_name_(file_name), already_parsed_file_(false) {}
~BaristaFileGetter();
/**
* Tries to return the required amound of barista's descriptions defined in
*the given file.
*
* @param barista_descriptions The vector into which is stored the barista's
*descriptions.
* @param required_baristas Required amound of baristas.
*
* @return The amound of barista's descriptions stored in barista_descriptions
*vector.
*/
int getBaristas(BaristaDescriptions& barista_descriptions,
int required_baristas) override;
private:
void parseBaristaDescriptionsFile();
std::string file_name_;
BaristaDescriptions barista_descriptions_;
bool already_parsed_file_;
};
} // namespace cafe
#endif // CAFE_BARISTA_FILE_GETTER_H_