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

$CallerInfo::$CallerInfo( PCWSTR funcSignature, PCWSTR sourceFile, int lineNo, PCSTR sourceFileA,
                          PCWSTR tag $required )
{
   _FuncSignature_ = funcSignature;
   _SourceFile_ = sourceFile;
   _LineNo_ = lineNo;
   _SourceFileA_ = sourceFileA;
   _Tag_ = tag;
   if ( !tag )
      $FatalError::Raise(*this, $TEXT(
         L"Tag parameter was not provided for the API from outer code level "
         L"(caller info).",
         L"Тег-параметр не был передан в API внешним уровнем программного кода "
         L"(информация о вызывающем)."
      ));
}

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

PCWSTR $CallerInfo::GetFuncSignature() const
{
   return _FuncSignature_;
}
PCWSTR $CallerInfo::GetSourceFile() const
{
   return _SourceFile_;
}
int $CallerInfo::GetLineNo() const
{
   return _LineNo_;
}
PCSTR $CallerInfo::GetSourceFileA() const
{
   return _SourceFileA_;
}

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

PCWSTR $CallerInfo::GetTag() const
{
   return _Tag_;
}

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

bool $CallerInfo::GetIsEmpty() const
{
   return !( _FuncSignature_ || _SourceFile_ || _LineNo_ || _SourceFileA_ || _Tag_ );
}
bool $CallerInfo::GetIsComplete() const
{
   return _FuncSignature_ && _SourceFile_ && _LineNo_ && _SourceFileA_;
}

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

$CallerInfo $CallerInfo::EmptyInstance()
{
   return $CallerInfo();
}

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

$CallerInfo::$CallerInfo()
{
   $CLEAR_INSTANCE();
}

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