DriveStatus.cpp 1.86 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * 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/DriveStatus.hpp"

21
22
#include <sstream>

23
24
25
26
27
std::string cta::common::dataStructures::toString(cta::common::dataStructures::DriveStatus type) {
  switch(type) {
    case cta::common::dataStructures::DriveStatus::Down:
      return "Down";
    case cta::common::dataStructures::DriveStatus::Up:
28
      return "Free";
29
    case cta::common::dataStructures::DriveStatus::Starting:
30
      return "Start";
31
    case cta::common::dataStructures::DriveStatus::Mounting:
32
      return "Mount";
Eric Cano's avatar
Eric Cano committed
33
    case cta::common::dataStructures::DriveStatus::Transferring:
34
      return "Transfer";
35
    case cta::common::dataStructures::DriveStatus::Unloading:
36
      return "Unload";
37
    case cta::common::dataStructures::DriveStatus::Unmounting:
38
      return "Unmount";
39
    case cta::common::dataStructures::DriveStatus::DrainingToDisk:
40
      return "DrainToDisk";
41
    case cta::common::dataStructures::DriveStatus::CleaningUp:
42
      return "CleanUp";
43
44
    case cta::common::dataStructures::DriveStatus::Unknown:
      return "Unknown";
45
    default:
46
47
48
49
50
    {
      std::stringstream ret;
      ret << "WRONG STATE CODE (" << (uint32_t) type << ")";
      return ret.str();
    }
51
52
  }
}
53
54