Protocol.fromPointer constructor
Implementation
factory Protocol.fromPointer(Pointer<Void> ptr) {
if (ptr == nullptr) {
throw 'Can\'t initialize a Protocol with nullptr';
}
int key = ptr.address;
if (_cache.containsKey(key)) {
return _cache[key]!; // Use cache
} else {
String selName = protocol_getName(ptr).toDartString();
return Protocol._internal(selName, ptr); // Save to cache
}
}