Skip to content
Snippets Groups Projects
Commit f907abcc authored by Steven Murray's avatar Steven Murray
Browse files

Added Tape

parent 92b389c0
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ set (CLIENT_LIB_SRC_FILES
MockMiddleTierUser.cpp
SecurityIdentity.cpp
StorageClass.cpp
Tape.cpp
TapePool.cpp
UserIdentity.cpp
Utils.cpp)
......
......@@ -36,13 +36,6 @@ public:
*/
const std::string &getName() const throw();
/**
* Returns the name of the device group.
*
* @return The name of the device group.
*/
const std::string &getDeviceGroupName() const throw();
/**
* Returns the time when the logical library was created.
*
......
#include "Tape.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::Tape::Tape():
m_capacityInBytes(0),
m_dataOnTapeInBytes(0),
m_creationTime(time(NULL)) {
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::Tape::Tape(
const std::string &vid,
const std::string &logicalLibraryName,
const std::string &tapePoolName,
const uint64_t capacityInBytes,
const UserIdentity &creator,
const std::string &comment):
m_vid(vid),
m_logicalLibraryName(logicalLibraryName),
m_tapePoolName(tapePoolName),
m_capacityInBytes(capacityInBytes),
m_dataOnTapeInBytes(0),
m_creationTime(time(NULL)),
m_creator(creator),
m_comment(comment) {
}
//------------------------------------------------------------------------------
// getVid
//------------------------------------------------------------------------------
const std::string &cta::Tape::getVid() const throw() {
return m_vid;
}
//------------------------------------------------------------------------------
// getLogicalLibraryName
//------------------------------------------------------------------------------
const std::string &cta::Tape::getLogicalLibraryName() const throw() {
return m_logicalLibraryName;
}
//------------------------------------------------------------------------------
// getTapePoolName
//------------------------------------------------------------------------------
const std::string &cta::Tape::getTapePoolName() const throw() {
return m_tapePoolName;
}
//------------------------------------------------------------------------------
// getCapacityInBytes
//------------------------------------------------------------------------------
uint64_t cta::Tape::getCapacityInBytes() const throw() {
return m_capacityInBytes;
}
//------------------------------------------------------------------------------
// getDataOnTapeInBytes
//------------------------------------------------------------------------------
uint64_t cta::Tape::getDataOnTapeInBytes() const throw() {
return m_dataOnTapeInBytes;
}
//------------------------------------------------------------------------------
// getCreationTime
//------------------------------------------------------------------------------
time_t cta::Tape::getCreationTime() const throw() {
return m_creationTime;
}
//------------------------------------------------------------------------------
// getCreator
//------------------------------------------------------------------------------
const cta::UserIdentity &cta::Tape::getCreator()
const throw() {
return m_creator;
}
//------------------------------------------------------------------------------
// getComment
//------------------------------------------------------------------------------
const std::string &cta::Tape::getComment() const throw() {
return m_comment;
}
#pragma once
#include "UserIdentity.hpp"
#include <string>
namespace cta {
/**
* Class representing a tape.
*/
class Tape {
public:
/**
* Constructor.
*/
Tape();
/**
* Constructor.
*
* @param vid The volume identifier of the tape.
* @param logicalLibrary The name of the logical library to which the tape
* belongs.
* @param tapePoolName The name of the tape pool to which the tape belongs.
* @param capacityInBytes The capacity of the tape.
* @param creator The identity of the user that created the tape.
* @param comment The comment describing the tape.
*/
Tape(
const std::string &vid,
const std::string &logicalLibraryName,
const std::string &tapePoolName,
const uint64_t capacityInBytes,
const UserIdentity &creator,
const std::string &comment);
/**
* Returns the volume identifier of the tape.
*
* @return The volume identifier of the tape.
*/
const std::string &getVid() const throw();
/**
* Returns the name of the logical library to which the tape belongs.
*
* @return The name of the logical library to which the tape belongs.
*/
const std::string &getLogicalLibraryName() const throw();
/**
* Returns the name of the tape pool to which the tape belongs.
*
* @return The name of the tape pool to which the tape belongs.
*/
const std::string &getTapePoolName() const throw();
/**
* Returns the capacity of the tape.
*
* @return The capacity of the tape.
*/
uint64_t getCapacityInBytes() const throw();
/**
* Returns the amount of data on the tape.
*
* @return The amount of data on the tape.
*/
uint64_t getDataOnTapeInBytes() const throw();
/**
* Returns the time when the tape was created.
*
* @return The time when the tape was created.
*/
time_t getCreationTime() const throw();
/**
* Returns the identity of the user that created the tape.
*
* @return The identity of the user that created the tape.
*/
const UserIdentity &getCreator() const throw();
/**
* Returns the comment describing the tape.
*
* @return The comment describing the tape.
*/
const std::string &getComment() const throw();
private:
/**
* The volume identifier of the tape.
*/
std::string m_vid;
/**
* The name of the logical library to which the tape belongs.
*/
std::string m_logicalLibraryName;
/**
* The name of the tape pool to which the tape belongs.
*/
std::string m_tapePoolName;
/**
* The capacity of the tape.
*/
uint64_t m_capacityInBytes;
/**
* The amount of data on the tape.
*/
uint64_t m_dataOnTapeInBytes;
/**
* The time when the tape was created.
*/
time_t m_creationTime;
/**
* The identity of the user that created the tape.
*/
UserIdentity m_creator;
/**
* Comment describing the tape.
*/
std::string m_comment;
}; // class Tape
} // namespace cta
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment