VerifyInfo.cpp 2.73 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"

23
24
25
26
namespace cta {
namespace common {
namespace dataStructures {

Daniele Kruse's avatar
Daniele Kruse committed
27
28
29
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
30
VerifyInfo::VerifyInfo():
Daniele Kruse's avatar
Daniele Kruse committed
31
  totalFiles(0),
32
33
34
35
  totalSize(0),
  filesToVerify(0),
  filesFailed(0),
  filesVerified(0) {}
Daniele Kruse's avatar
Daniele Kruse committed
36

37
//------------------------------------------------------------------------------
38
// operator==
39
//------------------------------------------------------------------------------
40
bool VerifyInfo::operator==(const VerifyInfo &rhs) const {
41
  return vid==rhs.vid
42
43
44
      && tag==rhs.tag
      && totalFiles==rhs.totalFiles
      && totalSize==rhs.totalSize
45
46
47
      && filesToVerify==rhs.filesToVerify
      && filesFailed==rhs.filesFailed
      && filesVerified==rhs.filesVerified
48
      && verifyStatus==rhs.verifyStatus
49
50
      && creationLog==rhs.creationLog
      && errors==rhs.errors;
51
52
53
}

//------------------------------------------------------------------------------
54
// operator!=
55
//------------------------------------------------------------------------------
56
bool VerifyInfo::operator!=(const VerifyInfo &rhs) const {
57
  return !operator==(rhs);
58
59
60
}

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

77
78
79
} // namespace dataStructures
} // namespace common
} // namespace cta