-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaildrops.h
74 lines (60 loc) · 1.8 KB
/
maildrops.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* File: maildrops.h
* Author: Wouter Van Rossem
*
*/
#ifndef _MAILDROPS_H
#define _MAILDROPS_H
#include <dvthread/thread.h>
#include <map>
#include <string>
#include <utility>
#include <string>
#include <sstream>
#include "maildrop.h"
#include "player.h"
/** The Maildrops class manages the different maildrops
*/
class Maildrops
{
public:
/** Constructor for Maildrops
* @param folder_path String representing the folder where
* the maildrops are located
*/
Maildrops (std::string folder_path);
/** Destructor for Maildrops
* Deletes all the maildrops in the map
*/
virtual ~Maildrops ();
/* Type of pair from name of the maildrop to the corresponding maildrop */
typedef std::pair<std::string, Maildrop*> Pair;
/* Type of map from name of the maildrop to the corresponding maildrop */
typedef std::map<std::string, Maildrop*> Map;
/** Find the maildrop of the given player
* @param player Player who's maildrop we need to find
* @return The maildrop of the player
*/
Maildrop* find_maildrop (const Player* player) const;
/** Add a maildrop for the player
* The name of the player will be used to find the path to the maildrop
* @param player Player who's maildrop we need to create
* @return A bool indicating if the operation succeeded
*/
bool new_maildrop (const Player* player);
/** Remove the maildrop of the player
* @param player Player who's maildrop we need to delete
*/
void remove_maildrop (const Player* player);
private:
/* Private copy constructor */
Maildrops (const Maildrops& orig);
/** Collection of maildrops
* Key = name of the maildrop
* Value = the maildrop
*/
Map _maildrops;
/* String indicating the path to the maildrops */
std::string _folder_path;
};
#endif /* _MAILDROPS_H */