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

Added abstract class ConfigurationEntry

parent 9be31c3e
Branches
Tags
No related merge requests found
......@@ -16,6 +16,7 @@ set (MIDDLE_TIER_LIB_SRC_FILES
cta/ArchiveRouteId.cpp
cta/ArchiveToDirRequest.cpp
cta/ArchiveToFileRequest.cpp
cta/ConfigurationEntry.cpp
cta/DirectoryEntry.cpp
cta/DirectoryIterator.cpp
cta/DiskException.cpp
......
#include "cta/ConfigurationEntry.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::ConfigurationEntry::ConfigurationEntry() {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::ConfigurationEntry::~ConfigurationEntry() throw() {
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::ConfigurationEntry::ConfigurationEntry(const UserIdentity &creator,
const std::string &comment):
m_creationTime(time(NULL)),
m_creator(creator),
m_comment(comment) {
}
//------------------------------------------------------------------------------
// getCreationTime
//------------------------------------------------------------------------------
time_t cta::ConfigurationEntry::getCreationTime() const throw() {
return m_creationTime;
}
//------------------------------------------------------------------------------
// getCreator
//------------------------------------------------------------------------------
const cta::UserIdentity &cta::ConfigurationEntry::getCreator() const throw() {
return m_creator;
}
//------------------------------------------------------------------------------
// getComment
//------------------------------------------------------------------------------
const std::string &cta::ConfigurationEntry::getComment() const throw() {
return m_comment;
}
#pragma once
#include "cta/UserIdentity.hpp"
#include <string>
#include <time.h>
namespace cta {
/**
* Abstract class representing a configuration entry.
*/
class ConfigurationEntry {
public:
/**
* Constructor.
*/
ConfigurationEntry();
/**
* Destructor.
*/
virtual ~ConfigurationEntry() throw() = 0;
/**
* Constructor.
*
* @param creator The identity of the user that created the configuration
* entry.
* @param comment The comment made by the creator of the configuration
* request.
*/
ConfigurationEntry(const UserIdentity &creator, const std::string &comment);
/**
* Returns the absolute time at which the configuration entry was created.
*
* @return The absolute time at which the configuration entry was created.
*/
time_t getCreationTime() const throw();
/**
* Returns the identity of the user that created the configuration entry.
*
* @return The identity of the user that created the configuration entry.
*/
const UserIdentity &getCreator() const throw();
/**
* Returns the comment made by the creator of the configuration request.
*
* @return The comment made by the creator of the configuration request.
*/
const std::string &getComment() const throw();
private:
/**
* The absolute time at which the configuration entry was created.
*/
time_t m_creationTime;
/**
* The identity of the user that created the configuration entry.
*/
UserIdentity m_creator;
/**
* The comment made by the creator of the configuration request.
*/
std::string m_comment;
}; // class ConfigurationEntry
} // namespace cta
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment