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

Function EffectsBuffer_AddSetRemoveLabelsEffect

src/effects/effects.c:656–684  ·  view source on GitHub ↗

add a node add label effect to buffer

Source from the content-addressed store, hash-verified

654
655// add a node add label effect to buffer
656void EffectsBuffer_AddSetRemoveLabelsEffect
657(
658 EffectsBuffer *buff, // effect buffer
659 const Node *node, // updated node
660 const LabelID *lbl_ids, // labels
661 uint8_t lbl_count, // number of labels
662 EffectType t // effect type
663) {
664 //--------------------------------------------------------------------------
665 // effect format:
666 // effect type
667 // node ID
668 // labels count
669 // label IDs
670 //--------------------------------------------------------------------------
671
672 EffectsBuffer_WriteBytes(&t, sizeof(t), buff);
673
674 // write node ID
675 EffectsBuffer_WriteBytes(&ENTITY_GET_ID(node), sizeof(EntityID), buff);
676
677 // write labels count
678 EffectsBuffer_WriteBytes(&lbl_count, sizeof(lbl_count), buff);
679
680 // write label IDs
681 EffectsBuffer_WriteBytes(lbl_ids, sizeof(LabelID) * lbl_count, buff);
682
683 EffectsBuffer_IncEffectCount(buff);
684}
685
686// add a node add labels effect to buffer
687void EffectsBuffer_AddLabelsEffect

Calls 2

EffectsBuffer_WriteBytesFunction · 0.85

Tested by

no test coverage detected