DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::ArrayLayout< T, _row_size, _row_max, _align > Class Template Reference

Compile-time layout descriptor deducing the concrete DataLayout from element type and row-size template arguments. More...

#include <ArrayBasic.hpp>

Inheritance diagram for DNDS::ArrayLayout< T, _row_size, _row_max, _align >:
[legend]

Public Types

using value_type = T
 

Static Public Member Functions

static constexpr DataLayout _GetDataLayout ()
 Deduce the DataLayout tag from the template parameters.
 
static std::string GetArrayName ()
 Human-readable type identifier including element typeid, sizes, and alignment.
 
static std::string GetArraySignature ()
 Compiler-independent identifier used by serializers to tag an array.
 
static std::string GetArraySignatureRelaxed ()
 Signature with _row_size / _row_max replaced by DynamicSize.
 
static std::tuple< int, int, int, int > ParseArraySignatureTuple (const std::string &v)
 Parse a signature string into (sizeof_T, row_size, row_max, align).
 
static bool ArraySignatureIsCompatible (const std::string &v)
 Whether a stored signature can be read into this array type.
 

Static Public Attributes

static const rowsize al = _align
 
static const rowsize rs = _row_size
 
static const rowsize rm = _row_max
 
static const size_t sizeof_T = sizeof(value_type)
 
static const rowsize s_T = al == NoAlign ? sizeof_T : (sizeof_T / al + 1) * al
 
static const DataLayout _dataLayout = _GetDataLayout()
 
static const bool isCSR = _dataLayout == CSR
 

Detailed Description

template<class T, rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
class DNDS::ArrayLayout< T, _row_size, _row_max, _align >

Compile-time layout descriptor deducing the concrete DataLayout from element type and row-size template arguments.

Serves as a base class for Array / ArrayView and as a static namespace of helpers (signature strings, compatibility checks). Carries no runtime state of its own.

Template Parameters
TElement type.
_row_sizeRow size (>=0 / DynamicSize / NonUniformSize).
_row_maxRow max (>=0 / DynamicSize / NonUniformSize; only used when _row_size == NonUniformSize).
_alignAlignment hint (currently only NoAlign implemented).

Definition at line 78 of file ArrayBasic.hpp.

Member Typedef Documentation

◆ value_type

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
using DNDS::ArrayLayout< T, _row_size, _row_max, _align >::value_type = T

Definition at line 81 of file ArrayBasic.hpp.

Member Function Documentation

◆ _GetDataLayout()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
static constexpr DataLayout DNDS::ArrayLayout< T, _row_size, _row_max, _align >::_GetDataLayout ( )
inlinestaticconstexpr

Deduce the DataLayout tag from the template parameters.

Definition at line 100 of file ArrayBasic.hpp.

◆ ArraySignatureIsCompatible()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
static bool DNDS::ArrayLayout< T, _row_size, _row_max, _align >::ArraySignatureIsCompatible ( const std::string &  v)
inlinestatic

Whether a stored signature can be read into this array type.

Requires matching sizeof(T) and compatible row-size constants: fixed row sizes must be equal when both sides declare them.

Definition at line 209 of file ArrayBasic.hpp.

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

◆ GetArrayName()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
static std::string DNDS::ArrayLayout< T, _row_size, _row_max, _align >::GetArrayName ( )
inlinestatic

Human-readable type identifier including element typeid, sizes, and alignment.

Format: "<Layout>__<typeid>_<sizeof_T>_<rs>_<rm>_<al>". Primarily for debugging / error messages. Not stable across compilers (uses typeid(T).name()); use GetArraySignature for persisted data.

Definition at line 128 of file ArrayBasic.hpp.

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

◆ GetArraySignature()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
static std::string DNDS::ArrayLayout< T, _row_size, _row_max, _align >::GetArraySignature ( )
inlinestatic

Compiler-independent identifier used by serializers to tag an array.

Format: "<Layout>__<sizeof_T>_<rs>_<rm>_<al>", where template parameters are encoded numerically (so -1 = DynamicSize, -2 = NonUniformSize). Stable across compilers; used for compatibility checks during serialized restart.

Definition at line 152 of file ArrayBasic.hpp.

Here is the caller graph for this function:

◆ GetArraySignatureRelaxed()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
static std::string DNDS::ArrayLayout< T, _row_size, _row_max, _align >::GetArraySignatureRelaxed ( )
inlinestatic

Signature with _row_size / _row_max replaced by DynamicSize.

Used when we want two arrays to match regardless of compile-time row-size constants (e.g., compare a DynamicSize reader against a fixed-size writer file).

Definition at line 175 of file ArrayBasic.hpp.

◆ ParseArraySignatureTuple()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
static std::tuple< int, int, int, int > DNDS::ArrayLayout< T, _row_size, _row_max, _align >::ParseArraySignatureTuple ( const std::string &  v)
inlinestatic

Parse a signature string into (sizeof_T, row_size, row_max, align).

Accepts both GetArrayName (6 components incl. typeid) and GetArraySignature (5 components) forms; returns the last 4 fields.

Definition at line 198 of file ArrayBasic.hpp.

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

Member Data Documentation

◆ _dataLayout

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const DataLayout DNDS::ArrayLayout< T, _row_size, _row_max, _align >::_dataLayout = _GetDataLayout()
static

Definition at line 120 of file ArrayBasic.hpp.

◆ al

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const rowsize DNDS::ArrayLayout< T, _row_size, _row_max, _align >::al = _align
static

Definition at line 82 of file ArrayBasic.hpp.

◆ isCSR

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const bool DNDS::ArrayLayout< T, _row_size, _row_max, _align >::isCSR = _dataLayout == CSR
static

Definition at line 122 of file ArrayBasic.hpp.

◆ rm

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const rowsize DNDS::ArrayLayout< T, _row_size, _row_max, _align >::rm = _row_max
static

Definition at line 84 of file ArrayBasic.hpp.

◆ rs

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const rowsize DNDS::ArrayLayout< T, _row_size, _row_max, _align >::rs = _row_size
static

Definition at line 83 of file ArrayBasic.hpp.

◆ s_T

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const rowsize DNDS::ArrayLayout< T, _row_size, _row_max, _align >::s_T = al == NoAlign ? sizeof_T : (sizeof_T / al + 1) * al
static

Definition at line 96 of file ArrayBasic.hpp.

◆ sizeof_T

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const size_t DNDS::ArrayLayout< T, _row_size, _row_max, _align >::sizeof_T = sizeof(value_type)
static

Definition at line 86 of file ArrayBasic.hpp.


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