Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
Dead code removal
  • Loading branch information
henricasanova committed Nov 27, 2017
1 parent 164002d commit f14c24b
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 14 deletions.
5 changes: 5 additions & 0 deletions include/wrench/services/compute/batch/BatchScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ namespace wrench {
/** \cond INTERNAL */
/***********************/

/**
* @brief Properties for a StandardJobExecutor
*/
class StandardJobExecutorProperty {

public:
Expand Down
4 changes: 4 additions & 0 deletions include/wrench/services/helpers/Alarm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions include/wrench/util/PointerUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<class T>
static void moveUniquePtrFromSetToSet(
typename std::set<std::unique_ptr<T>>::iterator it,
Expand Down
9 changes: 9 additions & 0 deletions src/wrench/services/compute/batch/BatchScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::);
Expand Down
17 changes: 17 additions & 0 deletions src/wrench/services/helpers/Alarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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());
Expand All @@ -61,6 +74,10 @@ namespace wrench {
return 0;
}

/**
* @brief Brutally kill the daemon
*
*/
void Alarm::kill() {
//kill itself
this->kill_actor();
Expand Down
21 changes: 7 additions & 14 deletions src/wrench/util/PointerUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ namespace wrench {
/** \cond INTERNAL */
/***********************/

// template <class T>
// void PointerUtil::moveUniquePtrFromSetToSet(
// typename std::set<std::unique_ptr<T>>::iterator it,
// std::set<std::unique_ptr<T>> *from,
// std::set<std::unique_ptr<T>> *to) {
//
// auto tmp = const_cast<std::unique_ptr<T>&&>(*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 <class T>
void PointerUtil::moveSingleSeparateUniquePtrFromSetToSet(std::unique_ptr<T>* ptr,
std::set<std::unique_ptr<T>> *from,
Expand All @@ -38,9 +34,6 @@ namespace wrench {
(*to).insert(std::move(tmp));
};

template void PointerUtil::moveSingleSeparateUniquePtrFromSetToSet<StandardJobExecutor>(std::unique_ptr<StandardJobExecutor> *ptr,
std::set<std::unique_ptr<StandardJobExecutor>> *from,
std::set<std::unique_ptr<StandardJobExecutor>> *to);

/***********************/
/** \endcond */
Expand Down

0 comments on commit f14c24b

Please sign in to comment.