getPointer<T> method

SharedPointer<T> getPointer<T>()

Returns the SharedPointer for memoryAddress and type.

Implementation

SharedPointer<T> getPointer<T>() {
  var type = this.type;
  if (type == null) {
    throw StateError("Null type. Can't automatically handle pointer.");
  } else if (type == SharedPointerUint32) {
    return SharedPointerUint32.fromAddress(this) as SharedPointer<T>;
  } else if (type == SharedPointerUint64) {
    return SharedPointerUint64.fromAddress(this) as SharedPointer<T>;
  } else if (type == SharedPointerUInt8List) {
    return SharedPointerUInt8List.fromAddress(this) as SharedPointer<T>;
  } else if (type == SharedPointerUInt32List) {
    return SharedPointerUInt32List.fromAddress(this) as SharedPointer<T>;
  } else if (type == SharedPointerUInt64List) {
    return SharedPointerUInt64List.fromAddress(this) as SharedPointer<T>;
  } else {
    throw StateError("Can't automatically handle pointer type: $type");
  }
}