updates a graph entity attribute set. Returns as out params the number of properties set and removed.
| 221 | // updates a graph entity attribute set. Returns as out params the number |
| 222 | // of properties set and removed. |
| 223 | void UpdateEntityProperties |
| 224 | ( |
| 225 | GraphContext *gc, // graph context |
| 226 | GraphEntity *ge, // updated entity |
| 227 | const AttributeSet set, // new attributes |
| 228 | GraphEntityType entity_type, // entity type |
| 229 | bool log // log update in undo-log |
| 230 | ) { |
| 231 | ASSERT(gc != NULL); |
| 232 | ASSERT(ge != NULL); |
| 233 | |
| 234 | AttributeSet old_set = GraphEntity_GetAttributes(ge); |
| 235 | |
| 236 | if(log == true) { |
| 237 | UndoLog log = QueryCtx_GetUndoLog(); |
| 238 | UndoLog_UpdateEntity(log, ge, old_set, entity_type); |
| 239 | } |
| 240 | |
| 241 | *ge->attributes = set; |
| 242 | |
| 243 | if(entity_type == GETYPE_NODE) { |
| 244 | _AddNodeToIndices(gc, (Node *)ge); |
| 245 | } else { |
| 246 | _AddEdgeToIndices(gc, (Edge *)ge); |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | void UpdateNodeProperty |
| 251 | ( |
no test coverage detected