SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/EventsAndTriggers - Trigger.hpp Hit Total Coverage
Commit: a48770a280d0d66bc04cb5df30de1e3cc4985437 Lines: 1 5 20.0 %
Date: 2021-06-17 20:55:50
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include "DataStructures/DataBox/DataBox.hpp"
       7             : #include "Parallel/CharmPupable.hpp"
       8             : #include "Parallel/Tags/Metavariables.hpp"
       9             : #include "Utilities/FakeVirtual.hpp"
      10             : #include "Utilities/TMPL.hpp"
      11             : 
      12             : /// \ingroup EventsAndTriggersGroup
      13             : namespace Triggers {}
      14             : 
      15             : /// \ingroup EventsAndTriggersGroup
      16             : /// Base class for checking whether to run an Event.
      17           1 : class Trigger : public PUP::able {
      18             :  protected:
      19             :   /// \cond
      20             :   Trigger() = default;
      21             :   Trigger(const Trigger&) = default;
      22             :   Trigger(Trigger&&) = default;
      23             :   Trigger& operator=(const Trigger&) = default;
      24             :   Trigger& operator=(Trigger&&) = default;
      25             :   /// \endcond
      26             : 
      27             :  public:
      28           0 :   ~Trigger() override = default;
      29             : 
      30           0 :   WRAPPED_PUPable_abstract(Trigger);  // NOLINT
      31             : 
      32             :   template <typename DbTags>
      33           0 :   bool is_triggered(const db::DataBox<DbTags>& box) noexcept {
      34             :     using factory_classes =
      35             :         typename std::decay_t<decltype(db::get<Parallel::Tags::Metavariables>(
      36             :             box))>::factory_creation::factory_classes;
      37             :     return call_with_dynamic_type<bool, tmpl::at<factory_classes, Trigger>>(
      38             :         this, [&box](auto* const trigger) noexcept {
      39             :           return db::apply(*trigger, box);
      40             :         });
      41             :   }
      42             : };

Generated by: LCOV version 1.14