qosd: добавил краевые узлы
Краевые узлы не могут иметь дочерние узлы. Отлично подходит для бесклассовых дисциплин. Например, вариации FIFO, Fair Queue, RED и т.д. Псевдо-бесклассовые по типу TBF, которые подключают в себя FIFO (или любую указанную пользователем дисциплину), всё ещё должны пользоваться SimpleNode.
This commit is contained in:
@@ -3,10 +3,14 @@
|
||||
#include <stdexcept>
|
||||
|
||||
/// \brief Связь для листового узла, не допускающая дочерних элементов.
|
||||
class LeafLink : public BaseLink {
|
||||
template <class TElem>
|
||||
class LeafLink : public BaseLink<TElem> {
|
||||
public:
|
||||
using BaseLink::BaseLink;
|
||||
void addChild(const NodePtr&) override {
|
||||
throw std::logic_error("LeafLink cannot have children");
|
||||
using ElemPtr = std::shared_ptr<TElem>;
|
||||
|
||||
LeafLink(std::shared_ptr<TElem> e) : BaseLink<TElem>(e) {}
|
||||
|
||||
void addChild(const ElemPtr&) override {
|
||||
throw std::logic_error("Leaf cannot have children");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user