Low-Level Abstraction of Memory Access
Core.hpp File Reference
#include "ArrayExtents.hpp"
#include "Meta.hpp"
#include "RecordCoord.hpp"
#include <string>
#include <type_traits>
+ Include dependency graph for Core.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llama::NoName
 Anonymous naming for a Field. More...
 
struct  llama::Field< Tag, Type >
 
struct  llama::Record< Fields >
 A type list of Fields which may be used to define a record dimension. More...
 
struct  llama::NrAndOffset< T >
 
struct  llama::internal::GetTagsImpl< Record< Fields... >, RecordCoord< FirstCoord, Coords... > >
 
struct  llama::internal::GetTagsImpl< ChildType[Count], RecordCoord< FirstCoord, Coords... > >
 
struct  llama::internal::GetTagsImpl< T, RecordCoord<> >
 
struct  llama::internal::GetTagImpl< RecordDim, RecordCoord >
 
struct  llama::internal::GetTagImpl< RecordDim, RecordCoord<> >
 
struct  llama::internal::FindFieldByTag< FieldList, Tag >
 
struct  llama::internal::GetCoordFromTagsImpl< RecordDim, RecordCoord, Tags >
 
struct  llama::internal::GetCoordFromTagsImpl< Record< Fields... >, RecordCoord< ResultCoords... >, FirstTag, Tags... >
 
struct  llama::internal::GetCoordFromTagsImpl< ChildType[Count], RecordCoord< ResultCoords... >, FirstTag, Tags... >
 
struct  llama::internal::GetCoordFromTagsImpl< RecordDim, RecordCoord >
 
struct  llama::internal::GetCoordFromTagsImpl< Record< Fields... >, RecordCoord<>, mp_list< Tags... > >
 
struct  llama::internal::GetCoordFromTagsImpl< ChildType[Count], RecordCoord<>, mp_list< Tags... > >
 
struct  llama::internal::GetCoordFromTagsImpl< Record< Fields... >, RecordCoord<>, RecordCoord< RCs... > >
 
struct  llama::internal::GetTypeImpl< RecordDim, RecordCoordOrTags >
 
struct  llama::internal::GetTypeImpl< Record< Children... >, RecordCoord< HeadCoord, TailCoords... > >
 
struct  llama::internal::GetTypeImpl< ChildType[N], RecordCoord< HeadCoord, TailCoords... > >
 
struct  llama::internal::GetTypeImpl< T, RecordCoord<> >
 
struct  llama::internal::LeafRecordCoordsImpl< T, RecordCoord< RCs... > >
 
struct  llama::internal::LeafRecordCoordsImpl< Record< Fields... >, RecordCoord< RCs... > >
 
struct  llama::internal::LeafRecordCoordsImpl< Child[N], RecordCoord< RCs... > >
 
struct  llama::internal::FlattenRecordDimImpl< T >
 
struct  llama::internal::FlattenRecordDimImpl< Record< Fields... > >
 
struct  llama::internal::FlattenRecordDimImpl< Child[N]>
 
struct  llama::internal::IndirectValue< T >
 
struct  llama::internal::IsBoundedArray< T >
 
struct  llama::internal::IsBoundedArray< T[N]>
 
struct  llama::internal::TransformLeavesWithCoordImpl< Coord, T, TypeFunctor >
 
struct  llama::internal::TransformLeavesWithCoordImpl< RecordCoord< Is... >, Record< Fields... >, TypeFunctor >
 
struct  llama::internal::TransformLeavesWithCoordImpl< RecordCoord< Is... >, Child[N], TypeFunctor >
 
struct  llama::internal::MakePassSecond< F >
 
struct  llama::internal::IsConstant< T >
 
struct  llama::internal::IsConstant< std::integral_constant< T, V > >
 
struct  llama::internal::BoxedValue< T, I >
 
struct  llama::internal::BoxedValue< Constant< V >, I >
 
struct  llama::PrettySize
 

Namespaces

 llama
 
 llama::internal
 

Typedefs

template<typename Field >
using llama::GetFieldTag = mp_first< Field >
 Get the tag from a Field. More...
 
template<typename Field >
using llama::GetFieldType = mp_second< Field >
 Get the type from a Field. More...
 
template<typename RecordDim , typename RecordCoord >
using llama::GetTags = typename internal::GetTagsImpl< RecordDim, RecordCoord >::type
 
