2018-11-21 13:35:14 +00:00
|
|
|
package allg5
|
2018-02-15 19:17:27 +00:00
|
|
|
|
|
|
|
// #include <stdlib.h>
|
|
|
|
import "C"
|
|
|
|
|
2018-02-26 06:51:58 +00:00
|
|
|
type FlagMutation interface {
|
|
|
|
Set(f NewBitmapFlag)
|
|
|
|
Unset(f NewBitmapFlag)
|
|
|
|
}
|
|
|
|
|
2018-02-15 19:17:27 +00:00
|
|
|
type flagMut struct {
|
|
|
|
flg C.int
|
|
|
|
}
|
|
|
|
|
2018-02-26 06:51:58 +00:00
|
|
|
func (m *flagMut) Set(f NewBitmapFlag) {
|
|
|
|
m.flg |= C.int(f)
|
2018-02-15 19:17:27 +00:00
|
|
|
}
|
|
|
|
|
2018-02-26 06:51:58 +00:00
|
|
|
func (m *flagMut) Unset(f NewBitmapFlag) {
|
|
|
|
if m.flg&C.int(f) == C.int(f) {
|
|
|
|
m.flg ^= C.int(f)
|
2018-02-15 19:17:27 +00:00
|
|
|
}
|
|
|
|
}
|