OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::GroupedDataCommunicatable< DATA, GROUPS > Class Template Reference

#include <fieldArrayD.h>

+ Collaboration diagram for olb::GroupedDataCommunicatable< DATA, GROUPS >:

Public Member Functions

 GroupedDataCommunicatable (DATA &data)
 
std::size_t size (ConstSpan< CellID > indices) const
 Get serialized size for data at locations indices
 
std::size_t serialize (ConstSpan< CellID > indices, std::uint8_t *buffer) const
 Serialize data at locations indices to buffer
 
std::size_t deserialize (ConstSpan< CellID > indices, const std::uint8_t *buffer)
 Deserialize data at locations indices to buffer
 

Detailed Description

template<typename DATA, typename... GROUPS>
class olb::GroupedDataCommunicatable< DATA, GROUPS >

Definition at line 568 of file fieldArrayD.h.

Constructor & Destructor Documentation

◆ GroupedDataCommunicatable()

template<typename DATA , typename... GROUPS>
olb::GroupedDataCommunicatable< DATA, GROUPS >::GroupedDataCommunicatable ( DATA & data)
inline

Definition at line 573 of file fieldArrayD.h.

574 : _data(data) {}

Member Function Documentation

◆ deserialize()

template<typename DATA , typename... GROUPS>
std::size_t olb::GroupedDataCommunicatable< DATA, GROUPS >::deserialize ( ConstSpan< CellID > indices,
const std::uint8_t * buffer )
inline

Deserialize data at locations indices to buffer

Definition at line 603 of file fieldArrayD.h.

604 {
605 const std::uint8_t* curr = buffer;
606 meta::list<GROUPS...>::for_each([&](auto group) {
607 using GROUP = typename decltype(group)::type;
608 // Workaround for Clang argument deduction bug
609 auto communicatable = ConcreteCommunicatable(_data.template get<GROUP>());
610 curr += communicatable.deserialize(indices, curr);
611 });
612 return curr - buffer;
613 }
static constexpr void for_each(F f)
Calls f for each type of TYPES by-value (in reversed order!)
Definition meta.h:331

References olb::meta::list< TYPES >::for_each().

+ Here is the call graph for this function:

◆ serialize()

template<typename DATA , typename... GROUPS>
std::size_t olb::GroupedDataCommunicatable< DATA, GROUPS >::serialize ( ConstSpan< CellID > indices,
std::uint8_t * buffer ) const
inline

Serialize data at locations indices to buffer

Definition at line 590 of file fieldArrayD.h.

591 {
592 std::uint8_t* curr = buffer;
593 meta::list<GROUPS...>::for_each([&](auto group) {
594 using GROUP = typename decltype(group)::type;
595 // Workaround for Clang argument deduction bug
596 auto communicatable = ConcreteCommunicatable(_data.template get<GROUP>());
597 curr += communicatable.serialize(indices, curr);
598 });
599 return curr - buffer;
600 }

References olb::meta::list< TYPES >::for_each().

+ Here is the call graph for this function:

◆ size()

template<typename DATA , typename... GROUPS>
std::size_t olb::GroupedDataCommunicatable< DATA, GROUPS >::size ( ConstSpan< CellID > indices) const
inline

Get serialized size for data at locations indices

Definition at line 577 of file fieldArrayD.h.

578 {
579 std::size_t size = 0;
580 meta::list<GROUPS...>::for_each([&](auto group) {
581 using GROUP = typename decltype(group)::type;
582 // Workaround for Clang argument deduction bug
583 auto communicatable = ConcreteCommunicatable(_data.template get<GROUP>());
584 size += communicatable.size(indices);
585 });
586 return size;
587 }
std::size_t size(ConstSpan< CellID > indices) const
Get serialized size for data at locations indices

References olb::meta::list< TYPES >::for_each(), and olb::GroupedDataCommunicatable< DATA, GROUPS >::size().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: