tlp::NodeProperty< TYPE > Class Template Reference
That class enables to define a property/attribute on nodes on a VectorGraph.
More...
#include <vectorgraphproperty.h>
List of all members.
Public Member Functions
Friends
Detailed Description
template<typename TYPE>
class tlp::NodeProperty< TYPE >
That class enables to define a property/attribute on nodes on a VectorGraph.
Using NodeProperty you can assign any kind of attribute to nodes. To use that class you must first create an instance of NodeProperty and then connect it to your graph. NodeProperty can be copied in another NodeProperty, however the to NodeProperty will share the same content. You can consider that NodeProperty is just a pointer on a stl:vector. to free memory used by a NodeProperty connected to a graph you must use the free function.
- Warning:
- After the call to free all The copy of the orignal NodeProperty are no more valid
Using NodeProperty you can store and access to values with the same efficiency as if you created manually a vector. NodeProperty manage for you the resize, etc... when the graph is modified.
Furthemrore, in DEBUG mode, operator[] check if one try to access outside of the Array Bound. in DEBUG mode, the validy of the Property is also checked (if it has been free/alloc etc...)
VectorGraph g;
NodeProperty<double> weight;
g.alloc(weight);
node n;
forEach(n, g.getNodes()) {
weight[n] = g.deg(n);
}
NodeProperty<double> weight2 = weight;
weight2[g[0]] = 3;
cout << weight[g[0]];
g.free(weight2);
- See also:
- VectorGraph alloc(NodeProperty)
-
VectorGraph free(NodeProperty)
Constructor & Destructor Documentation
Member Function Documentation
Friends And Related Function Documentation