Navigation
API > API/Plugins > API/Plugins/UAF
Description
[Join Operators] Join operations take an operator argument to control how the join behaves. A join operator is responsible for the following:
- Return keys/values for each iterator type provided to the join function
- Provide the largest key value
- Provide fuzzy matching semantics (optional)
Key Fetching: Joins grab keys from iterators through the GetKey(const IterType&) functions. Keys are sometimes cached within the join operation as such it makes little difference whether they are returned by value or by const&. However, keys should be kept as small as possible to help with performance.
The largest key is provided by the GetLargestKey() function. Joins operate on sorted inputs which rely on the < (lower than) operator.
Value Fetching: Joins forward values from iterators through the GetValue(const IterType&) functions. Join operations do not cache values: they are directly provided to the predicate function. You can thus avoid value copying by using references (mutable or otherwise). Mutability of values is determined by the predicate function signature.
Fuzzy Matching: Fuzzy matching allows for mixed iteration as opposed to locked step iteration meaning an fuzzy entry can match multiple values in other iterators. For example, a join operation with a transformer list and an attribute collection will want the predicate called for each set map within the collection that has a matching value type. This allows the same transformed to be provided to multiple set maps that share the same value type but with a different attribute type (through a partial key). Fuzzy matching is enabled when IsMatch(const ReferenceKey&, const TestKey&) is defined on the join operator. When present, IsMatch is used to compare for equality in some operations instead of == (direct equality). The ReferenceKey is the smallest key our iterators currently point to. When the reference key is a fuzzy key (smallest of its fuzzy group), it can match multiple TestKeys. An inner join will call the predicate for the union of all iterators When an entry is missing from an iterator, it is skipped This assumes that each iterator is sorted The JoinOpType is used to control which key is used and what value is produced for the predicate e.g. InnerJoinBy(.., A, B) Where:
- A: [(123, 'foo'), (456, 'bar')]
- B: [(456, 'bar'), (888, 'wow')] Predicate is invoked with:
- [(456, 'bar'), (456, 'bar')] (Both entries matching)
See [Join Operators] above for details on the Join Operator argument.
| Name | UE::UAF::InnerJoinBy |
| Type | function |
| Header File | /Engine/Plugins/Experimental/UAF/UAF/Source/UAF/Public/UAF/ValueRuntime/IteratorUtils.h |
| Include Path | #include "UAF/ValueRuntime/IteratorUtils.h" |
namespace UE
{
namespace UAF
{
template<class JoinOpType, class PredicateType, class... IteratorTypes>
void UE::UAF::InnerJoinBy
(
JoinOpType && JoinOp,
PredicateType && Predicate,
IteratorTypes &&... Iterators
)
}
}