aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/215 source set realistic example/main.cc
blob: 2b552176b05cef66e2264ca77e4d31a62815a8e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <vector>
#include "common.h"

Board* boards;
Device* devices;
Dependency* deps;

Board::Board() { this->next = boards; boards = this; }
Board::~Board() {}

Device::Device() { this->next = devices; devices = this; }
Device::~Device() {}

Dependency::Dependency() { this->next = deps; deps = this; }
Dependency::~Dependency() {}

int main(void)
{
    some_random_function();
    for (auto d = deps; d; d = d->next)
        d->initialize();

    initialize_target();
    for (auto b = boards; b; b = b->next) {
        std::cout << ANSI_START << b->target() << " - " << ANSI_END;
        b->say_hello();
    }

    for (auto d = devices; d; d = d->next)
        d->say_hello();
}