qosd: добавлены атрибуты узлов

Мне показалось, будет удобно использовать вложенную структуру в качестве
аргумента конструктора.
This commit is contained in:
Сергей Маринкевич
2025-09-03 20:12:47 +07:00
parent 6a82699c5c
commit 43b44d7ee5
7 changed files with 144 additions and 11 deletions
+16 -1
View File
@@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include "nodes/LeafNode.h"
#include "mixins/FabricMixin.h"
#include "Logger.h"
@@ -8,14 +9,28 @@
class BFIFONode : public LeafNode,
public FabricMixin<BFIFONode> {
public:
struct Config {
/// Размер очереди в байтах.
std::uint64_t limit = 0;
};
~BFIFONode() {
Logger::get("ConDes").dbg(std::string("--- BFIFO destructor called for: ") + name_);
}
const Config& config() const { return config_; }
private:
friend class FabricMixin<BFIFONode>;
BFIFONode(std::string name) : LeafNode(std::move(name), "BFIFO") {
BFIFONode(std::string&& name) : LeafNode(std::move(name), "BFIFO") {
Logger::get("ConDes").dbg(std::string("--- BFIFO constructor called for: ") + name_);
}
BFIFONode(std::string&& name, Config&& config) : LeafNode(std::move(name), "BFIFO"),
config_(std::move(config)) {
Logger::get("ConDes").dbg(std::string("--- BFIFO constructor called for: ") + name_);
}
Config config_{};
};