template<typename RecordDim , typename RecordCoord >
using llama::GetTag = typename internal::GetTagImpl< RecordDim, RecordCoord >::type
 Get the tag of the Field at a RecordCoord inside the record dimension tree. More...
 
template<typename RecordDim , typename... TagsOrTagList>
using llama::GetCoordFromTags = typename internal::GetCoordFromTagsImpl< RecordDim, RecordCoord<>, TagsOrTagList... >::type
 
template<typename RecordDim , typename... RecordCoordOrTags>
using llama::GetType = typename internal::GetTypeImpl< RecordDim, RecordCoordOrTags... >::type
 
template<typename RecordDim >
using llama::LeafRecordCoords = typename internal::LeafRecordCoordsImpl< RecordDim, RecordCoord<> >::type
 Returns a flat type list containing all record coordinates to all leaves of the given record dimension. More...
 
template<typename RecordDim >
using llama::FlatRecordDim = typename internal::FlattenRecordDimImpl< RecordDim >::type
 Returns a flat type list containing all leaf field types of the given record dimension. More...
 
template<typename RecordDim , template< typename, typename > typename FieldTypeFunctor>
using llama::TransformLeavesWithCoord = typename internal::TransformLeavesWithCoordImpl< RecordCoord<>, RecordDim, FieldTypeFunctor >::type
 
template<typename RecordDim , template< typename > typename FieldTypeFunctor>
using llama::TransformLeaves = TransformLeavesWithCoord< RecordDim, internal::MakePassSecond< FieldTypeFunctor >::template fn >
 
template<typename RecordDimA , typename RecordDimB >
using llama::MergedRecordDims = typename decltype(internal::mergeRecordDimsImpl(mp_identity< RecordDimA >{}, mp_identity< RecordDimB >{}))::type
 Creates a merged record dimension, where duplicated, nested fields are unified. More...
 
template<typename FromT , typename ToT >
using llama::CopyConst = std::conditional_t< std::is_const_v< FromT >, const ToT, ToT >
 Alias for ToT, adding const if FromT is const qualified. More...
 
template<auto V>
using llama::Constant = std::integral_constant< decltype(V), V >
 Used as template argument to specify a constant/compile-time value. More...
 

Functions

template<typename Int >
 llama::NrAndOffset (Int, Int) -> NrAndOffset< Int >
 
template<typename TA , typename TB >
auto llama::operator== (const NrAndOffset< TA > &a, const NrAndOffset< TB > &b) -> bool
 
template<typename TA , typename TB >
auto llama::operator!= (const NrAndOffset< TA > &a, const NrAndOffset< TB > &b) -> bool
 
template<typename RecordDim , typename Functor , std::size_t... Coords>
constexpr void llama::forEachLeafCoord (Functor &&functor, RecordCoord< Coords... > baseCoord)
 
template<typename RecordDim , typename Functor , typename... Tags>
constexpr void llama::forEachLeafCoord (Functor &&functor, Tags...)
 
template<typename TypeList >
constexpr auto llama::internal::flatAlignOfImpl ()
 
template<typename Integral >
constexpr auto llama::divCeil (Integral a, Integral b) -> Integral
 Returns the ceiling of a / b. More...
 
template<typename Integral >
constexpr auto llama::roundUpToMultiple (Integral n, Integral mult) -> Integral
 Returns the integral n rounded up to be a multiple of mult. More...
 
template<typename TypeList , bool Align, bool IncludeTailPadding>
constexpr auto llama::internal::sizeOfImpl () -> std::size_t
 
template<typename TypeList , std::size_t I, bool Align>
constexpr auto llama::internal::offsetOfImplWorkaround () -> std::size_t
 
template<typename A , typename B >
auto llama::internal::mergeRecordDimsImpl (mp_identity< A > a, mp_identity< B >)
 
template<typename A , std::size_t NA, typename B , std::size_t NB>
auto llama::internal::mergeRecordDimsImpl ([[maybe_unused]] mp_identity< A[NA]> a, [[maybe_unused]] mp_identity< B[NB]> b)
 
template<typename... FieldsA>
auto llama::internal::mergeRecordDimsImpl (mp_identity< Record< FieldsA... >> a, mp_identity< Record<>>)
 
template<typename... FieldsA, typename FieldB , typename... FieldsB, auto Pos = FindFieldByTag<Record<FieldsA...>, GetFieldTag<FieldB>>::value>
auto llama::internal::mergeRecordDimsImpl (mp_identity< Record< FieldsA... >>, mp_identity< Record< FieldB, FieldsB... >>)
 
