These CreateTree(...) functions enable brace-initialized construction of a traffic class hierarchy. For example, CreateTree("foo", {PRIORITY}, {{PRIORITY, 10, ...}, {PRIORITY, 15, ...}}) creates a tree with a priority root and two children, one of priority 10 and one of priority 15, where the ... can contain a similar call to CreateTree to construct any similar subtree. Classes that require ar
| 709 | // All classes constructed via these routines are created through calls to |
| 710 | // CreateTrafficClass above. |
| 711 | static TrafficClass *CreateTree(const std::string &name, |
| 712 | [[maybe_unused]] PriorityArgs args, |
| 713 | std::vector<PriorityChildArgs> children) { |
| 714 | PriorityTrafficClass *p = CreateTrafficClass<PriorityTrafficClass>(name); |
| 715 | for (auto &c : children) { |
| 716 | p->AddChild(c.child(), c.priority()); |
| 717 | } |
| 718 | return p; |
| 719 | } |
| 720 | |
| 721 | static TrafficClass *CreateTree(const std::string &name, |
| 722 | WeightedFairArgs args, |