libzypp 17.37.17
|
Helper managing raw values with transformed representation. More...
#include <zypp/base/ValueTransform.h>
Public Types | |
using | RawType = Tp |
using | Transformator = TUnaryFunction |
using | TransformedType = std::result_of_t<Transformator (RawType)> |
Public Member Functions | |
ValueTransform () | |
ValueTransform (RawType raw_r) | |
ValueTransform (RawType raw_r, Transformator transform_r) | |
const RawType & | raw () const |
Get the raw value. | |
RawType & | raw () |
Set the raw value. | |
TransformedType | transformed () const |
Return a transformed copy of the raw value. | |
TransformedType | transformed (const RawType &raw_r) const |
Return a transformed copy of an arbitrary RawType. | |
const Transformator & | transformator () const |
Return the transformator. |
Private Attributes | |
RawType | _raw |
Transformator | _transform |
Helper managing raw values with transformed representation.
This helper enforces to explicitly state whether you are using the raw or the variable replaced value. Usually you set raw
and get transformed
(unless writing raw
to some config file).
Used e.g. vor variable replaced config strings.
Definition at line 35 of file ValueTransform.h.
using zypp::base::ValueTransform< Tp, TUnaryFunction >::RawType = Tp |
Definition at line 37 of file ValueTransform.h.
using zypp::base::ValueTransform< Tp, TUnaryFunction >::Transformator = TUnaryFunction |
Definition at line 38 of file ValueTransform.h.
using zypp::base::ValueTransform< Tp, TUnaryFunction >::TransformedType = std::result_of_t<Transformator (RawType)> |
Definition at line 40 of file ValueTransform.h.
|
inline |
Definition at line 46 of file ValueTransform.h.
|
inlineexplicit |
Definition at line 49 of file ValueTransform.h.
|
inline |
Definition at line 53 of file ValueTransform.h.
|
inline |
Get the raw value.
Definition at line 59 of file ValueTransform.h.
|
inline |
Set the raw value.
Definition at line 63 of file ValueTransform.h.
|
inline |
Return a transformed copy of the raw value.
Definition at line 68 of file ValueTransform.h.
|
inline |
Return a transformed copy of an arbitrary RawType.
Definition at line 72 of file ValueTransform.h.
|
inline |
Return the transformator.
Definition at line 76 of file ValueTransform.h.
|
private |
Definition at line 80 of file ValueTransform.h.
|
private |
Definition at line 81 of file ValueTransform.h.