Skip to content
Snippets Groups Projects
Commit 21e1df5f authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Added const policy (use the same device all the time)

parent 6c67cb5b
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,18 @@ class Policy {
virtual ~Policy() {};
};
class ConstPolicy : public Policy {
public:
ConstPolicy(int deviceID): deviceID(deviceID) {}
int getVersion(const char *, int64_t) override {
return deviceID;
}
private:
int deviceID;
};
class NodePolicy : public Policy {
virtual int getVersion(const char *name, int64_t it) override {
std::string s(name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment