FOptionallySparseIndexMap

Index map that supports dense or sparse storage, or a simple formula-based map (e.g. constant, identity, shift) For dense and sparse, the formula can be used to set default values.

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Util/SparseIndexCollectionTypes.h

Include

#include "Util/SparseIndexCollectionTypes.h"

Syntax

struct FOptionallySparseIndexMap

Remarks

Index map that supports dense or sparse storage, or a simple formula-based map (e.g. constant, identity, shift) For dense and sparse, the formula can be used to set default values.

Variables

Name Description

Public variable

int

 

DefaultOffset

Mapping to assign defaults for indices that are not explicitly assigned; computed as Index*DefaultScale + DefaultOffset

Public variable

int

 

DefaultScale

Public variable

TArray< int >

 

Dense

Storage used when map is dense

Public variable

EMapType

 

MapType

Choice of storage backing the map

Public variable

int

 

MaxIndex

Max index in map; -1 will leave the map unbounded (invalid for Dense maps)

Public variable

TMap< int, int ...

 

Sparse

Storage used when map is sparse

Constructors

Name Description

Public function

FOptionallySparseIndexMap()

Default constructor sets map to sparse, w/ constant -1 default value

Public function

FOptionallySparseIndexMap

(
    EMapType MapType,
    int MaxIndex
)

Construct map with explicit choice of storage type

Public function

FOptionallySparseIndexMap

(
    TArray< int > Dense,
    int MaxIndex
)

Construct map with dense storage copied from an existing array

Public function

FOptionallySparseIndexMap

(
    int MaxIndex,
    int SubsetCountEst
)

Construct map with automatically-chosen dense or sparse storage, based on max index and estimated element count

Functions

Name Description

Public function Const

bool

 

BadIndex

(
    int Index
)

Public function Static

FOptionallyS...

 

ConstantMap

(
    int ConstantValue,
    int MaxIndex
)

Public function

bool

 

Contains

(
    int Index
)

Dense variant: returns true unless you have set index to InvalidIndex (eg via SetToInvalid) sparse variant: returns true if index is in map or default index is >= 0 scaleandoffset variant: returns true if default index is >= 0 all return false if index is out-of-bounds

Public function Static

FOptionallyS...

 

IdentityMap

(
    int MaxIndex
)

Public function

void

 

InitDefaults()

Initialize default values for dense map (sparse defaults are computed on the fly)

Public function

void

 

Initialize

(
    int MaxIndexIn,
    int SubsetCountEst
)

Automatically choose sparse or dense storage based on use estimate

Public function

void

 

Set

(
    int Index,
    int Value
)

Sets the map at a given index. Do not call if MapType is ScaleAndOffset.

Public function

void

 

SetInvalid

(
    int Index
)

Public function Static

FOptionallyS...

 

SparseIdentityMap

(
    int MaxIndex
)

Public function

void

 

Unset

(
    int Index
)

Operators

Name Description

Public function Const

const int

 

operator[]

(
    int Index
)

Array-style accessor to the map

Enums

Name

Description

Public enum

EMapType

Different kinds of storage that could be used for the map

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss