Skip to content
Snippets Groups Projects
Commit 38df1f86 authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Namespaced all data structures .cpp's

parent 29e639c3
No related branches found
No related tags found
No related merge requests found
Showing
with 147 additions and 77 deletions
......@@ -20,15 +20,19 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::AdminHost::AdminHost() {}
AdminHost::AdminHost() {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::AdminHost::operator==(const AdminHost &rhs) const {
bool AdminHost::operator==(const AdminHost &rhs) const {
return name==rhs.name
&& creationLog==rhs.creationLog
&& lastModificationLog==rhs.lastModificationLog
......@@ -38,14 +42,14 @@ bool cta::common::dataStructures::AdminHost::operator==(const AdminHost &rhs) co
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::AdminHost::operator!=(const AdminHost &rhs) const {
bool AdminHost::operator!=(const AdminHost &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::AdminHost &obj) {
std::ostream &operator<<(std::ostream &os, const AdminHost &obj) {
os << "(name=" << obj.name
<< " creationLog=" << obj.creationLog
<< " lastModificationLog=" << obj.lastModificationLog
......@@ -53,3 +57,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ad
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -41,14 +41,14 @@ struct AdminHost {
bool operator!=(const AdminHost &rhs) const;
std::string name;
cta::common::dataStructures::EntryLog creationLog;
cta::common::dataStructures::EntryLog lastModificationLog;
EntryLog creationLog;
EntryLog lastModificationLog;
std::string comment;
}; // struct AdminHost
std::ostream &operator<<(std::ostream &os, const AdminHost &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::AdminHost &obj);
......@@ -20,15 +20,19 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::AdminUser::AdminUser() {}
AdminUser::AdminUser() {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::AdminUser::operator==(const AdminUser &rhs) const {
bool AdminUser::operator==(const AdminUser &rhs) const {
return name==rhs.name
&& creationLog==rhs.creationLog
&& lastModificationLog==rhs.lastModificationLog
......@@ -38,14 +42,14 @@ bool cta::common::dataStructures::AdminUser::operator==(const AdminUser &rhs) co
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::AdminUser::operator!=(const AdminUser &rhs) const {
bool AdminUser::operator!=(const AdminUser &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::AdminUser &obj) {
std::ostream &operator<<(std::ostream &os, const AdminUser &obj) {
os << "(name=" << obj.name
<< " creationLog=" << obj.creationLog
<< " lastModificationLog=" << obj.lastModificationLog
......@@ -53,3 +57,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ad
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -41,14 +41,14 @@ struct AdminUser {
bool operator!=(const AdminUser &rhs) const;
std::string name;
cta::common::dataStructures::EntryLog creationLog;
cta::common::dataStructures::EntryLog lastModificationLog;
EntryLog creationLog;
EntryLog lastModificationLog;
std::string comment;
}; // struct AdminUser
std::ostream &operator<<(std::ostream &os, const AdminUser &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::AdminUser &obj);
......@@ -20,10 +20,14 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveFile::ArchiveFile():
ArchiveFile::ArchiveFile():
archiveFileID(0),
fileSize(0),
creationTime(0),
......@@ -32,7 +36,7 @@ cta::common::dataStructures::ArchiveFile::ArchiveFile():
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveFile::operator==(const ArchiveFile &rhs) const {
bool ArchiveFile::operator==(const ArchiveFile &rhs) const {
return archiveFileID==rhs.archiveFileID
&& diskFileID==rhs.diskFileID
&& diskInstance==rhs.diskInstance
......@@ -49,14 +53,14 @@ bool cta::common::dataStructures::ArchiveFile::operator==(const ArchiveFile &rhs
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveFile::operator!=(const ArchiveFile &rhs) const {
bool ArchiveFile::operator!=(const ArchiveFile &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveFile &obj) {
std::ostream &operator<<(std::ostream &os, const ArchiveFile &obj) {
os << "(archiveFileID=" << obj.archiveFileID
<< " diskFileID=" << obj.diskFileID
<< " diskInstance=" << obj.diskInstance
......@@ -71,3 +75,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ar
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -54,20 +54,20 @@ struct ArchiveFile {
*/
std::string checksumValue;
std::string storageClass;
cta::common::dataStructures::DRData drData;
DRData drData;
/**
* This map represents the non-necessarily-exhaustive set of tape copies
* to be listed by the operator. For example, if the listing requested is
* for a single tape, the map will contain only one element.
*/
std::map<uint64_t,cta::common::dataStructures::TapeFile> tapeCopies;
std::map<uint64_t,TapeFile> tapeCopies;
time_t creationTime;
time_t reconciliationTime;
}; // struct ArchiveFile
std::ostream &operator<<(std::ostream &os, const ArchiveFile &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveFile &obj);
......@@ -20,17 +20,21 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveFileSummary::ArchiveFileSummary():
ArchiveFileSummary::ArchiveFileSummary():
totalBytes(0),
totalFiles(0) {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveFileSummary::operator==(const ArchiveFileSummary &rhs) const {
bool ArchiveFileSummary::operator==(const ArchiveFileSummary &rhs) const {
return totalBytes==rhs.totalBytes
&& totalFiles==rhs.totalFiles;
}
......@@ -38,16 +42,19 @@ bool cta::common::dataStructures::ArchiveFileSummary::operator==(const ArchiveFi
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveFileSummary::operator!=(const ArchiveFileSummary &rhs) const {
bool ArchiveFileSummary::operator!=(const ArchiveFileSummary &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveFileSummary &obj) {
std::ostream &operator<<(std::ostream &os, const ArchiveFileSummary &obj) {
os << "(totalBytes=" << obj.totalBytes
<< " totalFiles=" << obj.totalFiles << ")";
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -44,8 +44,8 @@ struct ArchiveFileSummary {
}; // struct ArchiveFileSummary
std::ostream &operator<<(std::ostream &os, const ArchiveFileSummary &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveFileSummary &obj);
......@@ -20,17 +20,21 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveJob::ArchiveJob():
ArchiveJob::ArchiveJob():
copyNumber(0),
archiveFileID(0) {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveJob::operator==(const ArchiveJob &rhs) const {
bool ArchiveJob::operator==(const ArchiveJob &rhs) const {
return request==rhs.request
&& tapePool==rhs.tapePool
&& copyNumber==rhs.copyNumber
......@@ -40,14 +44,14 @@ bool cta::common::dataStructures::ArchiveJob::operator==(const ArchiveJob &rhs)
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveJob::operator!=(const ArchiveJob &rhs) const {
bool ArchiveJob::operator!=(const ArchiveJob &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveJob &obj) {
std::ostream &operator<<(std::ostream &os, const ArchiveJob &obj) {
os << "(request=" << obj.request
<< " tapePool=" << obj.tapePool
<< " copyNumber=" << obj.copyNumber
......@@ -55,3 +59,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ar
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -41,15 +41,15 @@ struct ArchiveJob {
bool operator!=(const ArchiveJob &rhs) const;
cta::common::dataStructures::ArchiveRequest request;
ArchiveRequest request;
std::string tapePool;
uint64_t copyNumber;
uint64_t archiveFileID;
}; // struct ArchiveJob
std::ostream &operator<<(std::ostream &os, const ArchiveJob &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveJob &obj);
......@@ -20,17 +20,21 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveRequest::ArchiveRequest():
ArchiveRequest::ArchiveRequest():
fileSize(0),
diskpoolThroughput(0) {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveRequest::operator==(const ArchiveRequest &rhs) const {
bool ArchiveRequest::operator==(const ArchiveRequest &rhs) const {
return requester==rhs.requester
&& diskFileID==rhs.diskFileID
&& instance==rhs.instance
......@@ -48,14 +52,14 @@ bool cta::common::dataStructures::ArchiveRequest::operator==(const ArchiveReques
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveRequest::operator!=(const ArchiveRequest &rhs) const {
bool ArchiveRequest::operator!=(const ArchiveRequest &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveRequest &obj) {
std::ostream &operator<<(std::ostream &os, const ArchiveRequest &obj) {
os << "(requester=" << obj.requester
<< " diskFileID=" << obj.diskFileID
<< " instance=" << obj.instance
......@@ -71,3 +75,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ar
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -42,7 +42,7 @@ struct ArchiveRequest {
bool operator!=(const ArchiveRequest &rhs) const;
cta::common::dataStructures::UserIdentity requester;
UserIdentity requester;
std::string diskFileID;
std::string instance;
std::string srcURL;
......@@ -56,15 +56,15 @@ struct ArchiveRequest {
*/
std::string checksumValue;
std::string storageClass;
cta::common::dataStructures::DRData drData;
DRData drData;
std::string diskpoolName;
uint64_t diskpoolThroughput;
cta::common::dataStructures::EntryLog creationLog;
EntryLog creationLog;
}; // struct ArchiveRequest
std::ostream &operator<<(std::ostream &os, const ArchiveRequest &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveRequest &obj);
......@@ -20,16 +20,20 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveRoute::ArchiveRoute():
ArchiveRoute::ArchiveRoute():
copyNb(0) {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveRoute::operator==(const ArchiveRoute &rhs) const {
bool ArchiveRoute::operator==(const ArchiveRoute &rhs) const {
return storageClassName==rhs.storageClassName
&& copyNb==rhs.copyNb
&& tapePoolName==rhs.tapePoolName
......@@ -41,14 +45,14 @@ bool cta::common::dataStructures::ArchiveRoute::operator==(const ArchiveRoute &r
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::ArchiveRoute::operator!=(const ArchiveRoute &rhs) const {
bool ArchiveRoute::operator!=(const ArchiveRoute &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveRoute &obj) {
std::ostream &operator<<(std::ostream &os, const ArchiveRoute &obj) {
os << "(storageClassName=" << obj.storageClassName
<< " copyNb=" << obj.copyNb
<< " tapePoolName=" << obj.tapePoolName
......@@ -58,3 +62,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ar
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -44,14 +44,14 @@ struct ArchiveRoute {
std::string storageClassName;
uint64_t copyNb;
std::string tapePoolName;
cta::common::dataStructures::EntryLog creationLog;
cta::common::dataStructures::EntryLog lastModificationLog;
EntryLog creationLog;
EntryLog lastModificationLog;
std::string comment;
}; // struct ArchiveRoute
std::ostream &operator<<(std::ostream &os, const ArchiveRoute &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ArchiveRoute &obj);
......@@ -20,16 +20,20 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::CancelRetrieveRequest::CancelRetrieveRequest():
CancelRetrieveRequest::CancelRetrieveRequest():
archiveFileID(0) {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::CancelRetrieveRequest::operator==(const CancelRetrieveRequest &rhs) const {
bool CancelRetrieveRequest::operator==(const CancelRetrieveRequest &rhs) const {
return requester==rhs.requester
&& archiveFileID==rhs.archiveFileID
&& dstURL==rhs.dstURL
......@@ -39,14 +43,14 @@ bool cta::common::dataStructures::CancelRetrieveRequest::operator==(const Cancel
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::CancelRetrieveRequest::operator!=(const CancelRetrieveRequest &rhs) const {
bool CancelRetrieveRequest::operator!=(const CancelRetrieveRequest &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::CancelRetrieveRequest &obj) {
std::ostream &operator<<(std::ostream &os, const CancelRetrieveRequest &obj) {
os << "(requester=" << obj.requester
<< " archiveFileID=" << obj.archiveFileID
<< " dstURL=" << obj.dstURL
......@@ -54,3 +58,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ca
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -41,15 +41,15 @@ struct CancelRetrieveRequest {
bool operator!=(const CancelRetrieveRequest &rhs) const;
cta::common::dataStructures::UserIdentity requester;
UserIdentity requester;
uint64_t archiveFileID;
std::string dstURL;
cta::common::dataStructures::DRData drData;
DRData drData;
}; // struct CancelRetrieveRequest
std::ostream &operator<<(std::ostream &os, const CancelRetrieveRequest &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::CancelRetrieveRequest &obj);
......@@ -20,15 +20,19 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::DRData::DRData() {}
DRData::DRData() {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::DRData::operator==(const DRData &rhs) const {
bool DRData::operator==(const DRData &rhs) const {
return drPath==rhs.drPath
&& drOwner==rhs.drOwner
&& drGroup==rhs.drGroup
......@@ -38,14 +42,14 @@ bool cta::common::dataStructures::DRData::operator==(const DRData &rhs) const {
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::DRData::operator!=(const DRData &rhs) const {
bool DRData::operator!=(const DRData &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::DRData &obj) {
std::ostream &operator<<(std::ostream &os, const DRData &obj) {
os << "(drPath=" << obj.drPath
<< " drOwner=" << obj.drOwner
<< " drGroup=" << obj.drGroup
......@@ -53,3 +57,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::DR
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -47,8 +47,8 @@ struct DRData {
}; // struct DRData
std::ostream &operator<<(std::ostream &os, const DRData &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::DRData &obj);
......@@ -20,17 +20,21 @@
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
namespace cta {
namespace common {
namespace dataStructures {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::Dedication::Dedication():
Dedication::Dedication():
fromTimestamp(0),
untilTimestamp(0) {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::Dedication::operator==(const Dedication &rhs) const {
bool Dedication::operator==(const Dedication &rhs) const {
return driveName==rhs.driveName
&& dedicationType==rhs.dedicationType
&& tag==rhs.tag
......@@ -45,14 +49,14 @@ bool cta::common::dataStructures::Dedication::operator==(const Dedication &rhs)
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::Dedication::operator!=(const Dedication &rhs) const {
bool Dedication::operator!=(const Dedication &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Dedication &obj) {
std::ostream &operator<<(std::ostream &os, const Dedication &obj) {
os << "(driveName=" << obj.driveName
<< " dedicationType=" << obj.dedicationType
<< " tag=" << obj.tag
......@@ -65,3 +69,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::De
return os;
}
} // namespace dataStructures
} // namespace common
} // namespace cta
......@@ -42,19 +42,19 @@ struct Dedication {
bool operator!=(const Dedication &rhs) const;
std::string driveName;
cta::common::dataStructures::DedicationType dedicationType;
DedicationType dedicationType;
std::string tag;
std::string vid;
uint64_t fromTimestamp;
uint64_t untilTimestamp;
cta::common::dataStructures::EntryLog creationLog;
cta::common::dataStructures::EntryLog lastModificationLog;
EntryLog creationLog;
EntryLog lastModificationLog;
std::string comment;
}; // struct Dedication
std::ostream &operator<<(std::ostream &os, const Dedication &obj);
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Dedication &obj);
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