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

bool $TracerNS::Trace() $last_error
{
   return StatusToResultSetError( HelpersRT::Trace() );
}
bool $TracerNS::Trace($A,PCWSTR message) $last_error
{
   return StatusToResultSetError( HelpersRT::Trace($ci, message ) );
}
bool $TracerNS::TraceFmt($A,PCWSTR messageFmt, ... ) $last_error
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   auto status = TraceVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return $SUCCESS( status );
}
bool $TracerNS::TraceVA($A,PCWSTR messageFmt,va_list argList) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceVA($ci, messageFmt, argList ) );
}

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

bool $TracerNS::TraceInformation() $last_error
{
   return StatusToResultSetError( HelpersRT::TraceInformation() );
}
bool $TracerNS::TraceInformation($A,PCWSTR message) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceInformation($ci, message ) );
}
bool $TracerNS::TraceInformationFmt($A,PCWSTR messageFmt, ... ) $last_error
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   auto status = TraceInformationVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return $SUCCESS( status );
}
bool $TracerNS::TraceInformationVA($A,PCWSTR messageFmt,va_list argList) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceInformationVA($ci, messageFmt, argList ) );
}

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

bool $TracerNS::TraceWarning() $last_error
{
   return StatusToResultSetError( HelpersRT::TraceWarning() );
}
bool $TracerNS::TraceWarning($A,PCWSTR message) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceWarning($ci, message ) );
}
bool $TracerNS::TraceWarningFmt($A,PCWSTR messageFmt, ... ) $last_error
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   auto status = TraceWarningVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return $SUCCESS( status );
}
bool $TracerNS::TraceWarningVA($A,PCWSTR messageFmt,va_list argList) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceWarningVA($ci, messageFmt, argList ) );
}

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

bool $TracerNS::TraceError() $last_error
{
   return StatusToResultSetError( HelpersRT::TraceError() );
}
bool $TracerNS::TraceError($A,PCWSTR message) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceError($ci, message ) );
}
bool $TracerNS::TraceErrorFmt($A,PCWSTR messageFmt, ... ) $last_error
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   auto status = TraceErrorVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return $SUCCESS( status );
}
bool $TracerNS::TraceErrorVA($A,PCWSTR messageFmt,va_list argList) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceErrorVA($ci, messageFmt, argList ) );
}

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

bool $TracerNS::TraceOperation($A,PCWSTR message) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceOperation($ci, message ) );
}
bool $TracerNS::TraceOperationFmt($A,PCWSTR messageFmt, ... ) $last_error
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   auto status = TraceOperationVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return $SUCCESS( status );
}
bool $TracerNS::TraceOperationVA($A,PCWSTR messageFmt,va_list argList) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceOperationVA($ci, messageFmt, argList ) );
}

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

bool $TracerNS::TraceInFunction($A,PCWSTR funcNameOrSignature) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceInFunction($ci, funcNameOrSignature ) );
}
bool $TracerNS::TraceOutOfFunction($A,PCWSTR funcNameOrSignature) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceOutOfFunction($ci, funcNameOrSignature ) );
}

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

bool $TracerNS::TraceEx($A,$TraceMessageType messageType)
{
   return StatusToResultSetError( HelpersRT::TraceEx($ci, messageType ) );
}
bool $TracerNS::TraceEx($A,$TraceMessageType messageType,PCWSTR message) $last_error
{
   return StatusToResultSetError( HelpersRT::TraceEx($ci, messageType, message ) );
}
bool $TracerNS::TraceExFmt($A, $TraceMessageType messageType, PCWSTR messageFmt, ... ) $last_error
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   auto status = TraceExVA($ci, messageType, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return $SUCCESS( status );
}
bool $TracerNS::TraceExVA($A, $TraceMessageType messageType, PCWSTR messageFmt, va_list argList )
                              $last_error
{
   return StatusToResultSetError( HelpersRT::TraceExVA($ci, messageType, messageFmt, argList ) );
}

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

bool $TracerNS::StatusToResultSetError($Status status) $last_error
{
   return $SUCCESS( status ) ? $SUCCEED_LE() :
      $SET_ERROR_LE( HelpersRT::TraceErrorToMessage( status ) );
}

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