LibSWOC++ 1.5.14
Solid Wall of C++
Loading...
Searching...
No Matches
swoc::Errata::Annotation Class Reference

#include <Errata.h>

Collaboration diagram for swoc::Errata::Annotation:
Collaboration graph

Public Member Functions

self_typeclear ()
 Reset to the message to default state.
 
swoc::TextView text () const
 Get the text of the message.
 
unsigned short level () const
 Get the nesting level.
 
bool has_severity () const
 Check if this has a Severity.
 
Severity severity (Severity default_severity=DEFAULT_SEVERITY) const
 
self_typeassign (Severity severity)
 Set the severity of this.
 

Protected Types

using Linkage = swoc::IntrusiveLinkage<self_type, &self_type::_next, &self_type::_prev>
 

Protected Member Functions

 Annotation ()
 
 Annotation (std::string_view text, std::optional< Severity > severity=std::optional< Severity >{}, unsigned short level=0)
 

Protected Attributes

std::string_view _text
 Annotation text.
 
unsigned short _level {0}
 Nesting level for display purposes.
 
std::optional< Severity_severity
 Severity.
 
self_type_next {nullptr}
 
self_type_prev {nullptr}
 

Friends

class Errata
 
class swoc::MemArena
 

Detailed Description

An annotation to the Errata consisting of a severity and informative text.

The text cannot be changed because of memory ownership risks.

Definition at line 102 of file Errata.h.

Member Typedef Documentation

◆ Linkage

using swoc::Errata::Annotation::Linkage = swoc::IntrusiveLinkage<self_type, &self_type::_next, &self_type::_prev>
protected

} Intrusive list link descriptor.

Note
Must explicitly use defaults because ICC and clang consider them inaccessible otherwise. I consider it a bug in the compiler that a default identical to an explicit value has different behavior.

Definition at line 139 of file Errata.h.

Constructor & Destructor Documentation

◆ Annotation() [1/2]

swoc::Errata::Annotation::Annotation ( )
inlineprotecteddefault

Default constructor. The message has default severity and empty text.

◆ Annotation() [2/2]

swoc::Errata::Annotation::Annotation ( std::string_view text,
std::optional< Severity > severity = std::optional<Severity>{},
unsigned short level = 0 )
inlineexplicitprotected

Construct with text.

Parameters
textAnnotation content (literal).
severityLocal severity.
levelNesting level.

text is presumed to be stable for the Annotation lifetime - this constructor simply copies the view.

Definition at line 972 of file Errata.h.

Member Function Documentation

◆ assign()

auto swoc::Errata::Annotation::assign ( Errata::Severity severity)
inline

Set the severity of this.

Definition at line 1000 of file Errata.h.

◆ clear()

Errata::Annotation & swoc::Errata::Annotation::clear ( )
inline

Reset to the message to default state.

Definition at line 976 of file Errata.h.

◆ has_severity()

bool swoc::Errata::Annotation::has_severity ( ) const
inline

Check if this has a Severity.

Definition at line 992 of file Errata.h.

◆ level()

unsigned short swoc::Errata::Annotation::level ( ) const
inline

Get the nesting level.

Definition at line 987 of file Errata.h.

◆ severity()

auto swoc::Errata::Annotation::severity ( Errata::Severity default_severity = DEFAULT_SEVERITY) const
inline

Retrieve the local severity.

Returns
The local severity or default_severity if none is set.

Definition at line 996 of file Errata.h.

◆ text()

swoc::TextView swoc::Errata::Annotation::text ( ) const
inline

Get the text of the message.

Definition at line 982 of file Errata.h.

Friends And Related Symbol Documentation

◆ Errata

friend class Errata
friend

Definition at line 157 of file Errata.h.

◆ swoc::MemArena

friend class swoc::MemArena
friend

Definition at line 158 of file Errata.h.

Member Data Documentation

◆ _level

unsigned short swoc::Errata::Annotation::_level {0}
protected

Nesting level for display purposes.

Definition at line 127 of file Errata.h.

◆ _next

self_type* swoc::Errata::Annotation::_next {nullptr}
protected

{ Policy and links for intrusive list.

Definition at line 132 of file Errata.h.

◆ _prev

self_type* swoc::Errata::Annotation::_prev {nullptr}
protected

Definition at line 133 of file Errata.h.

◆ _severity

std::optional<Severity> swoc::Errata::Annotation::_severity
protected

Severity.

Definition at line 128 of file Errata.h.

◆ _text

std::string_view swoc::Errata::Annotation::_text
protected

Annotation text.

Definition at line 126 of file Errata.h.


The documentation for this class was generated from the following file: