-
Notifications
You must be signed in to change notification settings - Fork 1
/
ConfigLogger_Response.gen.go
146 lines (118 loc) · 5 KB
/
ConfigLogger_Response.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
/*
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 logging_demo_srv
import (
"unsafe"
"github.com/TIERS/rclgo/pkg/rclgo/types"
"github.com/TIERS/rclgo/pkg/rclgo/typemap"
)
/*
#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: -llogging_demo__rosidl_typesupport_c -llogging_demo__rosidl_generator_c
#cgo CFLAGS: -I/opt/ros/foxy/include
#include <rosidl_runtime_c/message_type_support_struct.h>
#include <logging_demo/srv/config_logger.h>
*/
import "C"
func init() {
typemap.RegisterMessage("logging_demo/ConfigLogger_Response", ConfigLogger_ResponseTypeSupport)
}
// Do not create instances of this type directly. Always use NewConfigLogger_Response
// function instead.
type ConfigLogger_Response struct {
Success bool `yaml:"success"`
}
// NewConfigLogger_Response creates a new ConfigLogger_Response with default values.
func NewConfigLogger_Response() *ConfigLogger_Response {
self := ConfigLogger_Response{}
self.SetDefaults()
return &self
}
func (t *ConfigLogger_Response) Clone() *ConfigLogger_Response {
c := &ConfigLogger_Response{}
c.Success = t.Success
return c
}
func (t *ConfigLogger_Response) CloneMsg() types.Message {
return t.Clone()
}
func (t *ConfigLogger_Response) SetDefaults() {
t.Success = false
}
// CloneConfigLogger_ResponseSlice clones src to dst by calling Clone for each element in
// src. Panics if len(dst) < len(src).
func CloneConfigLogger_ResponseSlice(dst, src []ConfigLogger_Response) {
for i := range src {
dst[i] = *src[i].Clone()
}
}
// Modifying this variable is undefined behavior.
var ConfigLogger_ResponseTypeSupport types.MessageTypeSupport = _ConfigLogger_ResponseTypeSupport{}
type _ConfigLogger_ResponseTypeSupport struct{}
func (t _ConfigLogger_ResponseTypeSupport) New() types.Message {
return NewConfigLogger_Response()
}
func (t _ConfigLogger_ResponseTypeSupport) PrepareMemory() unsafe.Pointer { //returns *C.logging_demo__srv__ConfigLogger_Response
return (unsafe.Pointer)(C.logging_demo__srv__ConfigLogger_Response__create())
}
func (t _ConfigLogger_ResponseTypeSupport) ReleaseMemory(pointer_to_free unsafe.Pointer) {
C.logging_demo__srv__ConfigLogger_Response__destroy((*C.logging_demo__srv__ConfigLogger_Response)(pointer_to_free))
}
func (t _ConfigLogger_ResponseTypeSupport) AsCStruct(dst unsafe.Pointer, msg types.Message) {
m := msg.(*ConfigLogger_Response)
mem := (*C.logging_demo__srv__ConfigLogger_Response)(dst)
mem.success = C.bool(m.Success)
}
func (t _ConfigLogger_ResponseTypeSupport) AsGoStruct(msg types.Message, ros2_message_buffer unsafe.Pointer) {
m := msg.(*ConfigLogger_Response)
mem := (*C.logging_demo__srv__ConfigLogger_Response)(ros2_message_buffer)
m.Success = bool(mem.success)
}
func (t _ConfigLogger_ResponseTypeSupport) TypeSupport() unsafe.Pointer {
return unsafe.Pointer(C.rosidl_typesupport_c__get_message_type_support_handle__logging_demo__srv__ConfigLogger_Response())
}
type CConfigLogger_Response = C.logging_demo__srv__ConfigLogger_Response
type CConfigLogger_Response__Sequence = C.logging_demo__srv__ConfigLogger_Response__Sequence
func ConfigLogger_Response__Sequence_to_Go(goSlice *[]ConfigLogger_Response, cSlice CConfigLogger_Response__Sequence) {
if cSlice.size == 0 {
return
}
*goSlice = make([]ConfigLogger_Response, int64(cSlice.size))
for i := 0; i < int(cSlice.size); i++ {
cIdx := (*C.logging_demo__srv__ConfigLogger_Response__Sequence)(unsafe.Pointer(
uintptr(unsafe.Pointer(cSlice.data)) + (C.sizeof_struct_logging_demo__srv__ConfigLogger_Response * uintptr(i)),
))
ConfigLogger_ResponseTypeSupport.AsGoStruct(&(*goSlice)[i], unsafe.Pointer(cIdx))
}
}
func ConfigLogger_Response__Sequence_to_C(cSlice *CConfigLogger_Response__Sequence, goSlice []ConfigLogger_Response) {
if len(goSlice) == 0 {
return
}
cSlice.data = (*C.logging_demo__srv__ConfigLogger_Response)(C.malloc((C.size_t)(C.sizeof_struct_logging_demo__srv__ConfigLogger_Response * uintptr(len(goSlice)))))
cSlice.capacity = C.size_t(len(goSlice))
cSlice.size = cSlice.capacity
for i, v := range goSlice {
cIdx := (*C.logging_demo__srv__ConfigLogger_Response)(unsafe.Pointer(
uintptr(unsafe.Pointer(cSlice.data)) + (C.sizeof_struct_logging_demo__srv__ConfigLogger_Response * uintptr(i)),
))
ConfigLogger_ResponseTypeSupport.AsCStruct(unsafe.Pointer(cIdx), &v)
}
}
func ConfigLogger_Response__Array_to_Go(goSlice []ConfigLogger_Response, cSlice []CConfigLogger_Response) {
for i := 0; i < len(cSlice); i++ {
ConfigLogger_ResponseTypeSupport.AsGoStruct(&goSlice[i], unsafe.Pointer(&cSlice[i]))
}
}
func ConfigLogger_Response__Array_to_C(cSlice []CConfigLogger_Response, goSlice []ConfigLogger_Response) {
for i := 0; i < len(goSlice); i++ {
ConfigLogger_ResponseTypeSupport.AsCStruct(unsafe.Pointer(&cSlice[i]), &goSlice[i])
}
}