-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainOffice.h
More file actions
32 lines (25 loc) · 802 Bytes
/
MainOffice.h
File metadata and controls
32 lines (25 loc) · 802 Bytes
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
//Student Bshara Haj, 212590186.
//Student Obaeda Khatib, 201278066.
#pragma once
#include <map>
#include "Branch.h"
#include <algorithm>
class MainOffice
{
private:
MainOffice() {}
MainOffice(const MainOffice&) = delete;
void operator=(const MainOffice&) = delete;
std::map<std::string, Branch> branches;
public:
static MainOffice& getInstance()
{
static MainOffice instance;
return instance;
}
void addBranch(const std::string& location, int capacity);
void removeBranch(const std::string& location);
Branch& getBranch(const std::string& location);
void printBranchesByLocation(void (*printFunction)(const Branch&)) const;
void printBranchesByValue(void (*printFunction)(const Branch&)) const;
};