Overview | Modules | Class Hierarchy | Classes | Members

Public Member Functions | Friends
tlp::NodeProperty< TYPE > Class Template Reference

That class enables to define a property/attribute on nodes on a VectorGraph. More...

`#include <vectorgraphproperty.h>`

Inheritance diagram for tlp::NodeProperty< TYPE >:
[legend]
Collaboration diagram for tlp::NodeProperty< TYPE >:
[legend]

List of all members.

## Public Member Functions

- NodeProperty ()
- NodeProperty (const NodeProperty &obj)
- bool isValid () const

## Friends

- class VectorGraph

## 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); //connect weight to g, g allocate memory for that attribute
     node n;
     forEach(n, g.getNodes()) {
       weight[n] = g.deg(n);
     }
     NodeProperty<double> weight2 = weight; //weight2 and weight are pointing on the same memory addres
     weight2[g[0]] = 3;
     cout << weight[g[0]]; //output 3
     g.free(weight2); //free the memory, weight and weight2 are no more valid.

See also:
  VectorGraph alloc(NodeProperty)
  VectorGraph free(NodeProperty)

## Constructor & Destructor Documentation

template<typename TYPE>

tlp::NodeProperty< TYPE >::NodeProperty | ( |  | ) | `[inline]`

template<typename TYPE>

tlp::NodeProperty< TYPE >::NodeProperty | ( | const NodeProperty< TYPE > & | obj | ) | `[inline]`

## Member Function Documentation

template<typename TYPE >

bool tlp::NodeProperty< TYPE >::isValid | ( |  | ) | const`[virtual]`

Implements tlp::VectorGraphProperty< TYPE >.

## Friends And Related Function Documentation

template<typename TYPE>

friend class VectorGraph`[friend]`

Reimplemented from tlp::VectorGraphProperty< TYPE >.

Tulip Software by LaBRI Visualization Team 2001 - 2012