00001
00002
00003 #ifndef _TWINENTRY_H
00004 #define _TWINENTRY_H
00005
00006 #include "osl/checkmate/checkMove.h"
00007 #include "osl/pathEncoding.h"
00008
00009 namespace osl
00010 {
00011 namespace checkmate
00012 {
00013 class CheckHashRecord;
00014 struct TwinEntry
00015 {
00016 PathEncoding path;
00017 CheckMoveCore move;
00022 const CheckHashRecord *loopTo;
00023 TwinEntry(const PathEncoding& p, const CheckMoveCore& m,
00024 const CheckHashRecord *l=0)
00025 : path(p), move(m), loopTo(l)
00026 {
00027 }
00028 };
00029
00035 struct TwinAgeEntry
00036 {
00037 TwinEntry entry;
00041 int age;
00045 TwinAgeEntry(const PathEncoding& p, const CheckMoveCore& m,
00046 const CheckHashRecord *l=0)
00047 : entry(p, m, l), age(-1)
00048 {
00049 }
00053 TwinAgeEntry(const PathEncoding& path) : entry(path, CheckMoveCore()), age(0)
00054 {
00055 }
00056 bool hasTwinEntry() const { return age < 0; }
00057 void setTwinEntry(const TwinEntry& e)
00058 {
00059 assert(entry.path == e.path);
00060 entry.move = e.move;
00061 age = -1;
00062 }
00063 };
00064
00065 }
00066 }
00067
00068
00069 #endif
00070
00071
00072
00073