SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/Actions - GetItemFromDistributedObject.hpp Hit Total Coverage
Commit: a8efe75339f4781ca06d43fed14c40144d5e8a08 Lines: 1 4 25.0 %
Date: 2024-10-17 21:19:21
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 <memory>
       7             : 
       8             : #include "DataStructures/DataBox/DataBox.hpp"
       9             : #include "Parallel/NodeLock.hpp"
      10             : 
      11             : namespace Parallel::Actions {
      12             : /*!
      13             :  * \brief A local synchronous action that returns a pointer to the item
      14             :  * specified by the tag.
      15             :  *
      16             :  * The action uses `db::get_mutable_reference` to avoid DataBox locking
      17             :  * interference. However, this means that thread safety with respect to the
      18             :  * retrieved tag must be ensured by the user.
      19             :  */
      20             : template <typename Tag>
      21           1 : struct GetItemFromDistributedOject {
      22           0 :   using return_type = typename Tag::type*;
      23             : 
      24             :   template <typename ParallelComponent, typename DbTagList>
      25           0 :   static return_type apply(
      26             :       db::DataBox<DbTagList>& box,
      27             :       const gsl::not_null<Parallel::NodeLock*> /*node_lock*/) {
      28             :     return std::addressof(db::get_mutable_reference<Tag>(make_not_null(&box)));
      29             :   }
      30             : };
      31             : }  // namespace Parallel::Actions

Generated by: LCOV version 1.14