// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#include "Precompiled.h"
#include "SharedIncludes.h"
namespace RuntimeForStatic {
//==================================================================================================

void $Tracer::Trace() $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::Trace() );
}
void $Tracer::Trace($A,PCWSTR message) $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::Trace($ci, message ) );
}
void $Tracer::TraceFmt($A,PCWSTR messageFmt, ... ) $fatal_error_on_failure
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   TraceVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
}
void $Tracer::TraceVA($A,PCWSTR messageFmt,va_list argList) $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceVA($ci, messageFmt, argList ) );
}

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

bool $Tracer::TraceInformation() $ret_true $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceInformation() );
   return true;
}
bool $Tracer::TraceInformation($A,PCWSTR message) $ret_true $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceInformation($ci, message ) );
   return true;
}
bool $Tracer::TraceInformationFmt($A,PCWSTR messageFmt, ... ) $ret_true $fatal_error_on_failure
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   TraceInformationVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return true;
}
bool $Tracer::TraceInformationVA($A,PCWSTR messageFmt,va_list argList) $ret_true
                                                                       $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceInformationVA($ci, messageFmt, argList ) );
   return true;
}

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

bool $Tracer::TraceWarning() $ret_true $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceWarning() );
   return true;
}
bool $Tracer::TraceWarning($A,PCWSTR message) $ret_true $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceWarning($ci, message ) );
   return true;
}
bool $Tracer::TraceWarningFmt($A,PCWSTR messageFmt, ... ) $ret_true $fatal_error_on_failure
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   TraceWarningVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return true;
}
bool $Tracer::TraceWarningVA($A,PCWSTR messageFmt,va_list argList) $ret_true
                                                                   $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceWarningVA($ci, messageFmt, argList ) );
   return true;
}

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

bool $Tracer::TraceError() $ret_true $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceError() );
   return false;
}
bool $Tracer::TraceError($A,PCWSTR message) $ret_true $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceError($ci, message ) );
   return false;
}
bool $Tracer::TraceErrorFmt($A,PCWSTR messageFmt, ... ) $ret_true $fatal_error_on_failure
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   TraceErrorVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}
bool $Tracer::TraceErrorVA($A,PCWSTR messageFmt,va_list argList) $ret_true $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceErrorVA($ci, messageFmt, argList ) );
   return false;
}

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

void $Tracer::TraceOperation($A,PCWSTR message) $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceOperation($ci, message ) );
}
void $Tracer::TraceOperationFmt($A,PCWSTR messageFmt, ... ) $fatal_error_on_failure
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   TraceOperationVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
}
void $Tracer::TraceOperationVA($A,PCWSTR messageFmt,va_list argList) $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceOperationVA($ci, messageFmt, argList ) );
}

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

void $Tracer::TraceInFunction($A,PCWSTR funcNameOrSignature) $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceInFunction($ci, funcNameOrSignature ) );
}
void $Tracer::TraceOutOfFunction($A,PCWSTR funcNameOrSignature) $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceOutOfFunction($ci, funcNameOrSignature ) );
}

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

void $Tracer::TraceEx($A,$TraceMessageType messageType) $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceEx($ci, messageType ) );
}
void $Tracer::TraceEx($A,$TraceMessageType messageType,PCWSTR message) $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceEx($ci, messageType, message ) );
}
void $Tracer::TraceExFmt($A, $TraceMessageType messageType, PCWSTR messageFmt, ... )
                             $fatal_error_on_failure
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   TraceExVA($ci, messageType, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
}
void $Tracer::TraceExVA($A, $TraceMessageType messageType, PCWSTR messageFmt, va_list argList )
                            $fatal_error_on_failure
{
   VerifyStatus( HelpersRT::TraceExVA($ci, messageType, messageFmt, argList ) );
}

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

void $Tracer::VerifyStatus($Status status) $fatal_error_on_failure
{
   if ( $FAILURE( status ) )
      $FATAL_ERROR( HelpersRT::TraceErrorToMessage( status ) );
}

//==================================================================================================
} // RuntimeForStatic
