3 * Used to define the class Task which is used to indicate the status about
4 * the user's reciting process.
6 * Copyright (C) 2008 Kermit Mei (中文名:梅延涛).
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
23 * Written by Kermit Mei <kermit.mei@gmail.com>
25 * Many of the ideas implemented here are from the author's experiment.
26 * But the dictionary's format coincide with the other word recite software
27 * to help the users get more available data. And the review times designed
28 * by means of the theory named Forgetting Curve which dicoveried by the
29 * German psychologist named Hermann Ebbinghaus(1850–1909).
39 namespace freeRecite
{
44 Task(time_t initID
= 0,
45 const char *initName
= 0);
48 friend std::istream
& operator>>(std::istream
&, Task
&);
49 friend std::ostream
& operator<<(std::ostream
&, const Task
&);
50 friend bool operator>(const Task
&, const Task
&);
51 friend bool operator<(const Task
&, const Task
&);
52 friend bool operator==(const Task
&, const Task
&);
55 time_t getReviewTime() const;
57 const std::string
&getName() const;
58 bool shouldReview() const;
59 bool hasFinished() const;
60 bool isAvailable() const;
71 Task::Task(time_t initID
, const char *initName
)
72 :id(initID
),reviewTime(0),step(0)
79 time_t Task::getID() const {
84 time_t Task::getReviewTime() const {
89 int Task::getStep() const {
94 const std::string
&Task::getName() const {
99 bool Task::hasFinished() const {
104 bool Task::isAvailable() const {
105 return id
== 0 ? false : true;
108 } //namespace freeRecite end