Table of Contents

Struct SharedPtr<T>

Namespace
Misaki.HighPerformance.LowLevel
Assembly
Misaki.HighPerformance.LowLevel.dll

Represents a strongly-typed, read-only pointer to an unmanaged value of type T.

public readonly struct SharedPtr<T> : IEquatable<SharedPtr<T>> where T : unmanaged

Type Parameters

T

The unmanaged type to which the pointer refers.

Implements
Inherited Members

Remarks

When a pointer is wrapped in this struct, it indicates that the code does not intend to manage the lifetime of the data being pointed to.

Constructors

SharedPtr(T*)

public SharedPtr(T* value)

Parameters

value T*

Methods

Equals(SharedPtr<T>)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(SharedPtr<T> other)

Parameters

other SharedPtr<T>

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Get()

public T* Get()

Returns

T*

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

GetRef()

public ref T GetRef()

Returns

T

Operators

operator ==(SharedPtr<T>, SharedPtr<T>)

public static bool operator ==(SharedPtr<T> left, SharedPtr<T> right)

Parameters

left SharedPtr<T>
right SharedPtr<T>

Returns

bool

implicit operator T*(SharedPtr<T>)

public static implicit operator T*(SharedPtr<T> ptr)

Parameters

ptr SharedPtr<T>

Returns

T*

implicit operator SharedPtr<T>(T*)

public static implicit operator SharedPtr<T>(T* value)

Parameters

value T*

Returns

SharedPtr<T>

operator !=(SharedPtr<T>, SharedPtr<T>)

public static bool operator !=(SharedPtr<T> left, SharedPtr<T> right)

Parameters

left SharedPtr<T>
right SharedPtr<T>

Returns

bool