1 |
// Smersh |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#ifndef _Person_hpp_ |
8 |
#define _Person_hpp_ |
9 |
|
10 |
#include <pstream.h> |
11 |
|
12 |
using namespace redi; |
13 |
|
14 |
#include "Matcher.hpp" |
15 |
|
16 |
class Person |
17 |
{ |
18 |
private: |
19 |
static string file; |
20 |
static vector<string> args; |
21 |
static string separator, begin, end; |
22 |
string name; |
23 |
vector<Person> multiple; |
24 |
void query(const string& sn); |
25 |
public: |
26 |
Person(const string& sn = ""); |
27 |
Person(const Person& person) : name(person.name) {} |
28 |
~Person() {} |
29 |
static void configure(); |
30 |
bool isMultiple() const { return !multiple.empty(); } |
31 |
vector<Person>::const_iterator beginMultiple() const { return |
32 |
multiple.begin(); } |
33 |
vector<Person>::const_iterator endMultiple() const { return multiple.end(); |
34 |
} |
35 |
void clearMultiple() { multiple.clear(); } |
36 |
Person& operator=(const Person& person) { name = person.name; } |
37 |
bool operator==(const Person& person) const { return name == person.name; } |
38 |
bool operator<(const Person& person) const { return name < person.name; } |
39 |
// friends: |
40 |
friend ostream& operator<<(ostream& sout, const Person& person) { return |
41 |
sout << person.name; } |
42 |
}; |
43 |
|
44 |
#endif // _Person_hpp_ |