-
Notifications
You must be signed in to change notification settings - Fork 11
/
prpl-ownershipMap.h
44 lines (32 loc) · 1.2 KB
/
prpl-ownershipMap.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
#ifndef PRPL_OWNERSHIPMAP_H
#define PRPL_OWNERSHIPMAP_H
#include "prpl-basicTypes.h"
namespace pRPL {
class OwnershipMap {
public:
OwnershipMap();
~OwnershipMap() {}
void init(const pRPL::IntVect &vSubspcIDs,
const pRPL::IntVect &vPrcIDs);
void clearMapping();
void mapping(pRPL::MappingMethod mapMethod = pRPL::CYLC_MAP,
int nSubspcs2Map = 0);
int mappingNextTo(int prcID); // return the SubCellspace's ID
bool mappingTo(int subspcID,
int prcID);
bool allMapped() const;
const pRPL::IntVect* subspcIDsOnPrc(int prcID) const;
pRPL::IntVect mappedSubspcIDs() const;
int findPrcBySubspcID(int subspcID) const;
bool findSubspcIDOnPrc(int subspcID, int prcID) const;
bool map2buf(vector<char> &buf) const;
bool buf2map(const vector<char> &buf);
private:
pRPL::IntVect _vSubspcIDs;
map<int, pRPL::IntVect> _mPrcSubspcs;
pRPL::IntVect::iterator _itrSubspc2Map;
friend ostream& operator<<(ostream &os, const pRPL::OwnershipMap &mOwnerships);
};
ostream& operator<<(ostream &os, const pRPL::OwnershipMap &mOwnerships);
};
#endif /* OwnershipMap_H */