mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-12 23:43:44 +08:00
ab81464bd1
Add navigation and map matching providers with the vendored map service sources. Co-authored-by: Daniel Koepping <elkoled@gmail.com> Co-authored-by: Danny <dannyirwin31@yahoo.com> Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu> Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
31 lines
514 B
Go
31 lines
514 B
Go
package gomsgq
|
|
|
|
type Pointer struct {
|
|
Position uint64
|
|
Cycles uint64
|
|
}
|
|
|
|
func (p *Pointer) Marshal() uint64 {
|
|
return p.Position | (p.Cycles << 32)
|
|
}
|
|
|
|
func (p *Pointer) Cycle() {
|
|
p.Position = 0
|
|
p.Cycles++
|
|
}
|
|
|
|
func (p *Pointer) Next(size int64) Pointer {
|
|
newPosition := p.Position + uint64(size) + uint64(align(size)) + 8
|
|
return Pointer{
|
|
Position: newPosition,
|
|
Cycles: p.Cycles,
|
|
}
|
|
}
|
|
|
|
func NewPointer(value uint64) Pointer {
|
|
return Pointer{
|
|
Position: value & 0xFFFFFFFF,
|
|
Cycles: value >> 32,
|
|
}
|
|
}
|