Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

Node.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Graph.h>
36 
37 namespace ogdf {
38 namespace energybased {
39 namespace fmmm {
40 
43 class Node
44 {
45  friend int value(const Node& A) { return A.value; }
46 
47  friend ostream &operator<< (ostream & output,const Node & A)
48  {
49  output <<"node index ";
50  if(A.vertex == nullptr)
51  output<<"nil";
52  else
53  output<<A.vertex->index();
54  output<<" value "<< A.value;
55  return output;
56  }
57 
58  friend istream &operator>> (istream & input,Node & A) {
59  input >> A.value;
60  return input;
61  }
62 
63 public:
64  Node() { vertex = nullptr; value = 0; }
65  ~Node() { }
66 
67 
68  void set_Node(node v,int a) { vertex = v; value = a; }
69  int get_value() const { return value; }
70  node get_node() const { return vertex; }
71 
72 private:
74  int value ;
75 };
76 
77 }
78 }
79 }
friend int value(const Node &A)
Definition: Node.h:45
void set_Node(node v, int a)
Definition: Node.h:68
friend istream & operator>>(istream &input, Node &A)
Definition: Node.h:58
int get_value() const
Definition: Node.h:69
~Node()
destructor
Definition: Node.h:65
Data structure for representing nodes and an int value (needed for class ogdf/list) to perform bucket...
Definition: Node.h:43
Class for the representation of nodes.
Definition: Graph_d.h:167
Includes declaration of graph class.
int index() const
Returns the (unique) node index.
Definition: Graph_d.h:201
friend ostream & operator<<(ostream &output, const Node &A)
Definition: Node.h:47
The namespace for all OGDF objects.
node get_node() const
Definition: Node.h:70
Node()
constructor
Definition: Node.h:64