File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ export LCM,
23
23
encode,
24
24
decode,
25
25
decode!,
26
+ size_fields, # deprecated
27
+ check_valid, # deprecated
28
+ fingerprint, # will soon no longer be exported
26
29
subscribe,
27
30
unsubscribe,
28
31
handle,
Original file line number Diff line number Diff line change 158
158
end
159
159
160
160
function checkfingerprint (io:: IO , :: Type{T} ) where T<: LCMType
161
- decodefield (io, Int64) == fingerprint (T) || throw (FingerprintException (T))
161
+ fp = fingerprint (T)
162
+ fpint = fp isa Int64 ? fp : ntoh (reinterpret (Int64, Vector (fp))[1 ]) # TODO : remove for next release; fingerprints are now Int64s
163
+ decodefield (io, Int64) == fpint || throw (FingerprintException (T))
162
164
end
163
165
164
166
# Resizing
@@ -193,13 +195,13 @@ end
193
195
end
194
196
end
195
197
196
- # checkvalid
198
+ # check_valid
197
199
"""
198
- checkvalid (x::LCMType)
200
+ check_valid (x::LCMType)
199
201
200
202
Check that `x` is a valid LCM type. For example, check that array lengths are correct.
201
203
"""
202
- @generated function checkvalid (x:: T ) where T<: LCMType
204
+ @generated function check_valid (x:: T ) where T<: LCMType
203
205
exprs = Expr[]
204
206
for fieldname in fieldnames (T)
205
207
F = fieldtype (T, fieldname)
315
317
encode_exprs[i] = :(encodefield (io, x.$ fieldname))
316
318
end
317
319
quote
318
- checkvalid (x)
320
+ check_valid (x)
319
321
$ (encode_exprs... )
320
322
io
321
323
end
@@ -447,3 +449,7 @@ macro lcmtypesetup(lcmt, dimensioninfos...)
447
449
$ fingerprint
448
450
end )
449
451
end
452
+
453
+ # Deprecations and transition methods
454
+ Base. @deprecate size_fields (:: Type{T} ) where {T<: LCMType } sizefields (T)
455
+ sizefields (:: Type{T} ) where {T} = size_fields (T)
You can’t perform that action at this time.
0 commit comments