|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <Errata.h>

Public Types | |
| using | result_type = R |
| Type of result value. | |
| using | code_type = Errata::code_type |
| using | Severity = Errata::Severity |
Public Member Functions | |
| Rv () | |
| Rv (result_type const &result) | |
| Rv (result_type const &result, Errata &&errata) | |
| Rv (result_type &&result) | |
| Rv (result_type &&result, Errata &&errata) | |
| Rv (Errata &&errata) | |
| self_type & | note (std::string_view text) |
| self_type & | note (Severity severity, std::string_view text) |
| self_type & | note (code_type const &code) |
| self_type & | note (code_type const &code, Severity severity) |
| template<typename... Args> | |
| self_type & | note (std::string_view fmt, Args &&...args) |
| template<typename... Args> | |
| self_type & | note (Severity severity, std::string_view fmt, Args &&...args) |
| self_type & | note (Errata const &that) |
| self_type & | note (Errata &&that) |
| operator result_type const & () const | |
| result_type & | operator= (result_type const &r) |
| result_type & | operator= (result_type &&r) |
| self_type & | assign (result_type const &result) |
| self_type & | assign (result_type &&result) |
| result_type & | result () |
| result_type const & | result () const |
| Errata & | errata () |
| Errata const & | errata () const |
| operator Errata & () | |
| self_type & | operator= (Errata &&status) |
| bool | is_ok () const |
| self_type & | clear () |
| Clear the errata. | |
| template<typename... Args> | |
| auto | note (std::string_view fmt, Args &&...args) -> self_type & |
| template<typename... Args> | |
| auto | note (Severity severity, std::string_view fmt, Args &&...args) -> self_type & |
Protected Types | |
| using | self_type = Rv |
| Standard self reference type. | |
Protected Attributes | |
| result_type | _r |
| The result. | |
| Errata | _errata |
| The errata. | |
Return type for returning a value and status (errata). In general, a method wants to return both a result and a status so that errors are logged properly. This structure is used to do that in way that is more usable than just std::pair. - Simpler and shorter typography - Force use of errata rather than having to remember it (and the order) each time - Enable assignment directly to R for ease of use and compatibility so clients can upgrade asynchronously.
| using swoc::Rv< R >::code_type = Errata::code_type |
| using swoc::Rv< R >::result_type = R |
| using swoc::Rv< R >::Severity = Errata::Severity |
| swoc::Rv< T >::Rv | ( | ) |
| swoc::Rv< T >::Rv | ( | result_type const & | result | ) |
| swoc::Rv< T >::Rv | ( | result_type const & | result, |
| Errata && | errata ) |
| swoc::Rv< R >::Rv | ( | result_type && | result | ) |
| swoc::Rv< R >::Rv | ( | result_type && | result, |
| Errata && | errata ) |
Construct only from errata
| errata | Errata instance. |
This is useful for error conditions. The result is default constructed and the errata consumed by the return value. If result_type is a smart pointer or other cheaply default constructed class this can make the code much cleaner;
| Rv< R > & swoc::Rv< R >::assign | ( | result_type && | result | ) |
| Rv< R > & swoc::Rv< R >::assign | ( | result_type const & | result | ) |
Set the result.
This differs from assignment of the function result in that the return value is a reference to the Rv, not the internal result. This makes it useful for assigning a result local variable and then returning.
| result | Value to move. |
| auto swoc::Rv< R >::clear | ( | ) |
| bool swoc::Rv< R >::is_ok | ( | ) | const |
| auto swoc::Rv< R >::note | ( | code_type const & | code | ) |
| self_type & swoc::Rv< R >::note | ( | Severity | severity, |
| std::string_view | fmt, | ||
| Args &&... | args ) |
Append a message in to the result.
| Args | Format string argument types. |
| severity | Local severity. |
| fmt | Format string. |
| args | Arguments for fmt. |
| self_type & swoc::Rv< R >::note | ( | std::string_view | fmt, |
| Args &&... | args ) |
Append a message in to the result.
| Args | Format string argument types. |
| fmt | Format string. |
| args | Arguments for fmt. |
|
inline |
| swoc::Rv< T >::operator result_type const & | ( | ) | const |
| auto swoc::Rv< R >::operator= | ( | result_type && | r | ) |
| auto swoc::Rv< R >::operator= | ( | result_type const & | r | ) |
Assignment from result type.
| r | Result. |
This allows the result to be assigned to a pre-declared return value structure. The return value is a reference to the internal result so that this operator can be chained in other assignments to instances of result type. This is most commonly used when the result is computed in to a local variable to be both returned and stored in a member.
| R & swoc::Rv< R >::result | ( | ) |
| R const & swoc::Rv< R >::result | ( | ) | const |
|
protected |