Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix more Doxygen warnings.
[simgrid.git] / include / simgrid / kernel / future.hpp
index 581db40..e779c0a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@ public:
   FutureStateBase(FutureStateBase const&) = delete;
   FutureStateBase& operator=(FutureStateBase const&) = delete;
 
-  XBT_PUBLIC(void) schedule(simgrid::xbt::Task<void()>&& job);
+  XBT_PUBLIC void schedule(simgrid::xbt::Task<void()>&& job);
 
   void set_exception(std::exception_ptr exception)
   {
@@ -137,7 +137,7 @@ private:
  *  You are not expected to use them directly but to create them
  *  implicitely through a @ref simgrid::kernel::Promise.
  *  Alternatively kernel operations could inherit or contain FutureState
- *  if they are managed with @ref std::shared_ptr.
+ *  if they are managed with std::shared_ptr.
  **/
 template<class T>
 class FutureState : public FutureStateBase {
@@ -181,7 +181,7 @@ public:
     xbt_assert(this->value_);
     T* result = value_;
     value_ = nullptr;
-    return *value_;
+    return *result;
   }
 
 private:
@@ -207,7 +207,7 @@ public:
 template<class T>
 void bindPromise(Promise<T> promise, Future<T> future)
 {
-  struct PromiseBinder {
+  class PromiseBinder {
   public:
     explicit PromiseBinder(Promise<T> promise) : promise_(std::move(promise)) {}
     void operator()(Future<T> future)
@@ -261,7 +261,7 @@ template<class T> Future<T> unwrapFuture(Future<Future<T>> future);
  *  );
  *  </pre>
  *
- *  This is based on C++1z @ref std::future but with some differences:
+ *  This is based on C++1z std::future but with some differences:
  *
  *  * there is no thread synchronization (atomic, mutex, condition variable,
  *    etc.) because everything happens in the SimGrid event loop;
@@ -390,7 +390,7 @@ public:
   /** Get the value from the future
    *
    *  The future must be valid and ready in order to make this call.
-   *  @ref std::future blocks when the future is not ready but we are
+   *  std::future blocks when the future is not ready but we are
    *  completely single-threaded so blocking would be a deadlock.
    *  After the call, the future becomes invalid.
    *
@@ -424,7 +424,7 @@ Future<T> unwrapFuture(Future<Future<T>> future)
  *  A @ref Promise is connected to some `Future` and can be used to
  *  set its result.
  *
- *  Similar to @ref std::promise
+ *  Similar to std::promise
  *
  *  <code>
  *  // Create a promise and a future:
@@ -454,7 +454,7 @@ Future<T> unwrapFuture(Future<Future<T>> future)
 template<class T>
 class Promise {
 public:
-  explicit Promise() : state_(std::make_shared<FutureState<T>>()) {}
+  Promise() : state_(std::make_shared<FutureState<T>>()) {}
   explicit Promise(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
 
   // Move type
@@ -510,7 +510,7 @@ template<>
 class Promise<void> {
 public:
   Promise() : state_(std::make_shared<FutureState<void>>()) {}
-  Promise(std::shared_ptr<FutureState<void>> state) : state_(std::move(state)) {}
+  explicit Promise(std::shared_ptr<FutureState<void>> state) : state_(std::move(state)) {}
   ~Promise()
   {
     if (state_ && state_->get_status() == FutureStatus::not_ready)