combine internal.proto and model.proto
parent
0833105371
commit
853a45296f
|
@ -1,5 +1,5 @@
|
||||||
// Code generated by protoc-gen-go.
|
// Code generated by protoc-gen-go.
|
||||||
// source: binary/model.proto
|
// source: cache/binary/messages.proto
|
||||||
// DO NOT EDIT!
|
// DO NOT EDIT!
|
||||||
|
|
||||||
package binary
|
package binary
|
||||||
|
@ -172,6 +172,38 @@ func (m *Relation) GetMemberRoles() []string {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DeltaCoords struct {
|
||||||
|
Ids []int64 `protobuf:"zigzag64,1,rep,packed,name=ids" json:"ids,omitempty"`
|
||||||
|
Lats []int64 `protobuf:"zigzag64,2,rep,packed,name=lats" json:"lats,omitempty"`
|
||||||
|
Lons []int64 `protobuf:"zigzag64,3,rep,packed,name=lons" json:"lons,omitempty"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DeltaCoords) Reset() { *m = DeltaCoords{} }
|
||||||
|
func (m *DeltaCoords) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*DeltaCoords) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (m *DeltaCoords) GetIds() []int64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.Ids
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DeltaCoords) GetLats() []int64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.Lats
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DeltaCoords) GetLons() []int64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.Lons
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterEnum("binary.Relation_MemberType", Relation_MemberType_name, Relation_MemberType_value)
|
proto.RegisterEnum("binary.Relation_MemberType", Relation_MemberType_name, Relation_MemberType_value)
|
||||||
}
|
}
|
|
@ -27,3 +27,9 @@ message Relation {
|
||||||
repeated MemberType member_types = 4;
|
repeated MemberType member_types = 4;
|
||||||
repeated string member_roles = 5;
|
repeated string member_roles = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message DeltaCoords {
|
||||||
|
repeated sint64 ids = 1 [packed = true];
|
||||||
|
repeated sint64 lats = 2 [packed = true];
|
||||||
|
repeated sint64 lons = 3 [packed = true];
|
||||||
|
}
|
|
@ -15,7 +15,7 @@ func (s Nodes) Len() int { return len(s) }
|
||||||
func (s Nodes) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
func (s Nodes) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||||
func (s Nodes) Less(i, j int) bool { return s[i].Id < s[j].Id }
|
func (s Nodes) Less(i, j int) bool { return s[i].Id < s[j].Id }
|
||||||
|
|
||||||
func packNodes(nodes []element.Node) *DeltaCoords {
|
func packNodes(nodes []element.Node) *binary.DeltaCoords {
|
||||||
var lastLon, lastLat int64
|
var lastLon, lastLat int64
|
||||||
var lon, lat int64
|
var lon, lat int64
|
||||||
var lastId int64
|
var lastId int64
|
||||||
|
@ -36,10 +36,10 @@ func packNodes(nodes []element.Node) *DeltaCoords {
|
||||||
lastLat = lat
|
lastLat = lat
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
return &DeltaCoords{Ids: ids, Lats: lats, Lons: lons}
|
return &binary.DeltaCoords{Ids: ids, Lats: lats, Lons: lons}
|
||||||
}
|
}
|
||||||
|
|
||||||
func unpackNodes(deltaCoords *DeltaCoords, nodes []element.Node) []element.Node {
|
func unpackNodes(deltaCoords *binary.DeltaCoords, nodes []element.Node) []element.Node {
|
||||||
if len(deltaCoords.Ids) > cap(nodes) {
|
if len(deltaCoords.Ids) > cap(nodes) {
|
||||||
nodes = make([]element.Node, len(deltaCoords.Ids))
|
nodes = make([]element.Node, len(deltaCoords.Ids))
|
||||||
} else {
|
} else {
|
||||||
|
@ -214,7 +214,7 @@ func (p *DeltaCoordsCache) getCoordsPacked(bunchId int64, nodes []element.Node)
|
||||||
// clear before returning
|
// clear before returning
|
||||||
return nodes[:0], nil
|
return nodes[:0], nil
|
||||||
}
|
}
|
||||||
deltaCoords := &DeltaCoords{}
|
deltaCoords := &binary.DeltaCoords{}
|
||||||
err = proto.Unmarshal(data, deltaCoords)
|
err = proto.Unmarshal(data, deltaCoords)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
// Code generated by protoc-gen-go.
|
|
||||||
// source: cache/internal.proto
|
|
||||||
// DO NOT EDIT!
|
|
||||||
|
|
||||||
package cache
|
|
||||||
|
|
||||||
import proto "code.google.com/p/goprotobuf/proto"
|
|
||||||
import json "encoding/json"
|
|
||||||
import math "math"
|
|
||||||
|
|
||||||
// Reference proto, json, and math imports to suppress error if they are not otherwise used.
|
|
||||||
var _ = proto.Marshal
|
|
||||||
var _ = &json.SyntaxError{}
|
|
||||||
var _ = math.Inf
|
|
||||||
|
|
||||||
type DeltaCoords struct {
|
|
||||||
Ids []int64 `protobuf:"zigzag64,1,rep,packed,name=ids" json:"ids,omitempty"`
|
|
||||||
Lats []int64 `protobuf:"zigzag64,2,rep,packed,name=lats" json:"lats,omitempty"`
|
|
||||||
Lons []int64 `protobuf:"zigzag64,3,rep,packed,name=lons" json:"lons,omitempty"`
|
|
||||||
XXX_unrecognized []byte `json:"-"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *DeltaCoords) Reset() { *m = DeltaCoords{} }
|
|
||||||
func (m *DeltaCoords) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*DeltaCoords) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (m *DeltaCoords) GetIds() []int64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.Ids
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *DeltaCoords) GetLats() []int64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.Lats
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *DeltaCoords) GetLons() []int64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.Lons
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
package cache;
|
|
||||||
|
|
||||||
message DeltaCoords {
|
|
||||||
repeated sint64 ids = 1 [packed = true];
|
|
||||||
repeated sint64 lats = 2 [packed = true];
|
|
||||||
repeated sint64 lons = 3 [packed = true];
|
|
||||||
}
|
|
Loading…
Reference in New Issue