ThreadReferencedError Class Reference Data Types

#include <apibase.h>

详细描述

ThreadReferencedError holds a pointer to an Error object which is referenced by the current thread (or referenced globally such that its lifetime is sufficiently long). It is used at some places of the API when an Error shall be passed in return values of functions: If Error was used instead, this would introduce overhead because of its reference counting and because it can't be passed in registers.

注意
Do not add a constructor to this class and do not use default member initialization! This would break binary compatiblity and prevent register usage (on Windows).
另请参阅
System::SetCurrentError

公共成员函数

void  operator= (const Error *error)
void  operator= (const ErrorPtr &error)
const Error *  GetReferencedError () const
  operator ErrorPtr & ()
  operator NoErrorPtr & ()

静态公共成员函数

static ThreadReferencedError   CreateFromReferencedError (const Error *referencedError)

Private Attributes

const Error *  _error

Friends

template<typename >
class  ResultBase
template<typename >
class  Result

成员函数文档编制

◆  CreateFromReferencedError()

static ThreadReferencedError CreateFromReferencedError ( const Error *  referencedError )
static

Constructs a ThreadReferencedError from an error object which is referenced by the current thread (or referenced globally such that its lifetime is sufficiently long).

参数
[in] referencedError Pointer to an error object, must not be nullptr or a pointer to a null reference.
返回
ThreadReferencedError holding the pointer.

◆  operator=() [1/2]

void operator= ( const Error *  error )

◆  operator=() [2/2]

void operator= ( const ErrorPtr error )

◆  GetReferencedError()

const Error* GetReferencedError ( ) const

Returns a pointer to the wrapped Error object. This may be nullptr. If a non-null pointer is returned, then the Error itself is guaranteed to be a non-null reference.

返回
The wrapped error object.

◆  operator ErrorPtr &()

operator ErrorPtr & ( )

◆  operator NoErrorPtr &()

operator NoErrorPtr & ( )

Friends And Related Function Documentation

◆  ResultBase

friend class ResultBase
friend

◆  结果

friend class Result
friend

Member Data Documentation

◆  _error

const Error* _error private