//**************************************************************************************************
//
// ARGUMENT CHECKING/REVOCATION WITH “TCI” (TAGGED CALLER INFO) — PREPROCESSOR:
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#pragma once
#include "include_restrictions.h"

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// ARGUMENT VERIFICATION:
//
//==================================================================================================
// DISCARDABLE VERIFICATIONS:

#ifndef $EXCLUDE_VERIFICATION
   #define $TCI_VERIFY_NOT_ZERO_ARG( argValue ) \
      RuntimeForStatic::$ArgChecking::VerifyNotZero($TCI, $NAME_N_ARG_OF(argValue) )
   #define $TCI_VERIFY_NOT_ZERO_SIZE_ARG( argValue ) \
      RuntimeForStatic::$ArgChecking::VerifyNotZero_Size($TCI, $NAME_N_ARG_OF(argValue) )
   #define $TCI_VERIFY_NOT_NEGATIVE_VALUE_ARG( argValue ) \
      RuntimeForStatic::$ArgChecking::VerifyNotNegative($TCI, $NAME_N_ARG_OF(argValue) )
   #define $TCI_VERIFY_POSITIVE_VALUE_ARG( argValue ) \
      RuntimeForStatic::$ArgChecking::VerifyPositive($TCI, $NAME_N_ARG_OF(argValue) )
   #define $TCI_VERIFY_POINTER_ARG( pointerArg ) \
      RuntimeForStatic::$ArgChecking::VerifyPointer($TCI, \
         $NAME_OF(pointerArg), ($PCVoid)(pointerArg) )
   #define $TCI_VERIFY_HANDLE_ARG( handleArg ) \
      RuntimeForStatic::$ArgChecking::VerifyHandle($TCI, $NAME_N_ARG_OF(handleArg) )
   #define $TCI_VERIFY_HANDLE_ARG_IV( handleArg ) \
      RuntimeForStatic::$ArgChecking::VerifyHandle($TCI, $NAME_N_ARG_OF(handleArg), true )
   #define $TCI_VERIFY_HANDLE_ARG_EX( handleArg, isOfInvalidHandleValueCategory ) \
      RuntimeForStatic::$ArgChecking::VerifyHandleArgumentEx($TCI, \
         $NAME_N_ARG_OF(handleArg), (isOfInvalidHandleValueCategory) )
   #define $TCI_VERIFY_DISPOSABLE_ARG( disposable ) \
      RuntimeForStatic::$ArgChecking::VerifyDisposable($TCI, $NAME_N_ARG_OF(disposable) )
#else
   #define $TCI_VERIFY_NOT_ZERO_ARG( argValue )                                     $VOID_VALUE
   #define $TCI_VERIFY_NOT_ZERO_SIZE_ARG( argValue )                                $VOID_VALUE
   #define $TCI_VERIFY_NOT_NEGATIVE_VALUE_ARG( argValue )                           $VOID_VALUE
   #define $TCI_VERIFY_POSITIVE_VALUE_ARG( argValue )                               $VOID_VALUE
   #define $TCI_VERIFY_POINTER_ARG( pointerArg )                                    $VOID_VALUE
   #define $TCI_VERIFY_HANDLE_ARG( handleArg )                                      $VOID_VALUE
   #define $TCI_VERIFY_HANDLE_ARG_IV( handleArg )                                   $VOID_VALUE
   #define $TCI_VERIFY_HANDLE_ARG_EX( handleArg, isOfInvalidHandleValueCategory )   $VOID_VALUE
   #define $TCI_VERIFY_DISPOSABLE_ARG( disposable )                                 $VOID_VALUE
#endif // $EXCLUDE_VERIFICATION

//--------------------------------------------------------------------------------------------------
// NON-DISCARDABLE VERIFICATIONS:

#define $$TCI_VERIFY_NOT_ZERO_ARG( argValue ) \
   RuntimeForStatic::$ArgChecking::VerifyNotZero($$TCI, $NAME_N_ARG_OF(argValue) )
#define $$TCI_VERIFY_NOT_ZERO_SIZE_ARG( argValue ) \
   RuntimeForStatic::$ArgChecking::VerifyNotZero_Size($$TCI, $NAME_N_ARG_OF(argValue) )
#define $$TCI_VERIFY_NOT_NEGATIVE_VALUE_ARG( argValue ) \
   RuntimeForStatic::$ArgChecking::VerifyNotNegative($$TCI, $NAME_N_ARG_OF(argValue) )
#define $$TCI_VERIFY_POSITIVE_VALUE_ARG( argValue ) \
   RuntimeForStatic::$ArgChecking::VerifyPositive($$TCI, $NAME_N_ARG_OF(argValue) )
#define $$TCI_VERIFY_POINTER_ARG( pointerArg ) \
   RuntimeForStatic::$ArgChecking::VerifyPointer($$TCI, \
      $NAME_OF(pointerArg), ($PCVoid)(pointerArg) )
#define $$TCI_VERIFY_HANDLE_ARG( handleArg ) \
   RuntimeForStatic::$ArgChecking::VerifyHandle($$TCI, $NAME_N_ARG_OF(handleArg) )
#define $$TCI_VERIFY_HANDLE_ARG_IV( handleArg ) \
   RuntimeForStatic::$ArgChecking::VerifyHandle($$TCI, $NAME_N_ARG_OF(handleArg), true )
#define $$TCI_VERIFY_HANDLE_ARG_EX( handleArg, isOfInvalidHandleValueCategory ) \
   RuntimeForStatic::$ArgChecking::VerifyHandleArgumentEx($$TCI, \
      $NAME_N_ARG_OF(handleArg), (isOfInvalidHandleValueCategory) )
#define $$TCI_VERIFY_DISPOSABLE_ARG( disposable ) \
   RuntimeForStatic::$ArgChecking::VerifyDisposable($$TCI, $NAME_N_ARG_OF(disposable) )

//==================================================================================================
