コード例 #1
0
func (sts *SimpleTxnSubmitter) setAllocations(allocIdx int, rmIdToActionIndices map[common.RMId]*[]int, allocations *msgs.Allocation_List, seg *capn.Segment, active bool, rmIds []common.RMId) {
	for _, rmId := range rmIds {
		actionIndices := *(rmIdToActionIndices[rmId])
		sort.Ints(actionIndices)
		allocation := allocations.At(allocIdx)
		allocation.SetRmId(uint32(rmId))
		actionIndicesCap := seg.NewUInt16List(len(actionIndices))
		allocation.SetActionIndices(actionIndicesCap)
		for k, v := range actionIndices {
			actionIndicesCap.Set(k, uint16(v))
		}
		if active {
			allocation.SetActive(sts.connections[rmId].BootCount())
		} else {
			allocation.SetActive(0)
		}
		allocIdx++
	}
}
コード例 #2
0
ファイル: interface.capnp.go プロジェクト: gtfierro/giles2
func NewStatusCodeList(s *C.Segment, sz int) StatusCode_List {
	return StatusCode_List(s.NewUInt16List(sz))
}
コード例 #3
0
ファイル: zjob.capnp.go プロジェクト: robmurtha/goq
func NewJobMsgList(s *C.Segment, sz int) JobMsg_List { return JobMsg_List(s.NewUInt16List(sz)) }
コード例 #4
0
ファイル: schema.capnp.go プロジェクト: hodduc/go-capnproto
func NewElementSizeList(s *C.Segment, sz int) ElementSize_List {
	return ElementSize_List(s.NewUInt16List(sz))
}
コード例 #5
0
func NewVoteEnumList(s *C.Segment, sz int) VoteEnum_List { return VoteEnum_List(s.NewUInt16List(sz)) }