-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDBentry.h
47 lines (34 loc) · 1.02 KB
/
DBentry.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
#ifndef _DBENTRY_H
#define _DBENTRY_H
#include <string>
#include <iostream>
using namespace std;
class DBentry {
private:
string name;
unsigned int IPaddress;
bool active;
public:
// the default constructor
DBentry();
DBentry (string _name, unsigned int _IPaddress, bool _active);
// the destructor
~DBentry();
// sets the domain name, which we will use as a key.
void setName(string _name);
// sets the IPaddress data.
void setIPaddress(unsigned int _IPaddress);
// sets whether or not this entry is active.
void setActive (bool _active);
// returns the name.
string getName() const;
// returns the IPaddress data.
unsigned int getIPaddress() const;
// returns whether or not this entry is active.
bool getActive() const;
// prints the entry in the format
// name : IPaddress : active followed by newline
// active is printed as a string (active or inactive)
friend ostream& operator<< (ostream& out, const DBentry& rhs);
};
#endif