-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenGraph.h
37 lines (28 loc) · 860 Bytes
/
GenGraph.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
#ifndef _GEN_GRAPH_
#define _GEN_GRAPH_
#include <vector>
#include <set>
#include <utility>
class Relations;
class Person;
class GenGraph
{
public:
GenGraph();
virtual ~GenGraph();
public:
// Actions
void ConnectPeople( Person* pFirstPerson, Person* pSecondPerson, const std::vector<Person*>& vChildren );
// Getters
typedef std::vector< std::pair<Relations*, const Person*> > relations;
bool GetFamilyTree( std::vector<relations>& vRelations, const std::string& strDescendantName, const std::string& strAscendantName );
private:
// Helper methods
void GetAscendants( relations& vRelations, const Person* pPerson );
void CleanupAscendants( const std::string& strAscendantName );
private:
std::vector<Relations*> mvRelations;
std::set<Person*> mPersons;
std::vector<relations> mvRelationsPath;
};
#endif