Documentation
¶
Overview ¶
Package bitflag provides simple bit flag setting, checking, and clearing methods that take bit position args as ints (from const int eunum iota's) and do the bit shifting from there -- although a tiny bit slower, the convenience of maintaining ordinal lists of bit positions greatly outweighs that cost -- see kit type registry for further enum management functions
Index ¶
- func Clear(bits *int64, flags ...int)
- func Clear32(bits *int32, flags ...int)
- func ClearAtomic(bits *int64, flags ...int)
- func ClearAtomic32(bits *int32, flags ...int)
- func ClearMask(bits *int64, mask int64)
- func ClearMask32(bits *int32, mask int32)
- func ClearMaskAtomic(bits *int64, mask int64)
- func ClearMaskAtomic32(bits *int32, mask int32)
- func Has(bits int64, flag int) bool
- func Has32(bits int32, flag int) bool
- func HasAll(bits int64, flags ...int) bool
- func HasAll32(bits int32, flags ...int) bool
- func HasAllAtomic(bits *int64, flags ...int) bool
- func HasAllAtomic32(bits *int32, flags ...int) bool
- func HasAllMask(bits, mask int64) bool
- func HasAllMask32(bits, mask int32) bool
- func HasAllMaskAtomic(bits *int64, mask int64) bool
- func HasAllMaskAtomic32(bits *int32, mask int32) bool
- func HasAny(bits int64, flags ...int) bool
- func HasAny32(bits int32, flags ...int) bool
- func HasAnyAtomic(bits *int64, flags ...int) bool
- func HasAnyAtomic32(bits *int32, flags ...int) bool
- func HasAnyMask(bits, mask int64) bool
- func HasAnyMask32(bits, mask int32) bool
- func HasAnyMaskAtomic(bits *int64, mask int64) bool
- func HasAnyMaskAtomic32(bits *int32, mask int32) bool
- func HasAtomic(bits *int64, flag int) bool
- func HasAtomic32(bits *int32, flag int) bool
- func Mask(flags ...int) int64
- func Mask32(flags ...int) int32
- func Set(bits *int64, flags ...int)
- func Set32(bits *int32, flags ...int)
- func SetAtomic(bits *int64, flags ...int)
- func SetAtomic32(bits *int32, flags ...int)
- func SetMask(bits *int64, mask int64)
- func SetMask32(bits *int32, mask int32)
- func SetMaskAtomic(bits *int64, mask int64)
- func SetMaskAtomic32(bits *int32, mask int32)
- func SetState(bits *int64, state bool, flags ...int)
- func SetState32(bits *int32, state bool, flags ...int)
- func SetStateAtomic(bits *int64, state bool, flags ...int)
- func SetStateAtomic32(bits *int32, state bool, flags ...int)
- func Toggle(bits *int64, flags ...int)
- func Toggle32(bits *int32, flags ...int)
- func ToggleAtomic(bits *int64, flags ...int)
- func ToggleAtomic32(bits *int32, flags ...int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearAtomic ¶
ClearAtomic clears bit value(s) for ordinal bit position flags using atomic compare-and-swap loop, safe for concurrent access
func ClearAtomic32 ¶
ClearAtomic32 clears bit value(s) for ordinal bit position flags using atomic compare-and-swap loop, safe for concurrent access
func ClearMask32 ¶
ClearMask32 clears all of the bits in the mask
func ClearMaskAtomic ¶
ClearMaskAtomic clears all of the bits in the mask using atomic compare-and-swap loop, safe for concurrent access
func ClearMaskAtomic32 ¶
ClearMaskAtomic32 clears all of the bits in the mask using atomic compare-and-swap loop, safe for concurrent access
func HasAll ¶
HasAll checks if *all* of a set of flags are set for ordinal bit position flags (logical AND)
func HasAll32 ¶
HasAll32 checks if *all* of a set of flags are set for ordinal bit position flags (logical AND)
func HasAllAtomic ¶
HasAllAtomic checks if *all* of a set of flags are set for ordinal bit position flags (logical AND) using atomic compare-and-swap loop, safe for concurrent access
func HasAllAtomic32 ¶
HasAllAtomic32 checks if *all* of a set of flags are set for ordinal bit position flags (logical AND) using atomic compare-and-swap loop, safe for concurrent access
func HasAllMask ¶
HasAllMask checks if *all* of the bits in mask are set (logical AND)
func HasAllMask32 ¶
HasAllMask32 checks if *all* of the bits in mask are set (logical AND)
func HasAllMaskAtomic ¶
HasAllMaskAtomic checks if *all* of the bits in mask are set (logical AND) using atomic compare-and-swap loop, safe for concurrent access
func HasAllMaskAtomic32 ¶
HasAllMaskAtomic32 checks if *all* of the bits in mask are set (logical AND) using atomic compare-and-swap loop, safe for concurrent access
func HasAny ¶
HasAny checks if *any* of a set of flags are set for ordinal bit position flags (logical OR)
func HasAny32 ¶
HasAny32 checks if *any* of a set of flags are set for ordinal bit position flags (logical OR)
func HasAnyAtomic ¶
HasAnyAtomic checks if *any* of a set of flags are set for ordinal bit position flags (logical OR) using atomic compare-and-swap loop, safe for concurrent access
func HasAnyAtomic32 ¶
HasAnyAtomic32 checks if *any* of a set of flags are set for ordinal bit position flags (logical OR) using atomic compare-and-swap loop, safe for concurrent access
func HasAnyMask ¶
HasAnyMask checks if *any* of the bits in mask are set (logical OR)
func HasAnyMask32 ¶
HasAnyMask32 checks if *any* of the bits in mask are set (logical OR)
func HasAnyMaskAtomic ¶
HasAnyMaskAtomic checks if *any* of the bits in mask are set (logical OR) using atomic compare-and-swap loop, safe for concurrent access
func HasAnyMaskAtomic32 ¶
HasAnyMaskAtomic32 checks if *any* of the bits in mask are set (logical OR) using atomic compare-and-swap loop, safe for concurrent access
func HasAtomic ¶
HasAtomic checks if given bit value is set for ordinal bit position flag, using an atomic load, safe for concurrent access
func HasAtomic32 ¶
HasAtomic32 checks if given bit value is set for ordinal bit position flag, using an atomic load, safe for concurrent access
func SetAtomic ¶
SetAtomic sets bit value(s) for ordinal bit position flags using atomic compare-and-swap loop, safe for concurrent access
func SetAtomic32 ¶
SetAtomic32 sets bit value(s) for ordinal bit position flags using atomic compare-and-swap loop, safe for concurrent access
func SetMaskAtomic ¶
SetMaskAtomic sets bits in mask using atomic compare-and-swap loop, safe for concurrent access
func SetMaskAtomic32 ¶
SetMaskAtomic32 sets bits in mask using atomic compare-and-swap loop, safe for concurrent access
func SetState ¶
SetState sets or clears bit value(s) depending on state (on / off) for ordinal bit position flags
func SetState32 ¶
SetState32 sets or clears bit value(s) depending on state (on / off) for ordinal bit position flags
func SetStateAtomic ¶
SetStateAtomic sets or clears bit value(s) depending on state (on / off) for ordinal bit position flags, protected by atomic -- safe for concurrent access
func SetStateAtomic32 ¶
SetStateAtomic32 sets or clears bit value(s) depending on state (on / off) for ordinal bit position flags, protected by atomic -- safe for concurrent access
func ToggleAtomic ¶
ToggleAtomic toggles state of bit value(s) for ordinal bit position flags using atomic compare-and-swap loop, safe for concurrent access, but sequentially
func ToggleAtomic32 ¶
ToggleAtomic32 toggles state of bit value(s) for ordinal bit position flags using atomic compare-and-swap loop, safe for concurrent access, but sequentially
Types ¶
This section is empty.