| 27 | } |
| 28 | |
| 29 | SIValue *GraphEntity_GetProperty |
| 30 | ( |
| 31 | const GraphEntity *e, |
| 32 | Attribute_ID attr_id |
| 33 | ) { |
| 34 | ASSERT(e); |
| 35 | |
| 36 | // e->attributes is NULL when dealing with an "intermediate" entity, |
| 37 | // one which didn't had its attribute-set allocated within the graph datablock. |
| 38 | if(e->attributes == NULL) { |
| 39 | // note that this exception may cause memory to be leaked in the caller |
| 40 | ErrorCtx_SetError("Attempted to access undefined attribute"); |
| 41 | return ATTRIBUTE_NOTFOUND; |
| 42 | } |
| 43 | |
| 44 | return AttributeSet_Get(*e->attributes, attr_id); |
| 45 | } |
| 46 | |
| 47 | // returns an SIArray of all keys in graph entity properties |
| 48 | SIValue GraphEntity_Keys |
no test coverage detected