Gradually adding support for all features
This commit is contained in:
parent
5b32ba2c09
commit
ec77833c37
|
@ -92,7 +92,9 @@ func (self *{{o.name}}) WriteFields(writer meta.Writer) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
%ext_methods%
|
||||
{% if has_token(o, 'bitfields') %}
|
||||
{{_self.bitfields_methods(o)}}
|
||||
{% endif %}
|
||||
|
||||
{% if has_token(o, 'statist') %}
|
||||
{{_self.stats_methods(meta, o)}}
|
||||
|
@ -212,6 +214,24 @@ self.fieldsMask = meta.FieldsMask{}
|
|||
|
||||
{% endmacro %}
|
||||
|
||||
{% macro bitfields_methods(o) %}
|
||||
func(self *{{o.name}}) HasValue(index uint64) bool {
|
||||
return self.fieldsMask.FieldChanged(index)
|
||||
}
|
||||
|
||||
func(self *{{o.name}}) SetFieldChanged(index uint64) {
|
||||
self.fieldsMask.SetFieldChanged(index)
|
||||
}
|
||||
|
||||
func(self *{{o.name}}) IsMaskFilled() bool {
|
||||
return self.fieldsMask.IsFilled()
|
||||
}
|
||||
|
||||
func(self *{{o.name}}) GetMask() meta.FieldsMask {
|
||||
return self.fieldsMask
|
||||
}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro stats_methods(meta, o) %}
|
||||
|
||||
func (self *{{o.name}}) Table() string {
|
||||
|
|
Loading…
Reference in New Issue