Debian Codegraph @

test cases/common/215 source set realistic example/main.cc

raw
1 #include <iostream>
2 #include <vector>
3 #include "common.h"
4
5 Board* boards;
6 Device* devices;
7 Dependency* deps;
8
9 Board::Board() { this->next = boards; boards = this; }
10 Board::~Board() {}
11
12 Device::Device() { this->next = devices; devices = this; }
13 Device::~Device() {}
14
15 Dependency::Dependency() { this->next = deps; deps = this; }
16 Dependency::~Dependency() {}
17
18 int main(void)
19 {
20 some_random_function();
21 for (auto d = deps; d; d = d->next)
22 d->initialize();
23
24 initialize_target();
25 for (auto b = boards; b; b = b->next) {
26 std::cout << ANSI_START << b->target() << " - " << ANSI_END;
27 b->say_hello();
28 }
29
30 for (auto d = devices; d; d = d->next)
31 d->say_hello();
32 }