Skip to content

Commit

Permalink
make Timer.IsCanceled/IsReady get-only properties
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmann-stefan committed Dec 3, 2024
1 parent 1b4a601 commit 8523d4c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions rcldotnet/Timer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,24 @@ public void Reset()
RCLExceptionHelper.CheckReturnValue(ret, $"{nameof(TimerDelegates.native_rcl_timer_reset)}() failed.");
}

public bool IsCanceled()
public bool IsCanceled
{
RCLRet ret = TimerDelegates.native_rcl_timer_is_canceled(Handle, out int isCanceled);
RCLExceptionHelper.CheckReturnValue(ret, $"{nameof(TimerDelegates.native_rcl_timer_is_canceled)}() failed.");
return isCanceled != 0;
get
{
RCLRet ret = TimerDelegates.native_rcl_timer_is_canceled(Handle, out int isCanceled);
RCLExceptionHelper.CheckReturnValue(ret, $"{nameof(TimerDelegates.native_rcl_timer_is_canceled)}() failed.");
return isCanceled != 0;
}
}

public bool IsReady()
public bool IsReady
{
RCLRet ret = TimerDelegates.native_rcl_timer_is_ready(Handle, out int isReady);
RCLExceptionHelper.CheckReturnValue(ret, $"{nameof(TimerDelegates.native_rcl_timer_is_ready)}() failed.");
return isReady != 0;
get
{
RCLRet ret = TimerDelegates.native_rcl_timer_is_ready(Handle, out int isReady);
RCLExceptionHelper.CheckReturnValue(ret, $"{nameof(TimerDelegates.native_rcl_timer_is_ready)}() failed.");
return isReady != 0;
}
}

internal SafeTimerHandle Handle { get; }
Expand Down

0 comments on commit 8523d4c

Please sign in to comment.