m3path

package
v0.0.0-...-e2be02a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2021 License: GPL-3.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ConnectionMaskBits   = 4
	ConnectionStateMask  = uint16(0x0003)
	SingleConnectionMask = uint16(0x000F)
)
View Source
const (
	NewPathNodeId         m3point.Int64Id = -1
	InPoolId              m3point.Int64Id = -2
	LinkIdNotSet          m3point.Int64Id = -3
	DeadEndId             m3point.Int64Id = -4
	NextLinkIdNotAssigned m3point.Int64Id = -5
)
View Source
const NbConnections = 3

Variables

View Source
var Log = m3util.NewLogger("m3path", m3util.INFO)
View Source
var NilPathPoint = PathPoint{
	Id: NilPointId,
	P:  m3point.Origin,
}

Functions

func CalculatePredictedSize

func CalculatePredictedSize(growthType m3point.GrowthType, d int) int

func GetConnectionMaskValue

func GetConnectionMaskValue(connectionMask uint16, connIdx int) uint16

func SetConnectionState

func SetConnectionState(connectionMask uint16, connIdx int, state ConnectionState) uint16

Types

type ConnectionState

type ConnectionState uint16
const (
	ConnectionNotSet  ConnectionState = 0x0000
	ConnectionFrom    ConnectionState = 0x0001
	ConnectionNext    ConnectionState = 0x0002
	ConnectionBlocked ConnectionState = 0x0003
)

func GetConnectionState

func GetConnectionState(connectionMask uint16, connIdx int) ConnectionState

type ConnectionStateIfc

type ConnectionStateIfc interface {
	GetTrioIndex() m3point.TrioIndex
	GetTrioDetails(pointData m3point.PointPackDataIfc) *m3point.TrioDetails

	HasOpenConnections() bool
	IsFrom(connIdx int) bool
	IsNext(connIdx int) bool
	IsDeadEnd(connIdx int) bool
}

type PathContext

type PathContext interface {
	fmt.Stringer
	GetId() PathContextId
	GetGrowthCtx() m3point.GrowthContext
	GetGrowthType() m3point.GrowthType
	GetGrowthIndex() int
	GetGrowthOffset() int
	GetRootPathNode() PathNode

	GetMaxDist() int
	RequestNewMaxDist(requestDist int) error

	GetNumberOfNodesAt(dist int) int
	GetPathNodesAt(dist int) ([]PathNode, error)

	GetNumberOfNodesBetween(fromDist int, toDist int) int
	GetPathNodesBetween(fromDist, toDist int) ([]PathNode, error)

	DumpInfo() string
}

type PathContextId

type PathContextId m3point.Int32Id

func (PathContextId) MurmurHash

func (id PathContextId) MurmurHash() uint32

type PathNode

type PathNode interface {
	fmt.Stringer
	ConnectionStateIfc

	GetId() PathNodeId
	GetPathContext() PathContext

	IsRoot() bool
	P() m3point.Point
	D() int
}

type PathNodeId

type PathNodeId m3point.Int64Id

func (PathNodeId) MurmurHash

func (id PathNodeId) MurmurHash() uint32

type PathPackDataIfc

type PathPackDataIfc interface {
	m3util.QsmDataPack
	GetPathCtx(id PathContextId) PathContext
	GetPathCtxFromAttributes(growthType m3point.GrowthType, growthIndex int, growthOffset int) (PathContext, error)
}

type PathPoint

type PathPoint struct {
	Id PointId
	P  m3point.Point
}

func (PathPoint) String

func (pp PathPoint) String() string

type PathPointMap

type PathPointMap struct {
	// contains filtered or unexported fields
}

func MakePathPointMap

func MakePathPointMap(initSize int) *PathPointMap

func (*PathPointMap) AddToMap

func (ppm *PathPointMap) AddToMap(pointId PointId, point m3point.Point) *PathPoint

func (*PathPointMap) GetById

func (ppm *PathPointMap) GetById(pointId PointId) (*PathPoint, bool)

func (*PathPointMap) GetByPoint

func (ppm *PathPointMap) GetByPoint(point m3point.Point) (*PathPoint, bool)

type PointId

type PointId m3point.Int64Id
const (
	NilPointId PointId = -1
)

func (PointId) MurmurHash

func (id PointId) MurmurHash() uint32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL