MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / EffectsBuffer_WriteAttributeSet

Function EffectsBuffer_WriteAttributeSet

src/effects/effects.c:210–237  ·  view source on GitHub ↗

dump attributes to stream

Source from the content-addressed store, hash-verified

208
209// dump attributes to stream
210static void EffectsBuffer_WriteAttributeSet
211(
212 const AttributeSet attrs, // attribute set to write to stream
213 EffectsBuffer *buff
214) {
215 //--------------------------------------------------------------------------
216 // write attribute count
217 //--------------------------------------------------------------------------
218
219 ushort attr_count = AttributeSet_Count(attrs);
220 EffectsBuffer_WriteBytes(&attr_count, sizeof(attr_count), buff);
221
222 //--------------------------------------------------------------------------
223 // write attributes
224 //--------------------------------------------------------------------------
225
226 for(ushort i = 0; i < attr_count; i++) {
227 // get current attribute name and value
228 Attribute_ID attr_id;
229 SIValue attr = AttributeSet_GetIdx(attrs, i, &attr_id);
230
231 // write attribute ID
232 EffectsBuffer_WriteBytes(&attr_id, sizeof(Attribute_ID), buff);
233
234 // write attribute value
235 EffectsBuffer_WriteSIValue(&attr, buff);
236 }
237}
238
239static inline void EffectsBuffer_IncEffectCount
240(

Calls 4

AttributeSet_CountFunction · 0.85
EffectsBuffer_WriteBytesFunction · 0.85
AttributeSet_GetIdxFunction · 0.85

Tested by

no test coverage detected