[英]Yang modeling language - select / deselect one or multiple options within bits type
不,YANG 位类型不会让您这样做,因为默认情况下各个位之间不存在任何关系 - 除了所有这些都属于同一组“可配置标志”的概念。
这是联合类型将成为可行的建模决策的地方。
leaf check-type {
type union {
type enumeration {
enum Whole-platform;
}
type bits {
bit NSO-checks;
bit ESC-checks;
}
}
default Whole-platform;
}
这样做意味着值Whole-platform
和读者的剩余位值集之间的 XOR(互斥)。
有效值:
<check-type>Whole-platform</check-type>
<check-type>NSO-checks</check-type>
<check-type>NSO-checks ESC-checks</check-type>
无效的:
<check-type>Whole-platform ESC-checks</check-type>
您可以保留您的类型并处理其中的一位以在描述中将它们全部规则,因为那只是人类可读的规范文本。
description "Implementations must ensure an XOR relationship between
'Whole-platform' bit value and the other bit values of this
leaf. When the former is used it means that
...";
注意:您要实现的是实现细节。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.