diff --git a/common/dataStructures/AdminHost.cpp b/common/dataStructures/AdminHost.cpp index b63f69ce0f1b72de8b5230523f17ebd97ce60222..ca9028369529452de3890e3f515338a4c1c60af4 100644 --- a/common/dataStructures/AdminHost.cpp +++ b/common/dataStructures/AdminHost.cpp @@ -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 diff --git a/common/dataStructures/AdminHost.hpp b/common/dataStructures/AdminHost.hpp index e60ea093a3da18fd009482681e9d23e3ca210fbf..7dfdb008a2765be63765860a512549b459092d61 100644 --- a/common/dataStructures/AdminHost.hpp +++ b/common/dataStructures/AdminHost.hpp @@ -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); diff --git a/common/dataStructures/AdminUser.cpp b/common/dataStructures/AdminUser.cpp index 92f33352f878f440fc737ae759adc71706f7baa6..829bf04940726ba2911b7028e27e87b2ffe811ab 100644 --- a/common/dataStructures/AdminUser.cpp +++ b/common/dataStructures/AdminUser.cpp @@ -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 diff --git a/common/dataStructures/AdminUser.hpp b/common/dataStructures/AdminUser.hpp index 4336d02f27993d24a70651ac6e743a0f41bb187c..9525fae8cf864df74a70d9bd8e9f3cf669277b7b 100644 --- a/common/dataStructures/AdminUser.hpp +++ b/common/dataStructures/AdminUser.hpp @@ -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); diff --git a/common/dataStructures/ArchiveFile.cpp b/common/dataStructures/ArchiveFile.cpp index b527377f86ad5a71a5cb9ec84352e0e6a9cd5ceb..5964883a11869b521d0a16c47f4499862f7ff8d3 100644 --- a/common/dataStructures/ArchiveFile.cpp +++ b/common/dataStructures/ArchiveFile.cpp @@ -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 diff --git a/common/dataStructures/ArchiveFile.hpp b/common/dataStructures/ArchiveFile.hpp index 7b4b90e216fa8c733b605f1419b143208b9f5b92..bef2a5eacb2a19ad26d5a88cdaef03e3eec6afb6 100644 --- a/common/dataStructures/ArchiveFile.hpp +++ b/common/dataStructures/ArchiveFile.hpp @@ -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); diff --git a/common/dataStructures/ArchiveFileSummary.cpp b/common/dataStructures/ArchiveFileSummary.cpp index c7dc8412ea6d238c52419856a6674e63ae5d4587..cc9ec8b86a7c83c536056b79558193d8702dfc71 100644 --- a/common/dataStructures/ArchiveFileSummary.cpp +++ b/common/dataStructures/ArchiveFileSummary.cpp @@ -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 diff --git a/common/dataStructures/ArchiveFileSummary.hpp b/common/dataStructures/ArchiveFileSummary.hpp index dbc847fe0a87fb83c33dac1d602510c1a945b771..99ce39c511b0eaa7f0b85dadacf7a7e694851177 100644 --- a/common/dataStructures/ArchiveFileSummary.hpp +++ b/common/dataStructures/ArchiveFileSummary.hpp @@ -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); diff --git a/common/dataStructures/ArchiveJob.cpp b/common/dataStructures/ArchiveJob.cpp index 00e003e650b5287b70ec848b099401bbac733c9d..231b409045a653aceeeb80de82f7c8b888985453 100644 --- a/common/dataStructures/ArchiveJob.cpp +++ b/common/dataStructures/ArchiveJob.cpp @@ -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 diff --git a/common/dataStructures/ArchiveJob.hpp b/common/dataStructures/ArchiveJob.hpp index 4c94abab4ca5e3ae85e00c16e1155156c17fd2c6..4aeeb27fce1d741295fb92863fe942c63fbc84fd 100644 --- a/common/dataStructures/ArchiveJob.hpp +++ b/common/dataStructures/ArchiveJob.hpp @@ -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); diff --git a/common/dataStructures/ArchiveRequest.cpp b/common/dataStructures/ArchiveRequest.cpp index 711a31166c4dfe2946b439cd673a33f506f36d7d..f977d8f9e19ae492afcf98b653c1031af2bbcb1e 100644 --- a/common/dataStructures/ArchiveRequest.cpp +++ b/common/dataStructures/ArchiveRequest.cpp @@ -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 diff --git a/common/dataStructures/ArchiveRequest.hpp b/common/dataStructures/ArchiveRequest.hpp index 5ff60f35d2a270edeb3aab2822195370f276af9d..801b7c3dd61db677638a29b62e7d33cf4d07ca03 100644 --- a/common/dataStructures/ArchiveRequest.hpp +++ b/common/dataStructures/ArchiveRequest.hpp @@ -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); diff --git a/common/dataStructures/ArchiveRoute.cpp b/common/dataStructures/ArchiveRoute.cpp index cdec6c386e309a60017639d4c51b7f462139e814..09836ddafe5b16c9ad6ef6bc6ec065ef99996839 100644 --- a/common/dataStructures/ArchiveRoute.cpp +++ b/common/dataStructures/ArchiveRoute.cpp @@ -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 diff --git a/common/dataStructures/ArchiveRoute.hpp b/common/dataStructures/ArchiveRoute.hpp index 4ed86ee5eff42b85bdc778b821f2a95d2ba54ff2..b73ac7d3b39b63a9794f99e790b51819de3a40e5 100644 --- a/common/dataStructures/ArchiveRoute.hpp +++ b/common/dataStructures/ArchiveRoute.hpp @@ -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); diff --git a/common/dataStructures/CancelRetrieveRequest.cpp b/common/dataStructures/CancelRetrieveRequest.cpp index e308c542c3ab6cdc0ba2c1775bfc434266549bf3..d4675c542d2e9c5e4b00d97aee3be969057fac2f 100644 --- a/common/dataStructures/CancelRetrieveRequest.cpp +++ b/common/dataStructures/CancelRetrieveRequest.cpp @@ -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 diff --git a/common/dataStructures/CancelRetrieveRequest.hpp b/common/dataStructures/CancelRetrieveRequest.hpp index b7f453e23d69159a54135b4fc4eb0a1c0ff2bff3..70476c189551e556509f850fd2cfabc0296f7473 100644 --- a/common/dataStructures/CancelRetrieveRequest.hpp +++ b/common/dataStructures/CancelRetrieveRequest.hpp @@ -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); diff --git a/common/dataStructures/DRData.cpp b/common/dataStructures/DRData.cpp index 9c0b98f2d8a23ccaffd7d442a27f19b06c9b96af..1420e567797b0c65d66a51ee32b676cf75666cbe 100644 --- a/common/dataStructures/DRData.cpp +++ b/common/dataStructures/DRData.cpp @@ -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 diff --git a/common/dataStructures/DRData.hpp b/common/dataStructures/DRData.hpp index d3d3ca88cab14857a3d4d46155f1654eafa27aab..4fe7a63f7ab22f69e516d5afe1219e4ee0aabe08 100644 --- a/common/dataStructures/DRData.hpp +++ b/common/dataStructures/DRData.hpp @@ -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); diff --git a/common/dataStructures/Dedication.cpp b/common/dataStructures/Dedication.cpp index f24169b54220b37ba7953d19b082990bf3e395af..f055bb923ddab16938e928c03f45d1f3a22647eb 100644 --- a/common/dataStructures/Dedication.cpp +++ b/common/dataStructures/Dedication.cpp @@ -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 diff --git a/common/dataStructures/Dedication.hpp b/common/dataStructures/Dedication.hpp index 167a144b874c151ced028731a66b7ac0cacc9670..c40d00ce5fd552fcf814c2a785b1e37fd51e7a96 100644 --- a/common/dataStructures/Dedication.hpp +++ b/common/dataStructures/Dedication.hpp @@ -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); diff --git a/common/dataStructures/DeleteArchiveRequest.cpp b/common/dataStructures/DeleteArchiveRequest.cpp index d3c47ff83615ce7c0b9e9fa50815fb259ef416aa..034f554bae89b8e1d1a10dacdc459f1369c6fce3 100644 --- a/common/dataStructures/DeleteArchiveRequest.cpp +++ b/common/dataStructures/DeleteArchiveRequest.cpp @@ -20,16 +20,20 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::DeleteArchiveRequest::DeleteArchiveRequest(): +DeleteArchiveRequest::DeleteArchiveRequest(): archiveFileID(0) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::DeleteArchiveRequest::operator==(const DeleteArchiveRequest &rhs) const { +bool DeleteArchiveRequest::operator==(const DeleteArchiveRequest &rhs) const { return requester==rhs.requester && archiveFileID==rhs.archiveFileID; } @@ -37,16 +41,19 @@ bool cta::common::dataStructures::DeleteArchiveRequest::operator==(const DeleteA //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::DeleteArchiveRequest::operator!=(const DeleteArchiveRequest &rhs) const { +bool DeleteArchiveRequest::operator!=(const DeleteArchiveRequest &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::DeleteArchiveRequest &obj) { +std::ostream &operator<<(std::ostream &os, const DeleteArchiveRequest &obj) { os << "(requester=" << obj.requester << " archiveFileID=" << obj.archiveFileID << ")"; return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/DeleteArchiveRequest.hpp b/common/dataStructures/DeleteArchiveRequest.hpp index f44d1ca909d977a5e1e6eda4e15bd100da85e455..fd0730d20c41338059904a169a10fd592e0b8d29 100644 --- a/common/dataStructures/DeleteArchiveRequest.hpp +++ b/common/dataStructures/DeleteArchiveRequest.hpp @@ -41,13 +41,13 @@ struct DeleteArchiveRequest { bool operator!=(const DeleteArchiveRequest &rhs) const; - cta::common::dataStructures::UserIdentity requester; + UserIdentity requester; uint64_t archiveFileID; }; // struct DeleteArchiveRequest +std::ostream &operator<<(std::ostream &os, const DeleteArchiveRequest &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::DeleteArchiveRequest &obj); diff --git a/common/dataStructures/DriveState.cpp b/common/dataStructures/DriveState.cpp index 66075f9eb0544a382f9c76726e32243a07b0385c..225ba6efbc75726d4ec74dd43c6179e6a25a0010 100644 --- a/common/dataStructures/DriveState.cpp +++ b/common/dataStructures/DriveState.cpp @@ -20,10 +20,14 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::DriveState::DriveState(): +DriveState::DriveState(): sessionId(0), bytesTransferedInSession(0), filesTransferedInSession(0), @@ -34,7 +38,7 @@ cta::common::dataStructures::DriveState::DriveState(): //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::DriveState::operator==(const DriveState &rhs) const { +bool DriveState::operator==(const DriveState &rhs) const { return name==rhs.name && host==rhs.host && logicalLibrary==rhs.logicalLibrary @@ -53,14 +57,14 @@ bool cta::common::dataStructures::DriveState::operator==(const DriveState &rhs) //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::DriveState::operator!=(const DriveState &rhs) const { +bool DriveState::operator!=(const DriveState &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::DriveState &obj) { +std::ostream &operator<<(std::ostream &os, const DriveState &obj) { os << "(name=" << obj.name << " host=" << obj.host << " logicalLibrary=" << obj.logicalLibrary @@ -77,3 +81,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Dr return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/DriveState.hpp b/common/dataStructures/DriveState.hpp index 14d4de38f335b93b5e9984cc4e35c835a6833d79..75843f806efc8340a35fcb099e7087da744e56c0 100644 --- a/common/dataStructures/DriveState.hpp +++ b/common/dataStructures/DriveState.hpp @@ -51,15 +51,15 @@ struct DriveState { uint64_t latestBandwidth; time_t sessionStartTime; time_t currentStateStartTime; - cta::common::dataStructures::MountType mountType; - cta::common::dataStructures::DriveStatus status; + MountType mountType; + DriveStatus status; std::string currentVid; std::string currentTapePool; }; // struct DriveState +std::ostream &operator<<(std::ostream &os, const DriveState &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::DriveState &obj); diff --git a/common/dataStructures/EntryLog.cpp b/common/dataStructures/EntryLog.cpp index 1d79f23af90919474a44ba0122a2f99aa4b24536..4898cdfe71cb3101ea706e2b3b7c53cd98f44657 100644 --- a/common/dataStructures/EntryLog.cpp +++ b/common/dataStructures/EntryLog.cpp @@ -20,16 +20,20 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::EntryLog::EntryLog(): +EntryLog::EntryLog(): time(0) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::EntryLog::operator==(const EntryLog &rhs) const { +bool EntryLog::operator==(const EntryLog &rhs) const { return user==rhs.user && host==rhs.host && time==rhs.time; @@ -38,17 +42,20 @@ bool cta::common::dataStructures::EntryLog::operator==(const EntryLog &rhs) cons //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::EntryLog::operator!=(const EntryLog &rhs) const { +bool EntryLog::operator!=(const EntryLog &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::EntryLog &obj) { +std::ostream &operator<<(std::ostream &os, const EntryLog &obj) { os << "(user=" << obj.user << " host=" << obj.host << " time=" << obj.time << ")"; return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/EntryLog.hpp b/common/dataStructures/EntryLog.hpp index 087bfbb0612929a1577b89ef1028162f22a6128c..7f5510a32b33de782740993e0e19a7129347b496 100644 --- a/common/dataStructures/EntryLog.hpp +++ b/common/dataStructures/EntryLog.hpp @@ -41,14 +41,14 @@ struct EntryLog { bool operator!=(const EntryLog &rhs) const; - cta::common::dataStructures::UserIdentity user; + UserIdentity user; std::string host; time_t time; }; // struct EntryLog +std::ostream &operator<<(std::ostream &os, const EntryLog &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::EntryLog &obj); diff --git a/common/dataStructures/ListStorageClassRequest.cpp b/common/dataStructures/ListStorageClassRequest.cpp index 08e813301ae6dcbc437f1e39c8a96480d1b49b8f..dde09ca0f17ebdc87cd3c941b3079d15425d67fb 100644 --- a/common/dataStructures/ListStorageClassRequest.cpp +++ b/common/dataStructures/ListStorageClassRequest.cpp @@ -20,30 +20,37 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::ListStorageClassRequest::ListStorageClassRequest() {} +ListStorageClassRequest::ListStorageClassRequest() {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::ListStorageClassRequest::operator==(const ListStorageClassRequest &rhs) const { +bool ListStorageClassRequest::operator==(const ListStorageClassRequest &rhs) const { return requester==rhs.requester; } //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::ListStorageClassRequest::operator!=(const ListStorageClassRequest &rhs) const { +bool ListStorageClassRequest::operator!=(const ListStorageClassRequest &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ListStorageClassRequest &obj) { +std::ostream &operator<<(std::ostream &os, const ListStorageClassRequest &obj) { os << "(requester=" << obj.requester << ")"; return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/ListStorageClassRequest.hpp b/common/dataStructures/ListStorageClassRequest.hpp index 859b3df75a837ca2dbb900afc2e0ed3efe752cb1..9bb3a017853e7df39b161a218e5c1dfb2c527ed4 100644 --- a/common/dataStructures/ListStorageClassRequest.hpp +++ b/common/dataStructures/ListStorageClassRequest.hpp @@ -40,12 +40,12 @@ struct ListStorageClassRequest { bool operator!=(const ListStorageClassRequest &rhs) const; - cta::common::dataStructures::UserIdentity requester; + UserIdentity requester; }; // struct ListStorageClassRequest +std::ostream &operator<<(std::ostream &os, const ListStorageClassRequest &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ListStorageClassRequest &obj); diff --git a/common/dataStructures/LogicalLibrary.cpp b/common/dataStructures/LogicalLibrary.cpp index 3b91cf67c8df943f76682319c5fd654631f5f405..1e6efaf6fb4562e3ded9f08eb586aa36987baffc 100644 --- a/common/dataStructures/LogicalLibrary.cpp +++ b/common/dataStructures/LogicalLibrary.cpp @@ -20,15 +20,19 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::LogicalLibrary::LogicalLibrary() {} +LogicalLibrary::LogicalLibrary() {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::LogicalLibrary::operator==(const LogicalLibrary &rhs) const { +bool LogicalLibrary::operator==(const LogicalLibrary &rhs) const { return name==rhs.name && creationLog==rhs.creationLog && lastModificationLog==rhs.lastModificationLog @@ -38,14 +42,14 @@ bool cta::common::dataStructures::LogicalLibrary::operator==(const LogicalLibrar //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::LogicalLibrary::operator!=(const LogicalLibrary &rhs) const { +bool LogicalLibrary::operator!=(const LogicalLibrary &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::LogicalLibrary &obj) { +std::ostream &operator<<(std::ostream &os, const LogicalLibrary &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::Lo return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/LogicalLibrary.hpp b/common/dataStructures/LogicalLibrary.hpp index 856e09242ce0a719bdcdc07e8b25d8e1011795f3..8ab20e4334022158a147f47af91c3fff049dc66b 100644 --- a/common/dataStructures/LogicalLibrary.hpp +++ b/common/dataStructures/LogicalLibrary.hpp @@ -42,14 +42,14 @@ struct LogicalLibrary { bool operator!=(const LogicalLibrary &rhs) const; std::string name; - cta::common::dataStructures::EntryLog creationLog; - cta::common::dataStructures::EntryLog lastModificationLog; + EntryLog creationLog; + EntryLog lastModificationLog; std::string comment; }; // struct LogicalLibrary +std::ostream &operator<<(std::ostream &os, const LogicalLibrary &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::LogicalLibrary &obj); diff --git a/common/dataStructures/MountPolicy.cpp b/common/dataStructures/MountPolicy.cpp index b23563872d96871f78f3d347190557a4eeb87d26..60edd2a279f5ec53c517e47c787c9bd72dc7f3bd 100644 --- a/common/dataStructures/MountPolicy.cpp +++ b/common/dataStructures/MountPolicy.cpp @@ -20,10 +20,14 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::MountPolicy::MountPolicy(): +MountPolicy::MountPolicy(): archive_priority(0), archive_minRequestAge(0), retrieve_priority(0), @@ -33,7 +37,7 @@ cta::common::dataStructures::MountPolicy::MountPolicy(): //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::MountPolicy::operator==(const MountPolicy &rhs) const { +bool MountPolicy::operator==(const MountPolicy &rhs) const { return name==rhs.name && archive_priority==rhs.archive_priority && archive_minRequestAge==rhs.archive_minRequestAge @@ -48,14 +52,14 @@ bool cta::common::dataStructures::MountPolicy::operator==(const MountPolicy &rhs //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::MountPolicy::operator!=(const MountPolicy &rhs) const { +bool MountPolicy::operator!=(const MountPolicy &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::MountPolicy &obj) { +std::ostream &operator<<(std::ostream &os, const MountPolicy &obj) { os << "(name=" << obj.name << " archive_priority=" << obj.archive_priority << " archive_minRequestAge=" << obj.archive_minRequestAge @@ -68,3 +72,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Mo return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/MountPolicy.hpp b/common/dataStructures/MountPolicy.hpp index 57710acc833751a91b98ed3f37d8986ff4d0e186..6233d599a28ede6e6075c884e365ce3d1a791f0c 100644 --- a/common/dataStructures/MountPolicy.hpp +++ b/common/dataStructures/MountPolicy.hpp @@ -46,14 +46,14 @@ struct MountPolicy { uint64_t retrieve_priority; uint64_t retrieve_minRequestAge; uint64_t maxDrivesAllowed; - cta::common::dataStructures::EntryLog creationLog; - cta::common::dataStructures::EntryLog lastModificationLog; + EntryLog creationLog; + EntryLog lastModificationLog; std::string comment; }; // struct MountPolicy +std::ostream &operator<<(std::ostream &os, const MountPolicy &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::MountPolicy &obj); diff --git a/common/dataStructures/ReadTestResult.cpp b/common/dataStructures/ReadTestResult.cpp index 1e0d2f7ee5547ff840014f43c4222e81b1043cf0..3a6041a9be8787ab8f5febdeefead9971cd4b662 100644 --- a/common/dataStructures/ReadTestResult.cpp +++ b/common/dataStructures/ReadTestResult.cpp @@ -20,10 +20,14 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::ReadTestResult::ReadTestResult(): +ReadTestResult::ReadTestResult(): noOfFilesRead(0), totalBytesRead(0), totalFilesRead(0), @@ -32,7 +36,7 @@ cta::common::dataStructures::ReadTestResult::ReadTestResult(): //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::ReadTestResult::operator==(const ReadTestResult &rhs) const { +bool ReadTestResult::operator==(const ReadTestResult &rhs) const { return driveName==rhs.driveName && vid==rhs.vid && noOfFilesRead==rhs.noOfFilesRead @@ -46,14 +50,14 @@ bool cta::common::dataStructures::ReadTestResult::operator==(const ReadTestResul //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::ReadTestResult::operator!=(const ReadTestResult &rhs) const { +bool ReadTestResult::operator!=(const ReadTestResult &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ReadTestResult &obj) { +std::ostream &operator<<(std::ostream &os, const ReadTestResult &obj) { os << "(driveName=" << obj.driveName << " vid=" << obj.vid << " noOfFilesRead=" << obj.noOfFilesRead @@ -65,3 +69,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Re return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/ReadTestResult.hpp b/common/dataStructures/ReadTestResult.hpp index 8f717bbb3a2bdc0b45b7b1aa075bfb73a4116f07..edd33207e978bd2106f26ad6ecf46315798df6a1 100644 --- a/common/dataStructures/ReadTestResult.hpp +++ b/common/dataStructures/ReadTestResult.hpp @@ -50,8 +50,8 @@ struct ReadTestResult { }; // struct ReadTestResult +std::ostream &operator<<(std::ostream &os, const ReadTestResult &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::ReadTestResult &obj); diff --git a/common/dataStructures/RepackInfo.cpp b/common/dataStructures/RepackInfo.cpp index b0f7b91150de7646fd40f0c1294ce2050da02cf3..5f42b702e3eac28a6d7323b21052d55ebaa1eb1e 100644 --- a/common/dataStructures/RepackInfo.cpp +++ b/common/dataStructures/RepackInfo.cpp @@ -20,10 +20,14 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::RepackInfo::RepackInfo(): +RepackInfo::RepackInfo(): totalFiles(0), totalSize(0), filesToRetrieve(0), @@ -34,7 +38,7 @@ cta::common::dataStructures::RepackInfo::RepackInfo(): //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::RepackInfo::operator==(const RepackInfo &rhs) const { +bool RepackInfo::operator==(const RepackInfo &rhs) const { return vid==rhs.vid && tag==rhs.tag && totalFiles==rhs.totalFiles @@ -52,14 +56,14 @@ bool cta::common::dataStructures::RepackInfo::operator==(const RepackInfo &rhs) //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::RepackInfo::operator!=(const RepackInfo &rhs) const { +bool RepackInfo::operator!=(const RepackInfo &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::RepackInfo &obj) { +std::ostream &operator<<(std::ostream &os, const RepackInfo &obj) { os << "(vid=" << obj.vid << " tag=" << obj.tag << " totalFiles=" << obj.totalFiles @@ -75,3 +79,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Re return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/RepackInfo.hpp b/common/dataStructures/RepackInfo.hpp index faa2fd4c98a7166d29414a2b6863ec361e9db051..ca97c8b751fb6b4676ff3c08c317b397e2982db5 100644 --- a/common/dataStructures/RepackInfo.hpp +++ b/common/dataStructures/RepackInfo.hpp @@ -49,15 +49,15 @@ struct RepackInfo { uint64_t filesToArchive; uint64_t filesFailed; uint64_t filesArchived; - cta::common::dataStructures::RepackType repackType; + RepackType repackType; std::string repackStatus; std::map<uint64_t,std::string> errors; - cta::common::dataStructures::EntryLog creationLog; + EntryLog creationLog; }; // struct RepackInfo +std::ostream &operator<<(std::ostream &os, const RepackInfo &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::RepackInfo &obj); diff --git a/common/dataStructures/Requester.cpp b/common/dataStructures/Requester.cpp index 106ae39472ca47f5d700b54b5f9541835a60168d..c2a5ba17bd52483bb5e552d82f0ff1fae98931f7 100644 --- a/common/dataStructures/Requester.cpp +++ b/common/dataStructures/Requester.cpp @@ -20,15 +20,19 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::Requester::Requester() {} +Requester::Requester() {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::Requester::operator==(const Requester &rhs) const { +bool Requester::operator==(const Requester &rhs) const { return name==rhs.name && group==rhs.group && mountPolicy==rhs.mountPolicy @@ -40,14 +44,14 @@ bool cta::common::dataStructures::Requester::operator==(const Requester &rhs) co //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::Requester::operator!=(const Requester &rhs) const { +bool Requester::operator!=(const Requester &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Requester &obj) { +std::ostream &operator<<(std::ostream &os, const Requester &obj) { os << "(name=" << obj.name << " group=" << obj.group << " mountPolicy=" << obj.mountPolicy @@ -57,3 +61,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Re return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/Requester.hpp b/common/dataStructures/Requester.hpp index dc5b36f1d359354ee3d45a6a5ff0a9d7ed8eba2c..eb41cc1bfae695e2dece9675b95f69f16d232ba0 100644 --- a/common/dataStructures/Requester.hpp +++ b/common/dataStructures/Requester.hpp @@ -46,14 +46,14 @@ struct Requester { std::string name; std::string group; std::string mountPolicy; - cta::common::dataStructures::EntryLog creationLog; - cta::common::dataStructures::EntryLog lastModificationLog; + EntryLog creationLog; + EntryLog lastModificationLog; std::string comment; }; // struct Requester +std::ostream &operator<<(std::ostream &os, const Requester &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Requester &obj); diff --git a/common/dataStructures/RetrieveJob.cpp b/common/dataStructures/RetrieveJob.cpp index 5d93e16ef757f26c9a6fd8b67415dd46166b29f5..6c58a7d0463395c10eec0f31b7e3e6414f5d4fc7 100644 --- a/common/dataStructures/RetrieveJob.cpp +++ b/common/dataStructures/RetrieveJob.cpp @@ -20,15 +20,19 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::RetrieveJob::RetrieveJob() {} +RetrieveJob::RetrieveJob() {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::RetrieveJob::operator==(const RetrieveJob &rhs) const { +bool RetrieveJob::operator==(const RetrieveJob &rhs) const { return request==rhs.request && tapeCopies==rhs.tapeCopies; } @@ -36,16 +40,19 @@ bool cta::common::dataStructures::RetrieveJob::operator==(const RetrieveJob &rhs //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::RetrieveJob::operator!=(const RetrieveJob &rhs) const { +bool RetrieveJob::operator!=(const RetrieveJob &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::RetrieveJob &obj) { +std::ostream &operator<<(std::ostream &os, const RetrieveJob &obj) { os << "(request=" << obj.request << " tapeCopies=" << obj.tapeCopies << ")"; return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/RetrieveJob.hpp b/common/dataStructures/RetrieveJob.hpp index 7a965eb0586d049944a9490163311f3b471f9379..b1eec02dafe5f60a5d80c2c2e19d9249b1674025 100644 --- a/common/dataStructures/RetrieveJob.hpp +++ b/common/dataStructures/RetrieveJob.hpp @@ -42,13 +42,13 @@ struct RetrieveJob { bool operator!=(const RetrieveJob &rhs) const; - cta::common::dataStructures::RetrieveRequest request; - std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFile>> tapeCopies; + RetrieveRequest request; + std::map<std::string,std::pair<uint64_t,TapeFile>> tapeCopies; }; // struct RetrieveJob +std::ostream &operator<<(std::ostream &os, const RetrieveJob &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::RetrieveJob &obj); diff --git a/common/dataStructures/RetrieveRequest.cpp b/common/dataStructures/RetrieveRequest.cpp index fba6a15e1da78071cba2a3e2ecd52f620d49ca5d..e8c3d03729336779ea3ae881504494d2e9163d7a 100644 --- a/common/dataStructures/RetrieveRequest.cpp +++ b/common/dataStructures/RetrieveRequest.cpp @@ -20,17 +20,21 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::RetrieveRequest::RetrieveRequest(): +RetrieveRequest::RetrieveRequest(): archiveFileID(0), diskpoolThroughput(0) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::RetrieveRequest::operator==(const RetrieveRequest &rhs) const { +bool RetrieveRequest::operator==(const RetrieveRequest &rhs) const { return requester==rhs.requester && archiveFileID==rhs.archiveFileID && dstURL==rhs.dstURL @@ -43,14 +47,14 @@ bool cta::common::dataStructures::RetrieveRequest::operator==(const RetrieveRequ //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::RetrieveRequest::operator!=(const RetrieveRequest &rhs) const { +bool RetrieveRequest::operator!=(const RetrieveRequest &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::RetrieveRequest &obj) { +std::ostream &operator<<(std::ostream &os, const RetrieveRequest &obj) { os << "(requester=" << obj.requester << " archiveFileID=" << obj.archiveFileID << " dstURL=" << obj.dstURL @@ -61,3 +65,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Re return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/RetrieveRequest.hpp b/common/dataStructures/RetrieveRequest.hpp index d9ab77cc7706f127889f1cc87c8750b0d7ad8e37..91e29e6dd5caea896e202f9f8956d13eb8daf6ba 100644 --- a/common/dataStructures/RetrieveRequest.hpp +++ b/common/dataStructures/RetrieveRequest.hpp @@ -42,18 +42,18 @@ struct RetrieveRequest { bool operator!=(const RetrieveRequest &rhs) const; - cta::common::dataStructures::UserIdentity requester; + UserIdentity requester; uint64_t archiveFileID; std::string dstURL; - cta::common::dataStructures::DRData drData; + DRData drData; std::string diskpoolName; uint64_t diskpoolThroughput; - cta::common::dataStructures::EntryLog creationLog; + EntryLog creationLog; }; // struct RetrieveRequest +std::ostream &operator<<(std::ostream &os, const RetrieveRequest &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::RetrieveRequest &obj); diff --git a/common/dataStructures/SecurityIdentity.cpp b/common/dataStructures/SecurityIdentity.cpp index 90123035d79ae83fae2e47c244514c80602e3179..e677e29fdcfed6cbc8194ec45e54f36b5d596b75 100644 --- a/common/dataStructures/SecurityIdentity.cpp +++ b/common/dataStructures/SecurityIdentity.cpp @@ -20,15 +20,19 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::SecurityIdentity::SecurityIdentity() {} +SecurityIdentity::SecurityIdentity() {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::SecurityIdentity::operator==(const SecurityIdentity &rhs) const { +bool SecurityIdentity::operator==(const SecurityIdentity &rhs) const { return user==rhs.user && host==rhs.host; } @@ -36,16 +40,19 @@ bool cta::common::dataStructures::SecurityIdentity::operator==(const SecurityIde //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::SecurityIdentity::operator!=(const SecurityIdentity &rhs) const { +bool SecurityIdentity::operator!=(const SecurityIdentity &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::SecurityIdentity &obj) { +std::ostream &operator<<(std::ostream &os, const SecurityIdentity &obj) { os << "(user=" << obj.user << " host=" << obj.host << ")"; return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/SecurityIdentity.hpp b/common/dataStructures/SecurityIdentity.hpp index a9be94017a33c53c229c7464d7950a589596797c..9c7b0ffcf61b84b1191e0d2ff248924011b4ae97 100644 --- a/common/dataStructures/SecurityIdentity.hpp +++ b/common/dataStructures/SecurityIdentity.hpp @@ -41,13 +41,13 @@ struct SecurityIdentity { bool operator!=(const SecurityIdentity &rhs) const; - cta::common::dataStructures::UserIdentity user; + UserIdentity user; std::string host; }; // struct SecurityIdentity +std::ostream &operator<<(std::ostream &os, const SecurityIdentity &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::SecurityIdentity &obj); diff --git a/common/dataStructures/StorageClass.cpp b/common/dataStructures/StorageClass.cpp index 7aa07684ff611f1219cb85c0e087c478660a4b06..1c3a41e5bcc45372f8dc3f3ab2ac5f0c0792a9de 100644 --- a/common/dataStructures/StorageClass.cpp +++ b/common/dataStructures/StorageClass.cpp @@ -20,16 +20,20 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::StorageClass::StorageClass(): +StorageClass::StorageClass(): nbCopies(0) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::StorageClass::operator==(const StorageClass &rhs) const { +bool StorageClass::operator==(const StorageClass &rhs) const { return name==rhs.name && nbCopies==rhs.nbCopies && creationLog==rhs.creationLog @@ -40,14 +44,14 @@ bool cta::common::dataStructures::StorageClass::operator==(const StorageClass &r //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::StorageClass::operator!=(const StorageClass &rhs) const { +bool StorageClass::operator!=(const StorageClass &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::StorageClass &obj) { +std::ostream &operator<<(std::ostream &os, const StorageClass &obj) { os << "(name=" << obj.name << " nbCopies=" << obj.nbCopies << " creationLog=" << obj.creationLog @@ -56,3 +60,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::St return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/StorageClass.hpp b/common/dataStructures/StorageClass.hpp index f34e14862305516ddd0f6939b94b7a130b8877aa..a8a6bd5c6357adb0bdfd9b8f3ddede770eab19fa 100644 --- a/common/dataStructures/StorageClass.hpp +++ b/common/dataStructures/StorageClass.hpp @@ -44,14 +44,14 @@ struct StorageClass { std::string name; uint64_t nbCopies; - cta::common::dataStructures::EntryLog creationLog; - cta::common::dataStructures::EntryLog lastModificationLog; + EntryLog creationLog; + EntryLog lastModificationLog; std::string comment; }; // struct StorageClass +std::ostream &operator<<(std::ostream &os, const StorageClass &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::StorageClass &obj); diff --git a/common/dataStructures/Tape.cpp b/common/dataStructures/Tape.cpp index ed7abfee386881df4aff61f7f130f90702dcfe67..4dd4e548b33b41e98e37ad680dbb01cad2146211 100644 --- a/common/dataStructures/Tape.cpp +++ b/common/dataStructures/Tape.cpp @@ -20,10 +20,14 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::Tape::Tape(): +Tape::Tape(): lastFSeq(0), capacityInBytes(0), dataOnTapeInBytes(0) {} @@ -31,7 +35,7 @@ cta::common::dataStructures::Tape::Tape(): //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::Tape::operator==(const Tape &rhs) const { +bool Tape::operator==(const Tape &rhs) const { return vid==rhs.vid && lastFSeq==rhs.lastFSeq && logicalLibraryName==rhs.logicalLibraryName @@ -54,14 +58,14 @@ bool cta::common::dataStructures::Tape::operator==(const Tape &rhs) const { //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::Tape::operator!=(const Tape &rhs) const { +bool Tape::operator!=(const Tape &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Tape &obj) { +std::ostream &operator<<(std::ostream &os, const Tape &obj) { os << "(vid=" << obj.vid << " lastFSeq=" << obj.lastFSeq << " logicalLibraryName=" << obj.logicalLibraryName @@ -82,3 +86,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ta return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/Tape.hpp b/common/dataStructures/Tape.hpp index 157f7b96e8fcc6478031c0ac7465b236bb2094a7..761970bb0d67faafdb3eb1a6fc30dc5bf2ccef4b 100644 --- a/common/dataStructures/Tape.hpp +++ b/common/dataStructures/Tape.hpp @@ -52,17 +52,17 @@ struct Tape { bool busy; bool full; bool disabled; - cta::common::dataStructures::EntryLog creationLog; - cta::common::dataStructures::EntryLog lastModificationLog; + EntryLog creationLog; + EntryLog lastModificationLog; std::string comment; - cta::common::dataStructures::TapeLog labelLog; - cta::common::dataStructures::TapeLog lastWriteLog; - cta::common::dataStructures::TapeLog lastReadLog; + TapeLog labelLog; + TapeLog lastWriteLog; + TapeLog lastReadLog; }; // struct Tape +std::ostream &operator<<(std::ostream &os, const Tape &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Tape &obj); diff --git a/common/dataStructures/TapeFile.cpp b/common/dataStructures/TapeFile.cpp index ac4433f0d4cd0cc3490431963a8b58765689421b..31ea7b56ae6e2c88bd4dc76a1beca03ad2f6320f 100644 --- a/common/dataStructures/TapeFile.cpp +++ b/common/dataStructures/TapeFile.cpp @@ -20,10 +20,14 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::TapeFile::TapeFile(): +TapeFile::TapeFile(): fSeq(0), blockId(0), compressedSize(0), @@ -33,7 +37,7 @@ cta::common::dataStructures::TapeFile::TapeFile(): //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::TapeFile::operator==(const TapeFile &rhs) const { +bool TapeFile::operator==(const TapeFile &rhs) const { return vid==rhs.vid && fSeq==rhs.fSeq && blockId==rhs.blockId @@ -45,14 +49,14 @@ bool cta::common::dataStructures::TapeFile::operator==(const TapeFile &rhs) cons //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::TapeFile::operator!=(const TapeFile &rhs) const { +bool TapeFile::operator!=(const TapeFile &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapeFile &obj) { +std::ostream &operator<<(std::ostream &os, const TapeFile &obj) { os << "(vid=" << obj.vid << " fSeq=" << obj.fSeq << " blockId=" << obj.blockId @@ -62,3 +66,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ta return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/TapeFile.hpp b/common/dataStructures/TapeFile.hpp index 03e2952c0a3652116db567da0769ed8c4b927ac4..7135b66747ea306be2fe974db4af78b69db486dc 100644 --- a/common/dataStructures/TapeFile.hpp +++ b/common/dataStructures/TapeFile.hpp @@ -70,8 +70,8 @@ struct TapeFile { }; // struct TapeFile +std::ostream &operator<<(std::ostream &os, const TapeFile &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapeFile &obj); diff --git a/common/dataStructures/TapeLog.cpp b/common/dataStructures/TapeLog.cpp index bf9bf1e3fc255d6bc2d0acbe6c77da9cee0fd432..2ff760037a7816deb30cf7b60e1150235e20be17 100644 --- a/common/dataStructures/TapeLog.cpp +++ b/common/dataStructures/TapeLog.cpp @@ -20,16 +20,20 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::TapeLog::TapeLog(): +TapeLog::TapeLog(): time(0) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::TapeLog::operator==(const TapeLog &rhs) const { +bool TapeLog::operator==(const TapeLog &rhs) const { return drive==rhs.drive && time==rhs.time; } @@ -37,16 +41,19 @@ bool cta::common::dataStructures::TapeLog::operator==(const TapeLog &rhs) const //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::TapeLog::operator!=(const TapeLog &rhs) const { +bool TapeLog::operator!=(const TapeLog &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapeLog &obj) { +std::ostream &operator<<(std::ostream &os, const TapeLog &obj) { os << "(drive=" << obj.drive << " time=" << obj.time << ")"; return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/TapeLog.hpp b/common/dataStructures/TapeLog.hpp index 64679a666a4a12e6ea9378f71249b70b69cc3850..fe37ecd6568e8358337610fc32bdc448bbd0a88d 100644 --- a/common/dataStructures/TapeLog.hpp +++ b/common/dataStructures/TapeLog.hpp @@ -45,8 +45,8 @@ struct TapeLog { }; // struct TapeLog +std::ostream &operator<<(std::ostream &os, const TapeLog &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapeLog &obj); diff --git a/common/dataStructures/TapePool.cpp b/common/dataStructures/TapePool.cpp index cc0ea284708e1f954b67d19442449b467abce676..83b0afbecfc43a28c9c4d15e7102750eccd1d2e9 100644 --- a/common/dataStructures/TapePool.cpp +++ b/common/dataStructures/TapePool.cpp @@ -20,16 +20,20 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::TapePool::TapePool(): +TapePool::TapePool(): nbPartialTapes(0) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::TapePool::operator==(const TapePool &rhs) const { +bool TapePool::operator==(const TapePool &rhs) const { return name==rhs.name && nbPartialTapes==rhs.nbPartialTapes && encryption==rhs.encryption @@ -41,14 +45,14 @@ bool cta::common::dataStructures::TapePool::operator==(const TapePool &rhs) cons //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::TapePool::operator!=(const TapePool &rhs) const { +bool TapePool::operator!=(const TapePool &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapePool &obj) { +std::ostream &operator<<(std::ostream &os, const TapePool &obj) { os << "(name=" << obj.name << " nbPartialTapes=" << obj.nbPartialTapes << " encryption=" << obj.encryption @@ -58,3 +62,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ta return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/TapePool.hpp b/common/dataStructures/TapePool.hpp index 253d6ca35cedde1de6a15c9bf0bd9518e4019104..f7f05be909786684a1037a46e927fce5629c81c4 100644 --- a/common/dataStructures/TapePool.hpp +++ b/common/dataStructures/TapePool.hpp @@ -44,14 +44,14 @@ struct TapePool { std::string name; uint64_t nbPartialTapes; bool encryption; - cta::common::dataStructures::EntryLog creationLog; - cta::common::dataStructures::EntryLog lastModificationLog; + EntryLog creationLog; + EntryLog lastModificationLog; std::string comment; }; // struct TapePool +std::ostream &operator<<(std::ostream &os, const TapePool &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapePool &obj); diff --git a/common/dataStructures/UpdateFileInfoRequest.cpp b/common/dataStructures/UpdateFileInfoRequest.cpp index 73ca4fd5aecef74eae053b1278f8816efa87ceed..2709cd0b3bca61f0dda526b62a279dba32274430 100644 --- a/common/dataStructures/UpdateFileInfoRequest.cpp +++ b/common/dataStructures/UpdateFileInfoRequest.cpp @@ -20,16 +20,20 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::UpdateFileInfoRequest::UpdateFileInfoRequest(): +UpdateFileInfoRequest::UpdateFileInfoRequest(): archiveFileID(0) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::UpdateFileInfoRequest::operator==(const UpdateFileInfoRequest &rhs) const { +bool UpdateFileInfoRequest::operator==(const UpdateFileInfoRequest &rhs) const { return archiveFileID==rhs.archiveFileID && drData==rhs.drData; } @@ -37,16 +41,19 @@ bool cta::common::dataStructures::UpdateFileInfoRequest::operator==(const Update //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::UpdateFileInfoRequest::operator!=(const UpdateFileInfoRequest &rhs) const { +bool UpdateFileInfoRequest::operator!=(const UpdateFileInfoRequest &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::UpdateFileInfoRequest &obj) { +std::ostream &operator<<(std::ostream &os, const UpdateFileInfoRequest &obj) { os << "(archiveFileID=" << obj.archiveFileID << " drData=" << obj.drData << ")"; return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/UpdateFileInfoRequest.hpp b/common/dataStructures/UpdateFileInfoRequest.hpp index 343a6e1c865ce50f597f179b3f292770fad53dcb..f5a86f093534394bc28da7b086ba665dddde9c27 100644 --- a/common/dataStructures/UpdateFileInfoRequest.hpp +++ b/common/dataStructures/UpdateFileInfoRequest.hpp @@ -42,12 +42,12 @@ struct UpdateFileInfoRequest { bool operator!=(const UpdateFileInfoRequest &rhs) const; uint64_t archiveFileID; - cta::common::dataStructures::DRData drData; + DRData drData; }; // struct UpdateFileInfoRequest +std::ostream &operator<<(std::ostream &os, const UpdateFileInfoRequest &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::UpdateFileInfoRequest &obj); diff --git a/common/dataStructures/UpdateFileStorageClassRequest.cpp b/common/dataStructures/UpdateFileStorageClassRequest.cpp index 278ec81de8534b97d1405a4f96859b3716b98f8c..a2c99f9b7b38eb474da5072daaa625f5cbb1d13a 100644 --- a/common/dataStructures/UpdateFileStorageClassRequest.cpp +++ b/common/dataStructures/UpdateFileStorageClassRequest.cpp @@ -20,16 +20,20 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::UpdateFileStorageClassRequest::UpdateFileStorageClassRequest(): +UpdateFileStorageClassRequest::UpdateFileStorageClassRequest(): archiveFileID(0) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::UpdateFileStorageClassRequest::operator==(const UpdateFileStorageClassRequest &rhs) const { +bool UpdateFileStorageClassRequest::operator==(const UpdateFileStorageClassRequest &rhs) const { return requester==rhs.requester && archiveFileID==rhs.archiveFileID && storageClass==rhs.storageClass @@ -39,14 +43,14 @@ bool cta::common::dataStructures::UpdateFileStorageClassRequest::operator==(cons //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::UpdateFileStorageClassRequest::operator!=(const UpdateFileStorageClassRequest &rhs) const { +bool UpdateFileStorageClassRequest::operator!=(const UpdateFileStorageClassRequest &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::UpdateFileStorageClassRequest &obj) { +std::ostream &operator<<(std::ostream &os, const UpdateFileStorageClassRequest &obj) { os << "(requester=" << obj.requester << " archiveFileID=" << obj.archiveFileID << " storageClass=" << obj.storageClass @@ -54,3 +58,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Up return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/UpdateFileStorageClassRequest.hpp b/common/dataStructures/UpdateFileStorageClassRequest.hpp index 8c312c0f0162945b3bc773b333e41f95f3343a59..e120ff27830dde5ee04bda37759250c93689cff4 100644 --- a/common/dataStructures/UpdateFileStorageClassRequest.hpp +++ b/common/dataStructures/UpdateFileStorageClassRequest.hpp @@ -42,15 +42,15 @@ struct UpdateFileStorageClassRequest { bool operator!=(const UpdateFileStorageClassRequest &rhs) const; - cta::common::dataStructures::UserIdentity requester; + UserIdentity requester; uint64_t archiveFileID; std::string storageClass; - cta::common::dataStructures::DRData drData; + DRData drData; }; // struct UpdateFileStorageClassRequest +std::ostream &operator<<(std::ostream &os, const UpdateFileStorageClassRequest &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::UpdateFileStorageClassRequest &obj); diff --git a/common/dataStructures/UserIdentity.cpp b/common/dataStructures/UserIdentity.cpp index bafdfd0296bb736705e09108fb8014c40e4c8d5c..e7838d1a690a3e0c46e33eb1356019c4adc9f9df 100644 --- a/common/dataStructures/UserIdentity.cpp +++ b/common/dataStructures/UserIdentity.cpp @@ -33,7 +33,8 @@ UserIdentity::UserIdentity() {} // operator== //------------------------------------------------------------------------------ bool UserIdentity::operator==(const UserIdentity &rhs) const { - return name==rhs.name && group==rhs.group; + return name==rhs.name + && group==rhs.group; } //------------------------------------------------------------------------------ @@ -48,11 +49,10 @@ bool UserIdentity::operator!=(const UserIdentity &rhs) const { //------------------------------------------------------------------------------ std::ostream &operator<<(std::ostream &os, const UserIdentity &obj) { os << "(name=" << obj.name - << " group=" << obj.group << ")"; + << " group=" << obj.group << ")"; return os; } } // namespace dataStructures } // namespace common } // namespace cta - diff --git a/common/dataStructures/UserIdentity.hpp b/common/dataStructures/UserIdentity.hpp index 12e831a47ff03ce5aee002aea8cdab67bfb2afff..2daa73a5252d06818e85d1438572b7de80c46c5f 100644 --- a/common/dataStructures/UserIdentity.hpp +++ b/common/dataStructures/UserIdentity.hpp @@ -18,7 +18,9 @@ #pragma once -#include <ostream> +#include <list> +#include <map> +#include <stdint.h> #include <string> @@ -42,7 +44,7 @@ struct UserIdentity { }; // struct UserIdentity -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::UserIdentity &obj); +std::ostream &operator<<(std::ostream &os, const UserIdentity &obj); } // namespace dataStructures } // namespace common diff --git a/common/dataStructures/VerifyInfo.cpp b/common/dataStructures/VerifyInfo.cpp index d5c76a52c539745858965e1f9a08efeb572d487a..1811ea42b72a90a1c469fb83b0df7382401d8f75 100644 --- a/common/dataStructures/VerifyInfo.cpp +++ b/common/dataStructures/VerifyInfo.cpp @@ -20,10 +20,14 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::VerifyInfo::VerifyInfo(): +VerifyInfo::VerifyInfo(): totalFiles(0), totalSize(0), filesToVerify(0), @@ -33,7 +37,7 @@ cta::common::dataStructures::VerifyInfo::VerifyInfo(): //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::VerifyInfo::operator==(const VerifyInfo &rhs) const { +bool VerifyInfo::operator==(const VerifyInfo &rhs) const { return vid==rhs.vid && tag==rhs.tag && totalFiles==rhs.totalFiles @@ -49,14 +53,14 @@ bool cta::common::dataStructures::VerifyInfo::operator==(const VerifyInfo &rhs) //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::VerifyInfo::operator!=(const VerifyInfo &rhs) const { +bool VerifyInfo::operator!=(const VerifyInfo &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::VerifyInfo &obj) { +std::ostream &operator<<(std::ostream &os, const VerifyInfo &obj) { os << "(vid=" << obj.vid << " tag=" << obj.tag << " totalFiles=" << obj.totalFiles @@ -70,3 +74,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Ve return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/VerifyInfo.hpp b/common/dataStructures/VerifyInfo.hpp index 005f049090533a8c4a09f0c50cb327afca125d16..57ec4e8d0233cfc5e50643549806a8f0a165fe2e 100644 --- a/common/dataStructures/VerifyInfo.hpp +++ b/common/dataStructures/VerifyInfo.hpp @@ -48,13 +48,13 @@ struct VerifyInfo { uint64_t filesFailed; uint64_t filesVerified; std::string verifyStatus; - cta::common::dataStructures::EntryLog creationLog; + EntryLog creationLog; std::map<uint64_t,std::string> errors; }; // struct VerifyInfo +std::ostream &operator<<(std::ostream &os, const VerifyInfo &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::VerifyInfo &obj); diff --git a/common/dataStructures/WriteTestResult.cpp b/common/dataStructures/WriteTestResult.cpp index c585fda634fcaf00ebe444382bb39a9ba7cae572..779ef3faf3e2d421dc165753743328aedf070956 100644 --- a/common/dataStructures/WriteTestResult.cpp +++ b/common/dataStructures/WriteTestResult.cpp @@ -20,10 +20,14 @@ #include "common/dataStructures/utils.hpp" #include "common/exception/Exception.hpp" +namespace cta { +namespace common { +namespace dataStructures { + //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::common::dataStructures::WriteTestResult::WriteTestResult(): +WriteTestResult::WriteTestResult(): noOfFilesWritten(0), totalBytesWritten(0), totalFilesWritten(0), @@ -32,7 +36,7 @@ cta::common::dataStructures::WriteTestResult::WriteTestResult(): //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ -bool cta::common::dataStructures::WriteTestResult::operator==(const WriteTestResult &rhs) const { +bool WriteTestResult::operator==(const WriteTestResult &rhs) const { return driveName==rhs.driveName && vid==rhs.vid && noOfFilesWritten==rhs.noOfFilesWritten @@ -46,14 +50,14 @@ bool cta::common::dataStructures::WriteTestResult::operator==(const WriteTestRes //------------------------------------------------------------------------------ // operator!= //------------------------------------------------------------------------------ -bool cta::common::dataStructures::WriteTestResult::operator!=(const WriteTestResult &rhs) const { +bool WriteTestResult::operator!=(const WriteTestResult &rhs) const { return !operator==(rhs); } //------------------------------------------------------------------------------ // operator<< //------------------------------------------------------------------------------ -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::WriteTestResult &obj) { +std::ostream &operator<<(std::ostream &os, const WriteTestResult &obj) { os << "(driveName=" << obj.driveName << " vid=" << obj.vid << " noOfFilesWritten=" << obj.noOfFilesWritten @@ -65,3 +69,6 @@ std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Wr return os; } +} // namespace dataStructures +} // namespace common +} // namespace cta diff --git a/common/dataStructures/WriteTestResult.hpp b/common/dataStructures/WriteTestResult.hpp index 79ce03213cd3a8025f31656fe08f651a7092c230..7bb0398907c2133ce32832a5e9032d868977c6ee 100644 --- a/common/dataStructures/WriteTestResult.hpp +++ b/common/dataStructures/WriteTestResult.hpp @@ -50,8 +50,8 @@ struct WriteTestResult { }; // struct WriteTestResult +std::ostream &operator<<(std::ostream &os, const WriteTestResult &obj); + } // namespace dataStructures } // namespace common } // namespace cta - -std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::WriteTestResult &obj); diff --git a/common/dataStructures/utils.cpp b/common/dataStructures/utils.cpp index 13e2474551b6fd7a5ea33c32c6d3c3e78bbc92e6..181052e7516292b76e1c2339e639f4ac355ecae9 100644 --- a/common/dataStructures/utils.cpp +++ b/common/dataStructures/utils.cpp @@ -18,7 +18,11 @@ #include "common/dataStructures/utils.hpp" -std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,cta::common::dataStructures::TapeFile> &map) { +namespace cta { +namespace common { +namespace dataStructures { + +std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,TapeFile> &map) { os << "("; for(auto it = map.begin(); it != map.end(); it++) { os << " key=" << it->first << " value=" << it->second << " "; @@ -50,11 +54,15 @@ std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::pair<std return os; } -std::ostream &operator<<(std::ostream &os, const std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFile>> &map) { +std::ostream &operator<<(std::ostream &os, const std::map<std::string,std::pair<uint64_t,TapeFile>> &map) { os << "("; for(auto it = map.begin(); it != map.end(); it++) { os << " key=" << it->first << " value.first=" << it->second.first << " value.second=" << it->second.second; } os << ")"; return os; -} \ No newline at end of file +} + +} // namespace dataStructures +} // namespace common +} // namespace cta \ No newline at end of file diff --git a/common/dataStructures/utils.hpp b/common/dataStructures/utils.hpp index b1a5f37f64722b9898a28f46b78c171ebeb4ae1f..b7fb7ea76e334129637c06007e192678b74102f4 100644 --- a/common/dataStructures/utils.hpp +++ b/common/dataStructures/utils.hpp @@ -23,9 +23,17 @@ #include <iostream> #include <map> -std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,cta::common::dataStructures::TapeFile> &map); +namespace cta { +namespace common { +namespace dataStructures { + +std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,TapeFile> &map); std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::string> &map); std::ostream &operator<<(std::ostream &os, const std::pair<std::string,std::string> &pair); std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::pair<std::string,std::string>> &map); -std::ostream &operator<<(std::ostream &os, const std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFile>> &map); -std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::pair<std::string,std::string>> &map); \ No newline at end of file +std::ostream &operator<<(std::ostream &os, const std::map<std::string,std::pair<uint64_t,TapeFile>> &map); +std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::pair<std::string,std::string>> &map); + +} // namespace dataStructures +} // namespace common +} // namespace cta \ No newline at end of file