ArchiveFile.hpp 2.26 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * 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/>.
 */

#pragma once

#include <list>
#include <map>
#include <stdint.h>
#include <string>

26
#include "common/dataStructures/DiskFileInfo.hpp"
27
#include "common/dataStructures/TapeFile.hpp"
28
29

namespace cta {
30
namespace common {
31
32
namespace dataStructures {

33
/**
34
 * This struct holds all the CTA file metadata 
35
 */
36
struct ArchiveFile {
37

Daniele Kruse's avatar
Daniele Kruse committed
38
  ArchiveFile();
39

40
41
42
43
44
45
46
47
  /**
   * Equality operator that does NOT compare the creationTime and
   * reconciliationTime member-variables.
   *
   * @param rhs The operand on the right-hand side of the operator.
   * @return True if the compared objects are equal (ignoring the creationTime
   * and reconciliationTime member-variables).
   */
48
  bool operator==(const ArchiveFile &rhs) const;
49

50
  bool operator!=(const ArchiveFile &rhs) const;
51

52
  uint64_t archiveFileID;
53
  std::string diskFileId;
54
  std::string diskInstance;
55
  uint64_t fileSize;
56
  /**
Daniele Kruse's avatar
Daniele Kruse committed
57
   * The human readable checksum type. Ex: ADLER32 
58
   */
59
  std::string checksumType;
60
  /**
Daniele Kruse's avatar
Daniele Kruse committed
61
   * The human readable checksum value. Ex: 0X1292AB12 
62
   */
63
  std::string checksumValue;
64
  std::string storageClass;
65
  DiskFileInfo diskFileInfo;
66
  /**
Daniele Kruse's avatar
Daniele Kruse committed
67
68
69
   * This map represents the non-necessarily-exhaustive set of tape copies 
   * to be listed by the operator. For example, if the listing requested is 
   * for a single tape, the map will contain only one element. 
70
   */
71
  std::map<uint64_t,TapeFile> tapeFiles;
72
  time_t creationTime;
73
  time_t reconciliationTime;
74

75
}; // struct ArchiveFile
76

77
78
std::ostream &operator<<(std::ostream &os, const ArchiveFile &obj);

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