CrashReportProperty Class Reference

#include <crashreportproperty.h>

详细描述

A property that can be stored by the crash report if something crashes while the property is still part of the scope.

If you'd call the following method with makeCrash == true the crash report would contain the two properties "Entered Sample method" and "Going to crash: true". The property "Will not appear" won't be in the crash report because the scope of its code block has been left.

void Sample( Int xyz, Bool makeCrash) { CRASHREPORTPROPERTY ( "Entered Sample method" ); if (xyz) { CRASHREPORTPROPERTY ( "Will not appear" , xyz); } if (makeCrash) { CRASHREPORTPROPERTY ( "Going to crash" , makeCrash); int * badAddress = ( int *) 32; *badAddress = 42; } }

公共成员函数

  CrashReportProperty (const Char *name, const Char *value=nullptr)
  CrashReportProperty (const Char *name, Bool value)
  CrashReportProperty (const Char *name, Char value)
  CrashReportProperty (const Char *name, Int16 value)
  CrashReportProperty (const Char *name, Int32 value)
  CrashReportProperty (const Char *name, Int64 value)
  CrashReportProperty (const Char *name, UChar value)
  CrashReportProperty (const Char *name, UInt16 value)
  CrashReportProperty (const Char *name, UInt32 value)
  CrashReportProperty (const Char *name, UInt64 value)
  CrashReportProperty (const Char *name, const Float32 &value)
  CrashReportProperty (const Char *name, const Float64 &value)
  CrashReportProperty (const Char *name, const String &value)
template<typename T >
  CrashReportProperty (const Char *name, const T &value)
  ~CrashReportProperty ()

静态公共成员函数

static CrashReportPropertyArray GetCrashReportProperties (void *osThread)

私有成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( CrashReportProperty )
void  SetAllocationState ( Bool state)
Bool   IsAllocated () const
const Char StoreValue (const Char *value)
const Char StoreValue ( Bool value)
const Char StoreValue ( UInt64 value, Int digits)

Private Attributes

Int32   _propertyIdx
char  _buf [28]

构造函数 & 析构函数文档编制

◆  CrashReportProperty() [1/14]

CrashReportProperty ( const Char name ,
const Char value = nullptr  
)
explicit

Constructs a property for the crash report if something crashes while this is still in scope. it when the object is no longer needed). If you try to start an already running thread this will fail and return an error.

参数
[in] name Property name or key.
[in] value Pointer to a null terminated C string that must be valid until the scope is left.

◆  CrashReportProperty() [2/14]

CrashReportProperty ( const Char name ,
Bool   value  
)

◆  CrashReportProperty() [3/14]

CrashReportProperty ( const Char name ,
Char   value  
)

◆  CrashReportProperty() [4/14]

CrashReportProperty ( const Char name ,
Int16   value  
)

◆  CrashReportProperty() [5/14]

CrashReportProperty ( const Char name ,
Int32   value  
)

◆  CrashReportProperty() [6/14]

CrashReportProperty ( const Char name ,
Int64   value  
)

◆  CrashReportProperty() [7/14]

CrashReportProperty ( const Char name ,
UChar   value  
)

◆  CrashReportProperty() [8/14]

CrashReportProperty ( const Char name ,
UInt16   value  
)

◆  CrashReportProperty() [9/14]

CrashReportProperty ( const Char name ,
UInt32   value  
)

◆  CrashReportProperty() [10/14]

CrashReportProperty ( const Char name ,
UInt64   value  
)

◆  CrashReportProperty() [11/14]

CrashReportProperty ( const Char name ,
const Float32 value  
)

◆  CrashReportProperty() [12/14]

CrashReportProperty ( const Char name ,
const Float64 value  
)

◆  CrashReportProperty() [13/14]

CrashReportProperty ( const Char name ,
const String value  
)

◆  CrashReportProperty() [14/14]

CrashReportProperty ( const Char name ,
const T &  value  
)

◆  ~CrashReportProperty()

~ CrashReportProperty ( )

Destructs a property for the crash report when the scope is left. From the C++ standard: "On exit from a scope (however accomplished), objects with automatic storage duration (3.7.3) that have been constructed in that scope are destroyed in the reverse order of their construction."

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( CrashReportProperty   )
private

◆  GetCrashReportProperties()

static CrashReportPropertyArray * GetCrashReportProperties ( void *  osThread )
static

Returns a pointer to an array with crash properties (used by the crash report).

参数
[in] osThread OS specific thread identifier.
返回
Pointer to an array with crash properties.

◆  SetAllocationState()

void SetAllocationState ( Bool   state )
private

◆  IsAllocated()

Bool IsAllocated ( ) const
private

◆  StoreValue() [1/3]

const Char * StoreValue ( const Char value )
private

◆  StoreValue() [2/3]

const Char * StoreValue ( Bool   value )
private

◆  StoreValue() [3/3]

const Char * StoreValue ( UInt64   value ,
Int   digits  
)
private

Member Data Documentation

◆  _propertyIdx

Int32 _propertyIdx
private

◆  _buf

char _buf[28] private
Int
maxon::Int Int
定义: ge_sys_math.h:62
CRASHREPORTPROPERTY
#define CRASHREPORTPROPERTY(...)
定义: crashreportproperty.h:228
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53