Add implementation to cache reader
[dueringa_WikiWalker.git] / src / Article.cpp
blob240c6524406d05f7e055dcfd4b745512c682c444
1 //! \file Article.cpp
3 #include "Article.h"
4 #include "WalkerException.h"
5 #include <algorithm>
7 size_t Article::getNumLinks() const
9 if(!analyzed && !links.size()) {
10 throw WalkerException("Article not analyzed yet!");
13 return links.size();
16 Article::ArticleLinkConstIterator Article::linkBegin() const
18 return links.cbegin();
21 Article::ArticleLinkConstIterator Article::linkEnd() const
23 return links.cend();
26 bool Article::addLink(Article* article)
28 auto pos = find(links.begin(), links.end(), article);
30 if(pos != links.end()) {
31 return false;
34 links.push_back(article);
35 analyzed = true;
37 return true;
40 void Article::setAnalyzed(bool analyzedState) {
41 analyzed = analyzedState;
44 bool Article::isAnalyzed() const {
45 return analyzed;
48 void Article::setMarked(bool _marked) {
49 marked = _marked;
52 bool Article::isMarked() const {
53 return marked;