-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsector.h
More file actions
51 lines (33 loc) · 958 Bytes
/
sector.h
File metadata and controls
51 lines (33 loc) · 958 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef SECTOR_H
#define SECTOR_H
#include <vector>
#include <cstdlib> // strtol
#include <string>
#include "expression.h"
using namespace std;
class Sector
{
public:
static vector<Sector*> &getSectors();
static Sector *create(string &name, string &descr);
static bool exists(string &name);
static Sector *find(string);
static void clearBalances();
static void clear(); // delete all sectors
void setDescription(string &description);
string getName();
string getDescription();
string getLongName();
double getBalance();
void debit(double amount);
void credit(double amount);
protected:
Sector(string &name);
virtual ~Sector();
private:
string m_name;
string m_description;
double balance;
static vector<Sector*> sectors;
};
#endif // SECTOR_H