Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
shamrock::patch::PatchDataLayerLayout Class Reference

Public Member Functions

template<class T >
void add_field (const std::string &field_name, u32 nvar, SourceLocation loc=SourceLocation{})
 add a field of type T to the layout
 
template<class T >
FieldDescriptor< T > get_field (const std::string &field_name)
 Get the field description id if matching name & type.
 
template<class T >
FieldDescriptor< T > get_field (u32 idx)
 Get the field description at given index.
 
template<class T >
u32 get_field_idx (const std::string &field_name) const
 Get the field id if matching name & type.
 
template<class T >
u32 get_field_idx (const std::string &field_name, u32 nvar) const
 Get the field id if matching name & type & nvar.
 
template<class T >
bool check_field_type (u32 idx)
 check that field of id @idx is of type T
 
template<class T >
bool check_main_field_type ()
 check that main field (id=0)is of type T
 
const var_tget_main_field_any () const
 Get the main field description as a variant object.
 
std::string get_description_str () const
 Get the description of the layout.
 
std::vector< std::string > get_field_names ()
 Get the list of field names.
 
template<class Functor >
void for_each_field_any (Functor &&func) const
 for each visit of each field
 
void add_field_t (std::string fname, u32 nvar, std::string type)
 Add a field with type specified as a string.
 

Friends

bool operator== (const PatchDataLayerLayout &lhs, const PatchDataLayerLayout &rhs)
 Overloaded equality operator for PatchDataLayerLayout class.
 

Detailed Description

Definition at line 66 of file PatchDataLayerLayout.hpp.

Member Function Documentation

◆ add_field()

template<class T >
void shamrock::patch::PatchDataLayerLayout::add_field ( const std::string &  field_name,
u32  nvar,
SourceLocation  loc = SourceLocation{} 
)
inline

add a field of type T to the layout

Template Parameters
Ttype of the field
Parameters
field_namefield name
nvarnumber of varaible per object

Definition at line 292 of file PatchDataLayerLayout.hpp.

+ Here is the call graph for this function:

◆ add_field_t()

void shamrock::patch::PatchDataLayerLayout::add_field_t ( std::string  fname,
u32  nvar,
std::string  type 
)
inline

Add a field with type specified as a string.

Parameters
fnamethe name of the field
nvarthe number of variables
typethe type of the field as a string

Definition at line 195 of file PatchDataLayerLayout.hpp.

+ Here is the call graph for this function:

◆ check_field_type()

template<class T >
bool shamrock::patch::PatchDataLayerLayout::check_field_type ( u32  idx)
inline

check that field of id @idx is of type T

Template Parameters
T
Parameters
idx
Returns
true
false

Definition at line 383 of file PatchDataLayerLayout.hpp.

◆ check_main_field_type()

template<class T >
bool shamrock::patch::PatchDataLayerLayout::check_main_field_type ( )
inline

check that main field (id=0)is of type T

Template Parameters
T
Returns
true
false

Definition at line 148 of file PatchDataLayerLayout.hpp.

◆ for_each_field_any()

template<class Functor >
void shamrock::patch::PatchDataLayerLayout::for_each_field_any ( Functor &&  func) const
inline

for each visit of each field

Template Parameters
Functorthe signature of the lambda must be : [?](auto & arg){...}
Parameters
func

Definition at line 180 of file PatchDataLayerLayout.hpp.

◆ get_description_str()

std::string shamrock::patch::PatchDataLayerLayout::get_description_str ( ) const

Get the description of the layout.

Returns
std::string

Definition at line 20 of file PatchDataLayerLayout.cpp.

◆ get_field() [1/2]

template<class T >
PatchDataLayerLayout::FieldDescriptor< T > shamrock::patch::PatchDataLayerLayout::get_field ( const std::string &  field_name)
inline

Get the field description id if matching name & type.

Template Parameters
T
Parameters
field_name
Returns
FieldDescriptor<T>

Definition at line 321 of file PatchDataLayerLayout.hpp.

+ Here is the call graph for this function:

◆ get_field() [2/2]

template<class T >
PatchDataLayerLayout::FieldDescriptor< T > shamrock::patch::PatchDataLayerLayout::get_field ( u32  idx)
inline

Get the field description at given index.

Template Parameters
T
Parameters
idx
Returns
FieldDescriptor<T>

Definition at line 337 of file PatchDataLayerLayout.hpp.

+ Here is the call graph for this function:

◆ get_field_idx() [1/2]

template<class T >
u32 shamrock::patch::PatchDataLayerLayout::get_field_idx ( const std::string &  field_name) const
inline

Get the field id if matching name & type.

Template Parameters
T
Parameters
field_name
Returns
u32

Definition at line 349 of file PatchDataLayerLayout.hpp.

+ Here is the call graph for this function:

◆ get_field_idx() [2/2]

template<class T >
u32 shamrock::patch::PatchDataLayerLayout::get_field_idx ( const std::string &  field_name,
u32  nvar 
) const
inline

Get the field id if matching name & type & nvar.

Template Parameters
T
Parameters
field_name
nvar
Returns
u32

Definition at line 368 of file PatchDataLayerLayout.hpp.

+ Here is the call graph for this function:

◆ get_field_names()

std::vector< std::string > shamrock::patch::PatchDataLayerLayout::get_field_names ( )

Get the list of field names.

Returns
std::vector<std::string>

Definition at line 83 of file PatchDataLayerLayout.cpp.

◆ get_main_field_any()

const var_t & shamrock::patch::PatchDataLayerLayout::get_main_field_any ( ) const
inline

Get the main field description as a variant object.

Returns
const var_t& the variant field description

Definition at line 157 of file PatchDataLayerLayout.hpp.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const PatchDataLayerLayout lhs,
const PatchDataLayerLayout rhs 
)
friend

Overloaded equality operator for PatchDataLayerLayout class.

This operator is used to check if two PatchDataLayerLayout objects are equal. It compares the fields of the objects and returns true if they are equal, and false otherwise.

Parameters
lhsThe first PatchDataLayerLayout object to compare
rhsThe second PatchDataLayerLayout object to compare
Returns
true if the two objects are equal, false otherwise

Definition at line 163 of file PatchDataLayerLayout.cpp.


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