From f14c24b15436413f1d030b7904a7ed0dfe897bd6 Mon Sep 17 00:00:00 2001 From: henricasanova Date: Mon, 27 Nov 2017 09:43:58 -1000 Subject: [PATCH] Documentation fixes Dead code removal --- .../services/compute/batch/BatchScheduler.h | 5 +++++ .../StandardJobExecutorProperty.h | 3 +++ include/wrench/services/helpers/Alarm.h | 4 ++++ include/wrench/util/PointerUtil.h | 10 +++++++++ .../services/compute/batch/BatchScheduler.cpp | 9 ++++++++ src/wrench/services/helpers/Alarm.cpp | 17 +++++++++++++++ src/wrench/util/PointerUtil.cpp | 21 +++++++------------ 7 files changed, 55 insertions(+), 14 deletions(-) diff --git a/include/wrench/services/compute/batch/BatchScheduler.h b/include/wrench/services/compute/batch/BatchScheduler.h index 1ce3f46679..10d92150c2 100644 --- a/include/wrench/services/compute/batch/BatchScheduler.h +++ b/include/wrench/services/compute/batch/BatchScheduler.h @@ -10,9 +10,14 @@ #include "BatchService.h" namespace wrench { + /***********************/ /** \cond INTERNAL */ /***********************/ + + /** + * @brief An implementation of a batch scheduling algorithm to be used in a BatchService + */ class BatchScheduler { public: BatchScheduler(); diff --git a/include/wrench/services/compute/standard_job_executor/StandardJobExecutorProperty.h b/include/wrench/services/compute/standard_job_executor/StandardJobExecutorProperty.h index f82a42b9b2..25054abaee 100644 --- a/include/wrench/services/compute/standard_job_executor/StandardJobExecutorProperty.h +++ b/include/wrench/services/compute/standard_job_executor/StandardJobExecutorProperty.h @@ -19,6 +19,9 @@ namespace wrench { /** \cond INTERNAL */ /***********************/ + /** + * @brief Properties for a StandardJobExecutor + */ class StandardJobExecutorProperty { public: diff --git a/include/wrench/services/helpers/Alarm.h b/include/wrench/services/helpers/Alarm.h index a28a75a4dd..a3b8d0475a 100644 --- a/include/wrench/services/helpers/Alarm.h +++ b/include/wrench/services/helpers/Alarm.h @@ -24,6 +24,10 @@ namespace wrench { /** \cond INTERNAL */ /***********************/ + /** + * @brief A daemon that sends a message to a mailbox after some specified amount of time and then terminates + */ + class Alarm: public Service { friend class S4U_Daemon; diff --git a/include/wrench/util/PointerUtil.h b/include/wrench/util/PointerUtil.h index a0536dff02..9abc2003d5 100644 --- a/include/wrench/util/PointerUtil.h +++ b/include/wrench/util/PointerUtil.h @@ -21,10 +21,20 @@ namespace wrench { /** \cond INTERNAL */ /***********************/ + /** + * @brief A helper class that implements useful smart pointer operations + */ class PointerUtil { public: + /** + * @brief A helper method to move a unique_ptr from a set to another + * @tparam T: template class + * @param ptr: unique pointer to an object of class T that's in a set + * @param from: pointer to the set in which the object is + * @param to: pointer to the set to which the object should be moved + */ template static void moveUniquePtrFromSetToSet( typename std::set>::iterator it, diff --git a/src/wrench/services/compute/batch/BatchScheduler.cpp b/src/wrench/services/compute/batch/BatchScheduler.cpp index 10684b4e46..53351f59ed 100644 --- a/src/wrench/services/compute/batch/BatchScheduler.cpp +++ b/src/wrench/services/compute/batch/BatchScheduler.cpp @@ -5,9 +5,18 @@ #include "wrench/services/compute/batch/BatchScheduler.h" namespace wrench{ + + /** + * @brief Constructor + */ BatchScheduler::BatchScheduler() { } + + /** + * @brief Schedule method + * @return + */ BatchJob* BatchScheduler::schedule_job() { //We currently only support FCFS // if(BatchService::); diff --git a/src/wrench/services/helpers/Alarm.cpp b/src/wrench/services/helpers/Alarm.cpp index 034d175e38..c499657136 100644 --- a/src/wrench/services/helpers/Alarm.cpp +++ b/src/wrench/services/helpers/Alarm.cpp @@ -21,6 +21,14 @@ namespace wrench { WRENCH_INFO("Alarm::~Alarm()::In the destructor of Alarm"); } + /** + * @brief Constructor + * @param date: the date at this the message should be sent + * @param hostname: the name of the host on which the Alarm daemon should run + * @param reply_mailbox_name: the mailbox to which the message should be sent + * @param msg: the message to send + * @param suffix: a (possibly empty) suffix to append to the daemon name + */ Alarm::Alarm(double date, std::string hostname, std::string reply_mailbox_name, SimulationMessage* msg, std::string suffix):Service("alarm_service_"+suffix,"alarm_service_"+suffix) { @@ -40,6 +48,11 @@ namespace wrench { } } + /** + * @brief Main method of the daemon + * + * @return 0 on termination + */ int Alarm::main() { TerminalOutput::setThisProcessLoggingColor(WRENCH_LOGGING_COLOR_MAGENTA); WRENCH_INFO("Alarm Service starting on host %s!", S4U_Simulation::getHostName().c_str()); @@ -61,6 +74,10 @@ namespace wrench { return 0; } + /** + * @brief Brutally kill the daemon + * + */ void Alarm::kill() { //kill itself this->kill_actor(); diff --git a/src/wrench/util/PointerUtil.cpp b/src/wrench/util/PointerUtil.cpp index 8a6a6db529..51e3eb5bc9 100644 --- a/src/wrench/util/PointerUtil.cpp +++ b/src/wrench/util/PointerUtil.cpp @@ -17,18 +17,14 @@ namespace wrench { /** \cond INTERNAL */ /***********************/ -// template -// void PointerUtil::moveUniquePtrFromSetToSet( -// typename std::set>::iterator it, -// std::set> *from, -// std::set> *to) { -// -// auto tmp = const_cast&&>(*it); -// (*from).erase(it); -// (*to).insert(std::move(tmp)); -// -// } + /** + * @brief An internal helper method to move a unique_ptr from a set to another + * @tparam T: template class + * @param ptr: unique pointer to an object of class T that's in a set + * @param from: pointer to the set in which the object is + * @param to: pointer to the set to which the object should be moved + */ template void PointerUtil::moveSingleSeparateUniquePtrFromSetToSet(std::unique_ptr* ptr, std::set> *from, @@ -38,9 +34,6 @@ namespace wrench { (*to).insert(std::move(tmp)); }; - template void PointerUtil::moveSingleSeparateUniquePtrFromSetToSet(std::unique_ptr *ptr, - std::set> *from, - std::set> *to); /***********************/ /** \endcond */