Skip to content

Commit

Permalink
feat: implement Packet<T>.At (#1136)
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler committed Jan 28, 2024
1 parent 87b8fdd commit d397429
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,16 @@ protected override void DeleteMpPtr()
UnsafeNativeMethods.mp_Packet__delete(ptr);
}

public Packet<TValue> At(Timestamp timestamp)
{
UnsafeNativeMethods.mp_Packet__At__Rt(mpPtr, timestamp.mpPtr, out var packetPtr).Assert();
GC.KeepAlive(this);
GC.KeepAlive(timestamp);

Dispose();
return new Packet<TValue>(packetPtr, true);
}

public long TimestampMicroseconds()
{
var value = SafeNativeMethods.mp_Packet__TimestampMicroseconds(mpPtr);
Expand Down

0 comments on commit d397429

Please sign in to comment.