-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommandmanager.h
More file actions
38 lines (31 loc) · 1.04 KB
/
Copy pathcommandmanager.h
File metadata and controls
38 lines (31 loc) · 1.04 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
// CommandManager handles the operations of looping through the command
// data file. Interface between library object, command object, and data
// file.
//
// Assumptions:
// -- data file will be correctly formatted
// -- data file will contain no empty lines
//
// Implementation:
// -- reaching eof character breaks the for loop
// -- prints error messages on invalid input from file
//---------------------------------------------------------------------------
#ifndef COMMANDMANAGER_H
#define COMMANDMANAGER_H
class Library;
#include "command.h"
#include <iostream>
class CommandManager {
public:
// constructor
CommandManager();
// reads the the command type from the data file, creates a
// command object and passes the istream down as a stringstream
bool performCommands(istream &inFile, Library *library);
private:
static const int COMMAND_TYPES = 26;
// a hash to track commands that are not stored in patron lists for memory
// deallocation
bool unstoredCommands[COMMAND_TYPES] = {false};
};
#endif