MCPcopy Create free account
hub / github.com/FastLED/FastLED / get

Method get

src/fl/remote/rpc/rpc.h:268–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 /// Returns BindResult containing typed callable, or error if not found or signature mismatch.
267 template<class Sig>
268 BindResult<Sig> get(const char* name) const {
269 fl::string key(name);
270 auto it = mRegistry.find(key);
271 if (it == mRegistry.end()) {
272 return BindResult<Sig>(fl::expected<RpcFn<Sig>, BindError>::failure(BindError::NotFound));
273 }
274 if (it->second.mTypeTag != detail::TypeTag<Sig>::id()) {
275 return BindResult<Sig>(fl::expected<RpcFn<Sig>, BindError>::failure(BindError::SignatureMismatch));
276 }
277 auto* holder = static_cast<detail::TypedCallableHolder<Sig>*>(
278 it->second.mTypedCallable.get());
279 if (!holder) {
280 return BindResult<Sig>(fl::expected<RpcFn<Sig>, BindError>::failure(BindError::NotFound));
281 }
282 return BindResult<Sig>(holder->mFn);
283 }
284
285 /// Check if a method is registered (regardless of signature).
286 bool has(const char* name) const {

Callers

nothing calls this directly

Calls 3

idClass · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected