35 #ifndef Foam_directFieldMapper_H 36 #define Foam_directFieldMapper_H 58 template<
class FieldMapperType>
61 public FieldMapperType
75 static bool hasUnmappedEntry(
const labelUList& directAddr)
77 for (
const label val : directAddr)
79 if (val < 0)
return true;
98 const bool checkUnmapped =
true 102 directAddressing_(directAddr),
103 hasUnmapped_(checkUnmapped && hasUnmappedEntry(directAddr))
116 return notNull(directAddressing_);
120 virtual label
size()
const 122 return directAddressing_.
size();
126 virtual bool direct()
const 146 return directAddressing_;
void size(const label n)
Older name for setAddressableSize.
virtual bool hasUnmapped() const
Any unmapped values?
DirectFieldMapper< FieldMapper > directFieldMapper
A FieldMapper with direct mapping.
A templated direct mapper for the given FieldMapper type.
virtual const labelUList & directAddressing() const
Return the direct addressing values.
virtual ~DirectFieldMapper()=default
Destructor.
DirectFieldMapper(const labelUList &directAddr, const bool checkUnmapped=true)
Construct given addressing, check for unmapped (negative) values.
virtual bool direct() const
It is a direct mapper.
virtual label size() const
The mapper size is given by the size of the direct addressing.
FieldMapperType mapper_type
The base mapper type.
bool notNull(const T *ptr) noexcept
True if ptr is not a pointer (of type T) to the nullObject.
virtual bool hasDirectAddressing() const
True if directAddressing is not the null object (unallocated)