-
Notifications
You must be signed in to change notification settings - Fork 1
/
GetParameters_Request.gen.go
150 lines (122 loc) · 5.34 KB
/
GetParameters_Request.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
This file is part of rclgo
Copyright © 2021 Technology Innovation Institute, United Arab Emirates
Licensed under the Apache License, Version 2.0 (the "License");
http://www.apache.org/licenses/LICENSE-2.0
*/
/*
THIS FILE IS AUTOGENERATED BY 'rclgo-gen generate'
*/
package rcl_interfaces_srv
import (
"unsafe"
"github.com/TIERS/rclgo/pkg/rclgo/types"
"github.com/TIERS/rclgo/pkg/rclgo/typemap"
primitives "github.com/TIERS/rclgo/pkg/rclgo/primitives"
)
/*
#cgo LDFLAGS: -L/opt/ros/foxy/lib -Wl,-rpath=/opt/ros/foxy/lib -lrcl -lrosidl_runtime_c -lrosidl_typesupport_c -lrcutils -lrmw_implementation
#cgo LDFLAGS: -lrcl_interfaces__rosidl_typesupport_c -lrcl_interfaces__rosidl_generator_c
#cgo CFLAGS: -I/opt/ros/foxy/include
#include <rosidl_runtime_c/message_type_support_struct.h>
#include <rcl_interfaces/srv/get_parameters.h>
*/
import "C"
func init() {
typemap.RegisterMessage("rcl_interfaces/GetParameters_Request", GetParameters_RequestTypeSupport)
}
// Do not create instances of this type directly. Always use NewGetParameters_Request
// function instead.
type GetParameters_Request struct {
Names []string `yaml:"names"`// A list of parameter names to get.
}
// NewGetParameters_Request creates a new GetParameters_Request with default values.
func NewGetParameters_Request() *GetParameters_Request {
self := GetParameters_Request{}
self.SetDefaults()
return &self
}
func (t *GetParameters_Request) Clone() *GetParameters_Request {
c := &GetParameters_Request{}
if t.Names != nil {
c.Names = make([]string, len(t.Names))
copy(c.Names, t.Names)
}
return c
}
func (t *GetParameters_Request) CloneMsg() types.Message {
return t.Clone()
}
func (t *GetParameters_Request) SetDefaults() {
t.Names = nil
}
// CloneGetParameters_RequestSlice clones src to dst by calling Clone for each element in
// src. Panics if len(dst) < len(src).
func CloneGetParameters_RequestSlice(dst, src []GetParameters_Request) {
for i := range src {
dst[i] = *src[i].Clone()
}
}
// Modifying this variable is undefined behavior.
var GetParameters_RequestTypeSupport types.MessageTypeSupport = _GetParameters_RequestTypeSupport{}
type _GetParameters_RequestTypeSupport struct{}
func (t _GetParameters_RequestTypeSupport) New() types.Message {
return NewGetParameters_Request()
}
func (t _GetParameters_RequestTypeSupport) PrepareMemory() unsafe.Pointer { //returns *C.rcl_interfaces__srv__GetParameters_Request
return (unsafe.Pointer)(C.rcl_interfaces__srv__GetParameters_Request__create())
}
func (t _GetParameters_RequestTypeSupport) ReleaseMemory(pointer_to_free unsafe.Pointer) {
C.rcl_interfaces__srv__GetParameters_Request__destroy((*C.rcl_interfaces__srv__GetParameters_Request)(pointer_to_free))
}
func (t _GetParameters_RequestTypeSupport) AsCStruct(dst unsafe.Pointer, msg types.Message) {
m := msg.(*GetParameters_Request)
mem := (*C.rcl_interfaces__srv__GetParameters_Request)(dst)
primitives.String__Sequence_to_C((*primitives.CString__Sequence)(unsafe.Pointer(&mem.names)), m.Names)
}
func (t _GetParameters_RequestTypeSupport) AsGoStruct(msg types.Message, ros2_message_buffer unsafe.Pointer) {
m := msg.(*GetParameters_Request)
mem := (*C.rcl_interfaces__srv__GetParameters_Request)(ros2_message_buffer)
primitives.String__Sequence_to_Go(&m.Names, *(*primitives.CString__Sequence)(unsafe.Pointer(&mem.names)))
}
func (t _GetParameters_RequestTypeSupport) TypeSupport() unsafe.Pointer {
return unsafe.Pointer(C.rosidl_typesupport_c__get_message_type_support_handle__rcl_interfaces__srv__GetParameters_Request())
}
type CGetParameters_Request = C.rcl_interfaces__srv__GetParameters_Request
type CGetParameters_Request__Sequence = C.rcl_interfaces__srv__GetParameters_Request__Sequence
func GetParameters_Request__Sequence_to_Go(goSlice *[]GetParameters_Request, cSlice CGetParameters_Request__Sequence) {
if cSlice.size == 0 {
return
}
*goSlice = make([]GetParameters_Request, int64(cSlice.size))
for i := 0; i < int(cSlice.size); i++ {
cIdx := (*C.rcl_interfaces__srv__GetParameters_Request__Sequence)(unsafe.Pointer(
uintptr(unsafe.Pointer(cSlice.data)) + (C.sizeof_struct_rcl_interfaces__srv__GetParameters_Request * uintptr(i)),
))
GetParameters_RequestTypeSupport.AsGoStruct(&(*goSlice)[i], unsafe.Pointer(cIdx))
}
}
func GetParameters_Request__Sequence_to_C(cSlice *CGetParameters_Request__Sequence, goSlice []GetParameters_Request) {
if len(goSlice) == 0 {
return
}
cSlice.data = (*C.rcl_interfaces__srv__GetParameters_Request)(C.malloc((C.size_t)(C.sizeof_struct_rcl_interfaces__srv__GetParameters_Request * uintptr(len(goSlice)))))
cSlice.capacity = C.size_t(len(goSlice))
cSlice.size = cSlice.capacity
for i, v := range goSlice {
cIdx := (*C.rcl_interfaces__srv__GetParameters_Request)(unsafe.Pointer(
uintptr(unsafe.Pointer(cSlice.data)) + (C.sizeof_struct_rcl_interfaces__srv__GetParameters_Request * uintptr(i)),
))
GetParameters_RequestTypeSupport.AsCStruct(unsafe.Pointer(cIdx), &v)
}
}
func GetParameters_Request__Array_to_Go(goSlice []GetParameters_Request, cSlice []CGetParameters_Request) {
for i := 0; i < len(cSlice); i++ {
GetParameters_RequestTypeSupport.AsGoStruct(&goSlice[i], unsafe.Pointer(&cSlice[i]))
}
}
func GetParameters_Request__Array_to_C(cSlice []CGetParameters_Request, goSlice []GetParameters_Request) {
for i := 0; i < len(goSlice); i++ {
GetParameters_RequestTypeSupport.AsCStruct(unsafe.Pointer(&cSlice[i]), &goSlice[i])
}
}