SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/EventsAndTriggers - Trigger.hpp Hit Total Coverage
Commit: d07bc7e978f0161d6eb259d687cd7878b5f9f6f0 Lines: 2 8 25.0 %
Date: 2020-09-24 02:51:00
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 "Utilities/FakeVirtual.hpp"
       9             : #include "Utilities/Registration.hpp"
      10             : #include "Utilities/TMPL.hpp"
      11             : 
      12             : /// \cond
      13             : namespace Triggers {
      14             : template <typename TriggerRegistrars>
      15             : class Always;
      16             : template <typename TriggerRegistrars>
      17             : class And;
      18             : template <typename TriggerRegistrars>
      19             : class Not;
      20             : template <typename TriggerRegistrars>
      21             : class Or;
      22             : }  // namespace Triggers
      23             : /// \endcond
      24             : 
      25             : /// \ingroup EventsAndTriggersGroup
      26             : namespace Triggers {
      27             : /// Registrars for Triggers
      28           1 : namespace Registrars {}
      29             : }  // namespace Triggers
      30             : 
      31             : /// \ingroup EventsAndTriggersGroup
      32             : /// Base class for checking whether to run an Event.
      33             : template <typename TriggerRegistrars>
      34           1 : class Trigger : public PUP::able {
      35             :  protected:
      36             :   /// \cond
      37             :   Trigger() = default;
      38             :   Trigger(const Trigger&) = default;
      39             :   Trigger(Trigger&&) = default;
      40             :   Trigger& operator=(const Trigger&) = default;
      41             :   Trigger& operator=(Trigger&&) = default;
      42             :   /// \endcond
      43             : 
      44             :  public:
      45           0 :   ~Trigger() override = default;
      46             : 
      47           0 :   WRAPPED_PUPable_abstract(Trigger);  // NOLINT
      48             : 
      49           0 :   using default_triggers = tmpl::list<
      50             :       Triggers::Always<TriggerRegistrars>, Triggers::And<TriggerRegistrars>,
      51             :       Triggers::Not<TriggerRegistrars>, Triggers::Or<TriggerRegistrars>>;
      52             : 
      53           0 :   using creatable_classes =
      54             :       tmpl::append<default_triggers,
      55             :                    Registration::registrants<TriggerRegistrars>>;
      56             : 
      57             :   template <typename DbTags>
      58           0 :   bool is_triggered(const db::DataBox<DbTags>& box) noexcept {
      59             :     return call_with_dynamic_type<bool, creatable_classes>(
      60             :         this, [&box](auto* const trigger) noexcept {
      61             :           return db::apply(*trigger, box);
      62             :         });
      63             :   }
      64             : };
      65             : 
      66             : #include "ParallelAlgorithms/EventsAndTriggers/LogicalTriggers.hpp"

Generated by: LCOV version 1.14