Foam::ListPolicy Namespace Reference

Additional compile-time controls of List behaviour. More...

Classes

struct  no_linebreak
 Can suppress additional line breaks separate ASCII data content when the data elements are primitives, or contiguous. More...
 
struct  no_linebreak< keyType >
 Suppress line-breaks for keyType. More...
 
struct  no_linebreak< word >
 Suppress line-breaks for word. More...
 
struct  no_linebreak< wordRe >
 Suppress line-breaks for wordRe. More...
 
struct  short_length
 Number of items before requiring line-breaks in the list output. More...
 

Enumerations

enum  uniformity : unsigned char { EMPTY = 0, UNIFORM = 0x1, NONUNIFORM = 0x2, MIXED = 0x3 }
 Classification of list/container uniformity. The values can be used with bit-wise or reduction. More...
 

Functions

template<class T >
constexpr bool is_aligned_type () noexcept
 Consider aligned allocation for the given type? More...
 
template<class IntType >
constexpr bool use_alignment (IntType n) noexcept
 True if size exceeds the min-size for using memory alignment. More...
 
template<class IntType >
constexpr bool use_memory_pool (IntType n) noexcept
 True if size exceeds the min-size for using the memory pool. More...
 
template<class IntType >
constexpr bool use_offload (IntType n) noexcept
 True if size exceeds the min-size for offloading. More...
 
template<class T , class IntType >
Tallocate (IntType n)
 
template<class T , class IntType >
void deallocate (T *ptr)
 
template<class T , class IntType >
void deallocate (T *ptr, [[maybe_unused]] IntType n)
 
template<int SizeMin, int Numerator, class IntType >
IntType reserve_size (IntType requested, IntType capacity) noexcept
 Calculate a reserve size (eg, doubling) based on the requested length and the current capacity. More...
 
template<int SizeMin, int Numerator, int Denominator, class IntType >
IntType reserve_size (IntType requested, IntType capacity) noexcept
 Calculate a reserve size based on the requested length and the current capacity. More...
 
template<class InputIt >
enum uniformity check_uniformity (InputIt first, InputIt last)
 Algorithm to determine list/container uniformity. More...
 

Detailed Description

Additional compile-time controls of List behaviour.

Enumeration Type Documentation

◆ uniformity

enum uniformity : unsigned char

Classification of list/container uniformity. The values can be used with bit-wise or reduction.

Enumerator
EMPTY 

An empty container.

UNIFORM 

Container (non-empty) with identical values.

NONUNIFORM 

Container (non-empty) with different values.

MIXED 

Mixed uniform/non-uniform (eg, after reduction)

Definition at line 255 of file ListPolicy.H.

Function Documentation

◆ is_aligned_type()

constexpr bool Foam::ListPolicy::is_aligned_type ( )
inlinenoexcept

Consider aligned allocation for the given type?

Benefits for field data (floating-point, ints, vectorspace), but avoid for char data, strings, pointers etc

Definition at line 121 of file ListPolicy.H.

References Foam::T().

Here is the call graph for this function:

◆ use_alignment()

constexpr bool Foam::ListPolicy::use_alignment ( IntType  n)
inlinenoexcept

True if size exceeds the min-size for using memory alignment.

Definition at line 138 of file ListPolicy.H.

References n.

◆ use_memory_pool()

constexpr bool Foam::ListPolicy::use_memory_pool ( IntType  n)
inlinenoexcept

True if size exceeds the min-size for using the memory pool.

Definition at line 148 of file ListPolicy.H.

References n.

◆ use_offload()

constexpr bool Foam::ListPolicy::use_offload ( IntType  n)
inlinenoexcept

True if size exceeds the min-size for offloading.

Definition at line 158 of file ListPolicy.H.

References n.

◆ allocate()

T* Foam::ListPolicy::allocate ( IntType  n)
inline

Definition at line 165 of file ListPolicy.H.

References n, and Foam::T().

Here is the call graph for this function:

◆ deallocate() [1/2]

void Foam::ListPolicy::deallocate ( T ptr)
inline

◆ deallocate() [2/2]

void Foam::ListPolicy::deallocate ( T ptr,
[[maybe_unused] ] IntType  n 
)
inline

Definition at line 181 of file ListPolicy.H.

◆ reserve_size() [1/2]

IntType Foam::ListPolicy::reserve_size ( IntType  requested,
IntType  capacity 
)
inlinenoexcept

Calculate a reserve size (eg, doubling) based on the requested length and the current capacity.

Definition at line 195 of file ListPolicy.H.

◆ reserve_size() [2/2]

IntType Foam::ListPolicy::reserve_size ( IntType  requested,
IntType  capacity 
)
inlinenoexcept

Calculate a reserve size based on the requested length and the current capacity.

Definition at line 223 of file ListPolicy.H.

◆ check_uniformity()

enum uniformity Foam::ListPolicy::check_uniformity ( InputIt  first,
InputIt  last 
)

Algorithm to determine list/container uniformity.

Definition at line 267 of file ListPolicy.H.

References EMPTY, NONUNIFORM, and UNIFORM.

Referenced by exprValueFieldTag::set().

Here is the caller graph for this function: