ArchiveRouteId.cpp 1.53 KB
Newer Older
1
#include "cta/ArchiveRouteId.hpp"
Steven Murray's avatar
Steven Murray committed
2
3
4
5

//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
Steven Murray's avatar
Steven Murray committed
6
cta::ArchiveRouteId::ArchiveRouteId():
Steven Murray's avatar
Steven Murray committed
7
8
9
10
11
12
  m_copyNb(0) {
}

//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
Steven Murray's avatar
Steven Murray committed
13
cta::ArchiveRouteId::ArchiveRouteId(
Steven Murray's avatar
Steven Murray committed
14
  const std::string &storageClassName,
15
  const uint16_t copyNb):
Steven Murray's avatar
Steven Murray committed
16
17
18
19
20
21
22
  m_storageClassName(storageClassName),
  m_copyNb(copyNb) {
}

//------------------------------------------------------------------------------
// operator<
//------------------------------------------------------------------------------
Steven Murray's avatar
Steven Murray committed
23
bool cta::ArchiveRouteId::operator<(const ArchiveRouteId &rhs) const {
Steven Murray's avatar
Steven Murray committed
24
25
26
27
28
29
30
31
32
33
  if(m_storageClassName != rhs.m_storageClassName) {
    return m_storageClassName < rhs.m_storageClassName;
  } else {
    return m_copyNb < rhs.m_copyNb;
  }
}

//------------------------------------------------------------------------------
// getStorageClassName
//------------------------------------------------------------------------------
Steven Murray's avatar
Steven Murray committed
34
const std::string &cta::ArchiveRouteId::getStorageClassName() const throw() {
Steven Murray's avatar
Steven Murray committed
35
36
37
38
39
40
  return m_storageClassName;
}

//------------------------------------------------------------------------------
// getCopyNb
//------------------------------------------------------------------------------
41
uint16_t cta::ArchiveRouteId::getCopyNb() const throw() {
Steven Murray's avatar
Steven Murray committed
42
43
  return m_copyNb;
}