createNativeResolver method

  1. @override
  2. @protected
lsl_continuous_resolver createNativeResolver()
override

Creates the native continuous resolver. Called exactly once, by create.

Implementation

@override
@protected
lsl_continuous_resolver createNativeResolver() {
  // liblsl copies both strings into its query, so they can be freed here.
  final nativeProperty = property.lslName.toNativeUtf8(allocator: allocate);
  final nativeValue = value.toNativeUtf8(allocator: allocate);
  try {
    return lsl_create_continuous_resolver_byprop(
      nativeProperty.cast<Char>(),
      nativeValue.cast<Char>(),
      forgetAfter,
    );
  } finally {
    nativeProperty.free();
    nativeValue.free();
  }
}