An. More...
#include "client/annotation.h"
Public Types | |
enum class | Tag |
A constructor tag that enables braced initialization in C arrays. More... | |
![]() | |
enum class | Type : uint16_t |
The type of data stored in the annotation. More... | |
enum class | ConcurrentAccessGuardMode : bool |
Mode used to guard concurrent reads from writes. More... | |
using | ValueSizeType = uint32_t |
The type used for SetSize(). | |
Public Member Functions | |
constexpr | StringAnnotation (const char name[]) |
Constructs a new StringAnnotation with the given name. | |
StringAnnotation (const StringAnnotation &)=delete | |
StringAnnotation & | operator= (const StringAnnotation &)=delete |
constexpr | StringAnnotation (const char name[], Tag tag) |
Constructs a new StringAnnotation with the given name. | |
void | Set (const char *value) |
Sets the Annotation's string value. | |
void | Set (base::StringPiece string) |
Sets the Annotation's string value. | |
const base::StringPiece | value () const |
![]() | |
constexpr | Annotation (Type type, const char name[], void *value_ptr) |
Constructs a new annotation. | |
Annotation (const Annotation &)=delete | |
Annotation & | operator= (const Annotation &)=delete |
void | SetSize (ValueSizeType size) |
Specifies the number of bytes in value_ptr_ to include when generating a crash report. | |
void | Clear () |
Marks the annotation as cleared, indicating the value_ptr_ should not be included in a crash report. | |
bool | is_set () const |
Tests whether the annotation has been set. | |
Type | type () const |
ValueSizeType | size () const |
const char * | name () const |
const void * | value () const |
ConcurrentAccessGuardMode | concurrent_access_guard_mode () const |
std::optional< ScopedSpinGuard > | TryCreateScopedSpinGuard (uint64_t timeout_ns) |
If this Annotation guards concurrent access using ScopedSpinGuard, tries to obtain the spin guard and returns the result. | |
Additional Inherited Members | |
![]() | |
static constexpr Type | UserDefinedType (uint16_t value) |
Creates a user-defined Annotation::Type. | |
![]() | |
static constexpr size_t | kNameMaxLength = 256 |
The maximum length of an annotation’s name, in bytes. Matches the behavior of Breakpad's SimpleStringDictionary. | |
static constexpr size_t | kValueMaxSize = 5 * 4096 |
The maximum size of an annotation’s value, in bytes. | |
![]() | |
constexpr | Annotation (Type type, const char name[], void *value_ptr, ConcurrentAccessGuardMode concurrent_access_guard_mode) |
Constructs a new annotation. | |
std::atomic< Annotation * > & | link_node () |
Annotation * | GetLinkNode (std::memory_order order=std::memory_order_seq_cst) |
const Annotation * | GetLinkNode (std::memory_order order=std::memory_order_seq_cst) const |
An.
NUL
-terminated C-string value.The storage for the value is allocated by the annotation and the template parameter MaxSize controls the maxmium length for the value.
It is expected that the string value be valid UTF-8, although this is not validated.
|
strong |
A constructor tag that enables braced initialization in C arrays.
|
inlineexplicitconstexpr |
Constructs a new StringAnnotation with the given name.
[in] | name | The Annotation name. |
|
inlineconstexpr |
Constructs a new StringAnnotation with the given name.
This constructor takes the ArrayInitializerTag for use when initializing a C array of annotations. The main constructor is explicit and cannot be brace-initialized. As an example:
[in] | name | The Annotation name. |
[in] | tag | A constructor tag. |
|
inline |
Sets the Annotation's string value.
[in] | string | The string value. |
|
inline |
Sets the Annotation's string value.
[in] | value | The NUL -terminated C-string value. |