From 03b281f60481ece512ea12de9d1070d603a24f3f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 22 Nov 2009 14:42:59 +0000 Subject: [PATCH] 2009-11-22 Tatsuhiro Tsujikawa Added setEndGamePieceNum() pure virtual function to PieceStorage. * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h --- ChangeLog | 8 ++++++++ src/DefaultPieceStorage.h | 2 +- src/PieceStorage.h | 2 ++ src/UnknownLengthPieceStorage.h | 2 ++ test/MockPieceStorage.h | 2 ++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 077df990..e3c89cf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-11-22 Tatsuhiro Tsujikawa + + Added setEndGamePieceNum() pure virtual function to PieceStorage. + * src/DefaultPieceStorage.h + * src/PieceStorage.h + * src/UnknownLengthPieceStorage.h + * test/MockPieceStorage.h + 2009-11-22 Tatsuhiro Tsujikawa Added markTotalLengthIsKnown(). diff --git a/src/DefaultPieceStorage.h b/src/DefaultPieceStorage.h index 4a7a8cb3..e2adf632 100644 --- a/src/DefaultPieceStorage.h +++ b/src/DefaultPieceStorage.h @@ -175,7 +175,7 @@ public: virtual const unsigned char* getBitfield(); - void setEndGamePieceNum(size_t num) { + virtual void setEndGamePieceNum(size_t num) { endGamePieceNum = num; } diff --git a/src/PieceStorage.h b/src/PieceStorage.h index 9c83f219..95402ec9 100644 --- a/src/PieceStorage.h +++ b/src/PieceStorage.h @@ -187,6 +187,8 @@ public: virtual bool isEndGame() = 0; + virtual void setEndGamePieceNum(size_t num) = 0; + virtual SharedHandle getDiskAdaptor() = 0; virtual size_t getPieceLength(size_t index) = 0; diff --git a/src/UnknownLengthPieceStorage.h b/src/UnknownLengthPieceStorage.h index e34252bb..1ef3618b 100644 --- a/src/UnknownLengthPieceStorage.h +++ b/src/UnknownLengthPieceStorage.h @@ -211,6 +211,8 @@ public: return false; } + virtual void setEndGamePieceNum(size_t num) {} + virtual SharedHandle getDiskAdaptor(); virtual size_t getPieceLength(size_t index); diff --git a/test/MockPieceStorage.h b/test/MockPieceStorage.h index 1b27cec2..b8e19498 100644 --- a/test/MockPieceStorage.h +++ b/test/MockPieceStorage.h @@ -188,6 +188,8 @@ public: return endGame; } + virtual void setEndGamePieceNum(size_t num) {} + void setEndGame(bool flag) { this->endGame = flag; }