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++ } }
func NewStatusCodeList(s *C.Segment, sz int) StatusCode_List { return StatusCode_List(s.NewUInt16List(sz)) }
func NewJobMsgList(s *C.Segment, sz int) JobMsg_List { return JobMsg_List(s.NewUInt16List(sz)) }
func NewElementSizeList(s *C.Segment, sz int) ElementSize_List { return ElementSize_List(s.NewUInt16List(sz)) }
func NewVoteEnumList(s *C.Segment, sz int) VoteEnum_List { return VoteEnum_List(s.NewUInt16List(sz)) }