VerifyInfo.cpp 2.71 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * The CERN Tape Archive (CTA) project
 * Copyright (C) 2015  CERN
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "common/dataStructures/VerifyInfo.hpp"
20
#include "common/dataStructures/utils.hpp"
21
22
#include "common/exception/Exception.hpp"

Daniele Kruse's avatar
Daniele Kruse committed
23
24
25
26
27
28
29
30
31
32
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::VerifyInfo::VerifyInfo():
  filesFailed(0),
  filesToVerify(0),
  filesVerified(0),
  totalFiles(0),
  totalSize(0) {}

33
//------------------------------------------------------------------------------
34
// operator==
35
//------------------------------------------------------------------------------
36
37
38
39
40
41
42
43
44
45
46
bool cta::common::dataStructures::VerifyInfo::operator==(const VerifyInfo &rhs) const {
  return creationLog==rhs.creationLog
      && errors==rhs.errors
      && filesFailed==rhs.filesFailed
      && filesToVerify==rhs.filesToVerify
      && filesVerified==rhs.filesVerified
      && tag==rhs.tag
      && totalFiles==rhs.totalFiles
      && totalSize==rhs.totalSize
      && verifyStatus==rhs.verifyStatus
      && vid==rhs.vid;
47
48
49
}

//------------------------------------------------------------------------------
50
// operator!=
51
//------------------------------------------------------------------------------
52
53
bool cta::common::dataStructures::VerifyInfo::operator!=(const VerifyInfo &rhs) const {
  return !operator==(rhs);
54
55
56
}

//------------------------------------------------------------------------------
57
// operator<<
58
//------------------------------------------------------------------------------
59
60
61
62
63
64
65
66
67
68
69
70
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::VerifyInfo &obj) {
  os << "(creationLog=" << obj.creationLog
     << " errors=" << obj.errors
     << " filesFailed=" << obj.filesFailed
     << " filesToVerify=" << obj.filesToVerify
     << " filesVerified=" << obj.filesVerified
     << " tag=" << obj.tag
     << " totalFiles=" << obj.totalFiles
     << " totalSize=" << obj.totalSize
     << " verifyStatus=" << obj.verifyStatus
     << " vid=" << obj.vid << ")";
  return os;
71
72
}