1
2#### 1. Create a connector instance
3
4```c++
5unsigned int port = 6565;
6```
7
8```c++
9Connector c(port);
10```
11
12#### 2. Establish a connection and start a new search tree
13
14```c++
15/// Establishes a socket connection using the port specified above
16c.connect();
17
18/// Tells the profiler to start a new tree
19c.restart("example");
20
21/// Also used in case of a restart with restart id specified
22c.restart("example", 1);
23```
24
25#### 3. Send data every time the solver branches/fails/finds a solution
26
27```c++
28/// Create a node on a stack with mandatory fields
29Node node = c.createNode(node_id, parent_id, alt, kids, status);
30```
31
32```c++
33// Specify optional fields (whichever available)
34node.set_label("b");
35```
36
37```c++
38// Send the node
39c.sendNode(node);
40```
41
42Or all in one line:
43
44```c++
45c.createNode(node_id, parent_id, alt, kids, status).set_label("b").send();
46```
47
48
49The parameters are:
50
51field   | type | description
52------  | ---- | -----------
53node_id   | int | current node's identifier
54parent_id | int | identifier of node's parent
55alt       | int | which of its siblings the node is (0 for the left-most)
56kids      | int | number of children
57status    | Profiling::NodeStatus | determines the node's type (solution, failure, branching etc)
58label     | std::string | some text-based information to go along with the node (ie branching decision
59
60#### 4. Finish the tree and release the socket
61
62```c++
63c.done();
64c.disconnect();
65```