~ubuntu-branches/ubuntu/saucy/libcolumbus/saucy

« back to all changes in this revision

Viewing changes to src/MatchResults.cc

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Mathieu Trudel-Lapierre, Ubuntu daily release
  • Date: 2013-08-14 10:09:26 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130814100926-alt0lfyjwfip96sc
Tags: 1.0.0+13.10.20130814-0ubuntu1
[ Mathieu Trudel-Lapierre ]


[ Ubuntu daily release ]
* Automatic snapshot from revision 452

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    p->sorted = true;;
37
37
}
38
38
 
 
39
MatchResults::MatchResults(const MatchResults &other) {
 
40
    p = new MatchResultsPrivate();
 
41
    *p = *other.p;
 
42
}
 
43
 
 
44
MatchResults::MatchResults(MatchResults &&other) {
 
45
    p = other.p;
 
46
    other.p = nullptr;
 
47
}
 
48
 
39
49
MatchResults::~MatchResults() {
40
50
    delete p;
41
51
}
42
52
 
 
53
const MatchResults& MatchResults::operator=(MatchResults &&other) {
 
54
    if(this != &other) {
 
55
        delete p;
 
56
        p = other.p;
 
57
        other.p = nullptr;
 
58
    }
 
59
    return *this;
 
60
}
 
61
 
 
62
const MatchResults& MatchResults::operator=(const MatchResults &other) {
 
63
    if(this != &other) {
 
64
        *p = *other.p;
 
65
    }
 
66
    return *this;
 
67
}
 
68
 
43
69
void MatchResults::addResult(DocumentID id, double relevancy) {
44
70
    pair<double, DocumentID> n;
45
71
    n.first = relevancy;