AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
ValuePolicies.hpp File Reference

Unified storage core for SLAM's scalar value policies. More...

Classes

struct  axom::slam::policies::SizeTag< IntType >
 Tag for set-size value policies. More...
 
struct  axom::slam::policies::StrideTag< IntType >
 Tag for set-stride value policies. More...
 
struct  axom::slam::policies::OffsetTag< IntType >
 Tag for set-offset value policies. More...
 
class  axom::slam::policies::RuntimeValue< Tag >
 Shared storage core for a runtime-settable scalar value policy. More...
 
class  axom::slam::policies::CompileTimeValue< V, Tag >
 Shared core for a compile-time-known scalar value policy. More...
 

Namespaces

 axom
 
 axom::slam
 
 axom::slam::policies
 

Detailed Description

Unified storage core for SLAM's scalar value policies.

Slam's Size, Stride and Offset policies each historically defined a near-identical Runtime* / CompileTime* pair, with the same: (a) single-integer storage (b) defaulted/asserting constructors, and (c) operator() accessors, and differing only in (a) the name of the named accessor (size() / stride() / offset()), (b) the validity predicate, and (c) the default value.

This file factors that shared substrate into one RuntimeValue<Tag> / CompileTimeValue<auto, Tag> family.

A Tag type supplies the policy-specific knobs as static members:

  • static constexpr IntType defaultValue(); – the DEFAULT_VALUE
  • static constexpr bool isValidValue(IntType); – validity predicate

The named accessors (size(), stride(), offset()) are not provided here; they live in the thin leaf policies in SizePolicies.hpp / StridePolicies.hpp / OffsetPolicies.hpp as one-line forwarders to value(), which keeps every existing call site spelling and signature unchanged while removing the storage/ctor/validity duplication.

Note
Multi-dimensional and dynamically-resizable policies (MultiDimStride, DynamicRuntimeSize) and the always-zero policies (ZeroSize) are not part of this scalar substrate and remain defined alongside their families.