//===-- app/executionpolicies/AwaitAll.h ---------------------*- C++ -*-===//
//
//                                 The RoSA Framework
//
// Distributed under the terms and conditions of the Boost Software License 1.0.
// See accompanying file LICENSE.
//
// If you did not receive a copy of the license file, see
// http://www.boost.org/LICENSE_1_0.txt.
//
//===----------------------------------------------------------------------===//
///
/// \file app/executionpolicies/AwaitAll.h
///
/// \author David Juhasz (david.juhasz@tuwien.ac.at)
///
/// \date 2019-2020
///
/// \brief Declaration of the *execution policy* *await all*.
///
//===----------------------------------------------------------------------===//

#ifndef ROSA_LIB_APP_EXECUTIONPOLICIES_AWAITALL_H
#define ROSA_LIB_APP_EXECUTIONPOLICIES_AWAITALL_H

#include "AwaitBase.h"

namespace rosa {
namespace app {

/// Implementation of the *execution policy* *await all*.
///
/// \see \c rosa::app::AppExecutionPolicy::awaitAll()
class AwaitAll : public AwaitBase {
public:
  /// Constructor.
  ///
  /// The constructor instatiates \c rosa::app::AwaitBase so that execution
  /// is allowed when all *slave* positions included in \p S have received new
  /// input since the last triggering.
  ///
  /// \param S set of *slave* positoins to check
  AwaitAll(const std::set<size_t> &S);

  /// Dumps \p this object into textual representation.
  ///
  /// \return textual representation of \p this object
  std::string dump(void) const noexcept override;
};

} // End namespace app
} // End namespace rosa

#endif // ROSA_LIB_APP_EXECUTIONPOLICIES_AWAITALL_H
