Skip to content
Snippets Groups Projects
Commit 528ad67d authored by Eric Cano's avatar Eric Cano
Browse files

Added sorting of StorageClass list in OStoreDB::getStorageClasses()

parent 8d4ef915
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
#include "scheduler/StorageClass.hpp"
#include "scheduler/AdminHost.hpp"
#include "scheduler/AdminUser.hpp"
#include <algorithm>
namespace cta {
......@@ -167,6 +168,7 @@ std::list<StorageClass> OStoreDB::getStorageClasses() const {
sc->copyCount, cta::UserIdentity(sc->log.uid, sc->log.gid),
sc->log.comment, sc->log.time));
}
ret.sort();
return ret;
}
......
......@@ -58,3 +58,11 @@ const std::string &cta::StorageClass::getName() const throw() {
uint16_t cta::StorageClass::getNbCopies() const throw() {
return m_nbCopies;
}
//------------------------------------------------------------------------------
// operator<
//------------------------------------------------------------------------------
bool cta::StorageClass::operator<(const StorageClass& rhs) const {
return m_name < rhs.m_name;
}
......@@ -76,6 +76,14 @@ public:
* class should have on tape.
*/
uint16_t getNbCopies() const throw();
/**
* Returns true if the specified right-hand side is greater than this object.
*
* @param rhs The object on the right-hand side of the < operator.
* @return True if the specified right-hand side is greater than this object.
*/
bool operator<(const StorageClass &rhs) const;
private:
......
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