MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / undirectedRelPackExecFunc

Method undirectedRelPackExecFunc

src/function/struct/struct_pack_function.cpp:99–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void StructPackFunctions::undirectedRelPackExecFunc(
100 const std::vector<std::shared_ptr<ValueVector>>& parameters, ValueVector& result, void*) {
101 DASSERT(parameters.size() > 1);
102 // Force copy of the src and internal id child vectors because we might modify them later.
103 for (auto i = 0u; i < 2; i++) {
104 auto& parameter = parameters[i];
105 auto fieldVector = StructVector::getFieldVector(&result, i).get();
106 fieldVector->resetAuxiliaryBuffer();
107 if (parameter->state->isFlat()) {
108 copyParameterValueToStructFieldVector(parameter.get(), fieldVector, result.state.get());
109 } else {
110 for (auto j = 0u; j < result.state->getSelVector().getSelSize(); j++) {
111 auto pos = result.state->getSelVector()[j];
112 fieldVector->copyFromVectorData(pos, parameter.get(), pos);
113 }
114 }
115 }
116 for (auto i = 2u; i < parameters.size(); i++) {
117 auto& parameter = parameters[i];
118 if (parameter->state == result.state) {
119 continue;
120 }
121 // If the parameter's state is inconsistent with the result's state, we need to copy the
122 // parameter's value to the corresponding child vector.
123 StructVector::getFieldVector(&result, i)->resetAuxiliaryBuffer();
124 copyParameterValueToStructFieldVector(parameter.get(),
125 StructVector::getFieldVector(&result, i).get(), result.state.get());
126 }
127}
128
129function_set StructPackFunctions::getFunctionSet() {
130 function_set functions;

Callers

nothing calls this directly

Calls 7

getSelSizeMethod · 0.80
copyFromVectorDataMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45
resetAuxiliaryBufferMethod · 0.45
isFlatMethod · 0.45

Tested by

no test coverage detected