ArchiveRequest.cpp 2.94 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/ArchiveRequest.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
ArchiveRequest::ArchiveRequest():
31
32
  fileSize(0),
  diskpoolThroughput(0) {}
Daniele Kruse's avatar
Daniele Kruse committed
33

34
//------------------------------------------------------------------------------
35
// operator==
36
//------------------------------------------------------------------------------
37
bool ArchiveRequest::operator==(const ArchiveRequest &rhs) const {
38
  return requester==rhs.requester
39
      && diskFileID==rhs.diskFileID
40
      && instance==rhs.instance
41
42
43
      && srcURL==rhs.srcURL
      && fileSize==rhs.fileSize
      && checksumType==rhs.checksumType
44
      && checksumValue==rhs.checksumValue
45
      && storageClass==rhs.storageClass
46
      && diskFileInfo==rhs.diskFileInfo
47
48
      && diskpoolName==rhs.diskpoolName
      && diskpoolThroughput==rhs.diskpoolThroughput
49
      && creationLog==rhs.creationLog;
50
51
52
}

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

//------------------------------------------------------------------------------
60
// operator<<
61
//------------------------------------------------------------------------------
62
std::ostream &operator<<(std::ostream &os, const ArchiveRequest &obj) {
63
  os << "(requester=" << obj.requester
64
     << " diskFileID=" << obj.diskFileID
65
     << " instance=" << obj.instance
66
67
68
     << " srcURL=" << obj.srcURL
     << " fileSize=" << obj.fileSize
     << " checksumType=" << obj.checksumType
69
     << " checksumValue=" << obj.checksumValue
70
     << " storageClass=" << obj.storageClass
71
     << " diskFileInfo=" << obj.diskFileInfo
72
73
     << " diskpoolName=" << obj.diskpoolName
     << " diskpoolThroughput=" << obj.diskpoolThroughput
74
     << " creationLog=" << obj.creationLog << ")";
75
  return os;
76
77
}

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