auto llama::prettySize (double size) -> PrettySize
 

Variables

template<typename T >
constexpr bool llama::isAllowedFieldType = std::is_trivially_destructible_v<T>
 Tells whether the given type is allowed as a field type in LLAMA. Such types need to be trivially constructible and trivially destructible. More...
 
template<typename T >
constexpr bool llama::isField = false
 
template<typename Tag , typename Type >
constexpr bool llama::isField< Field< Tag, Type > > = true
 
template<typename T >
constexpr auto llama::isRecord = false
 
template<typename... Fields>
constexpr auto llama::isRecord< Record< Fields... > > = true
 
template<typename RecordDimA , typename RecordCoordA , typename RecordDimB , typename RecordCoordB >
constexpr auto llama::hasSameTags
 
template<typename RecordDim >
constexpr std::size_t llama::flatFieldCount = 1
 The total number of fields in the recursively expanded record dimension. More...
 
template<typename... Children>
constexpr std::size_t llama::flatFieldCount< Record< Children... > > = (flatFieldCount<GetFieldType<Children>> + ... + 0)
 
template<typename Child , std::size_t N>
constexpr std::size_t llama::flatFieldCount< Child[N]> = flatFieldCount<Child> * N
 
template<std::size_t I, typename RecordDim >
constexpr std::size_t llama::internal::flatFieldCountBefore = 0
 
template<typename... Children>
constexpr std::size_t llama::internal::flatFieldCountBefore< 0, Record< Children... > > = 0
 
template<std::size_t I, typename... Children>
constexpr std::size_t llama::internal::flatFieldCountBefore< I, Record< Children... > >
 
template<typename RecordDim , typename RecordCoord >
constexpr std::size_t llama::flatRecordCoord = 0
 
template<typename T >
constexpr std::size_t llama::flatRecordCoord< T, RecordCoord<> > = 0
 
template<typename... Children, std::size_t I, std::size_t... Is>
constexpr std::size_t llama::flatRecordCoord< Record< Children... >, RecordCoord< I, Is... > >
 
template<typename Child , std::size_t N, std::size_t I, std::size_t... Is>
constexpr std::size_t llama::flatRecordCoord< Child[N], RecordCoord< I, Is... > > = flatFieldCount<Child> * I + flatRecordCoord<Child, RecordCoord<Is...>>
 
template<typename TypeList >
constexpr std::size_t llama::flatAlignOf = internal::flatAlignOfImpl<TypeList>()
 
template<typename T >
constexpr std::size_t llama::alignOf = alignof(T)
 The alignment of a type T. More...
 
template<typename... Fields>
constexpr std::size_t llama::alignOf< Record< Fields... > > = flatAlignOf<FlatRecordDim<Record<Fields...>>>
 
template<typename TypeList , bool Align, bool IncludeTailPadding = true>
constexpr std::size_t llama::flatSizeOf = internal::sizeOfImpl<TypeList, Align, IncludeTailPadding>()
 The size of a type list if its elements would be in a normal struct. More...
 
template<typename T , bool Align = false, bool IncludeTailPadding = true>
constexpr std::size_t llama::sizeOf = sizeof(T)
 The size of a type T. More...
 
template<typename... Fields, bool Align, bool IncludeTailPadding>
constexpr std::size_t llama::sizeOf< Record< Fields... >, Align, IncludeTailPadding > = flatSizeOf<FlatRecordDim<Record<Fields...>>, Align, IncludeTailPadding>
 The size of a record dimension if its fields would be in a normal struct. More...
 
template<typename TypeList , std::size_t I, bool Align>
constexpr std::size_t llama::flatOffsetOf = internal::offsetOfImplWorkaround<TypeList, I, Align>()
 The byte offset of an element in a type list ifs elements would be in a normal struct. More...
 
template<typename RecordDim , typename RecordCoord , bool Align = false>
constexpr std::size_t llama::offsetOf = flatOffsetOf<FlatRecordDim<RecordDim>, flatRecordCoord<RecordDim, RecordCoord>, Align>
 
template<typename T >
constexpr bool llama::isRecordDim = isRecord<T> || internal::IsBoundedArray<T>::value
 True if the T is a record dimension. That is, T is either a llama::Record or a bounded array. More...
 
template<typename T >
constexpr bool llama::isConstant = internal::IsConstant<T>::value