| igraph Reference Manual |
|---|
There is an experimental attribute handler that can be used from C code. In this section we show how this works. This attribute handler is by default not attached (the default is no attribute handler), so we first need to attach it:
igraph_i_set_attribute_table(&igraph_cattribute_table);
Now the attribute functions are available. Please note that
the attribute handler must be attached before you call any other
igraph functions, otherwise you might end up with graphs without
attributes and an active attribute handler, which might cause
unexpected program behaviour. The rule is that you attach the
attribute handler in the beginning of your
main() and never touch it again. (Detaching
the attribute handler might lead to memory leaks.)
It is not currently possible to have attribute handlers on a per-graph basis. All graphs in an application must be managed with the same attribute handler. (Including the default case when there is no attribute handler at all.
The C attribute handler supports attaching real numbers and
character strings as attributes. No vectors are allowed, ie. every
vertex might have an attribute called name , but it is
not possible to have a coords graph (or other)
attribute which is a vector of numbers.
<< 1.3. igraph_attribute_type_t — The possible types of the attributes. |
2.1. Query attributes >> |