Skip to content

Commit

Permalink
files: block headers
Browse files Browse the repository at this point in the history
  • Loading branch information
skim0119 committed Jul 13, 2024
1 parent e182636 commit 1bfb5d4
Show file tree
Hide file tree
Showing 20 changed files with 6,479 additions and 0 deletions.
80 changes: 80 additions & 0 deletions backend/src/Systems/Block/Block/Aliases.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#pragma once

namespace blocks {

//============================================================================
//
// ALIAS DECLARATIONS
//
//============================================================================

//****************************************************************************
/*!\brief Gets the nested `Variables` from `T`
* \ingroup block_tt
*
* The variables_t alias declaration provides a convenient
* shortcut to access the nested `Variables` type definition of
* the given type \a T. The following code example shows both ways to access
* the nested type definition:
*
* \example
* \code
* using Type1 = typename T::Variables;
* using Type2 = variables_t<T>;
* \endcode
*
* \see Block, BlockSlice
*/
// [variables_t]
template <typename T>
using variables_t = typename T::Variables;
// [variables_t]
//****************************************************************************

//****************************************************************************
/*!\brief Gets the nested `InitializedVariables` from `T`
* \ingroup block_tt
*
* The initialized_variables_t alias declaration provides a convenient
* shortcut to access the nested `InitializedVariables` type definition of
* the given type \a T. The following code example shows both ways to access
* the nested type definition:
*
* \example
* \code
* using Type1 = typename T::InitializedVariables;
* using Type2 = initialized_variables_t<T>;
* \endcode
*
* \see Block, BlockSlice
*/
// [initialized_variables_t]
template <typename T>
using initialized_variables_t = typename T::InitializedVariables;
// [initialized_variables_t]
//****************************************************************************

//****************************************************************************
/*!\brief Gets the nested `ComputedVariables` from `T`
* \ingroup block_tt
*
* The computed_variables_t alias declaration provides a convenient
* shortcut to access the nested `ComputedVariables` type definition of
* the given type \a T. The following code example shows both ways to access
* the nested type definition:
*
* \example
* \code
* using Type1 = typename T::ComputedVariables;
* using Type2 = computed_variables_t<T>;
* \endcode
*
* \see Block, BlockSlice
*/
// [computed_variables_t]
template <typename T>
using computed_variables_t = typename T::ComputedVariables;
// [computed_variables_t]
//****************************************************************************

} // namespace blocks
39 changes: 39 additions & 0 deletions backend/src/Systems/Block/Block/AsVariables.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once

//******************************************************************************
// Includes
//******************************************************************************

#include "Utilities/AsTaggedTuple.hpp"

namespace blocks {

//****************************************************************************
/*!\brief Metafunction to define storage a typelist of block variables
* \ingroup blocks
*
* \details
* The as_block_variables template type helps obtain the heterogeneous
* variable storage container from a typelist of declared blocks::Variable,
* used as shown below.
*
* \example
* \code
* // ... Declare variables Var1, Var2, Var3
*
* // TypeList of all variables
* using VariablesList = tmpl::list<Var1, Var2, Var3>;
*
* // Convert into a storage type which has value semantics
* using BlockVariables = as_block_variables<VariablesList>;
* \endcode
*
* \tparam L typelist of block::Variables
*
* \see blocks::Variables, Block
*/
template <typename L>
using as_block_variables = tmpl::as_tagged_tuple<L>;
//****************************************************************************

} // namespace blocks
Loading

0 comments on commit 1bfb5d4

Please sign in to comment.