//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// CommonHelpers satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#nullable enable
using System;
using System.Runtime.CompilerServices;

#if !WASM
namespace CommonHelpers {
#else
namespace CommonHelpers.WASM {
#endif

//**************************************************************************************************
/// <summary>
/// Non-nullable property support for inheritance (strict access to underlying value)
/// </summary>
public abstract class HPropertyNNBase {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="ArgumentNullException" />
/// <exception cref="NullReferenceException" />
[HStrictResult]
protected T Get<T>( T? value,
                    [CallerMemberName] string? propertyName=null )
where T: class =>
   HPropertyNN.Get<T>( this, value, propertyName );

/// <exception cref="ArgumentNullException" />
/// <exception cref="HNullValueException" />
[HStrictResult]
protected T Value<T>( T? nullableValue,
                      [CallerMemberName] string? propertyName=null )
where T: struct =>
   HPropertyNN.Value<T>( this, nullableValue, propertyName );

//--------------------------------------------------------------------------------------------------

/// <exception cref="ArgumentNullException" />
/// <exception cref="ArgumentException" />
public static string name_auto( [CallerMemberName] string? propertyName=null ) =>
   HPropertyNN.NameAuto( propertyName );

/// <exception cref="ArgumentNullException" />
/// <exception cref="ArgumentException" />
public static string name_auto_n( [CallerMemberName] string? propertyName=null ) =>
   HPropertyNN.NameAutoN( propertyName );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HPropertyNNBase
//**************************************************************************************************

} // CommonHelpers (.WASM)
