libzypp 17.37.10

zypp::base::ValueTransform< Tp, TUnaryFunction > Class Template Reference

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

## Detailed Description

template<class Tp, class TUnaryFunction>
class zypp::base::ValueTransform< Tp, TUnaryFunction >

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.

## Member Typedef Documentation

## ◆ RawType

template<class Tp, class TUnaryFunction>

using zypp::base::ValueTransform< Tp, TUnaryFunction >::RawType = Tp

Definition at line 37 of file ValueTransform.h.

## ◆ Transformator

template<class Tp, class TUnaryFunction>

using zypp::base::ValueTransform< Tp, TUnaryFunction >::Transformator = TUnaryFunction

Definition at line 38 of file ValueTransform.h.

## ◆ TransformedType

template<class Tp, class TUnaryFunction>

using zypp::base::ValueTransform< Tp, TUnaryFunction >::TransformedType = std::result_of_t<Transformator (RawType)>

Definition at line 40 of file ValueTransform.h.

## Constructor & Destructor Documentation

## ◆ ValueTransform() [1/3]

template<class Tp, class TUnaryFunction>

zypp::base::ValueTransform< Tp, TUnaryFunction >::ValueTransform | ( |  | ) |
| inline

Definition at line 46 of file ValueTransform.h.

## ◆ ValueTransform() [2/3]

template<class Tp, class TUnaryFunction>

zypp::base::ValueTransform< Tp, TUnaryFunction >::ValueTransform | ( | RawType | raw_r | ) |
| inline explicit

Definition at line 49 of file ValueTransform.h.

## ◆ ValueTransform() [3/3]

template<class Tp, class TUnaryFunction>

zypp::base::ValueTransform< Tp, TUnaryFunction >::ValueTransform | ( | RawType | raw_r,
|  | Transformator | transform_r )
| inline

Definition at line 53 of file ValueTransform.h.

## Member Function Documentation

## ◆ raw() [1/2]

template<class Tp, class TUnaryFunction>

const RawType & zypp::base::ValueTransform< Tp, TUnaryFunction >::raw | ( |  | ) | const
| inline

Get the raw value.

Definition at line 59 of file ValueTransform.h.

## ◆ raw() [2/2]

template<class Tp, class TUnaryFunction>

RawType & zypp::base::ValueTransform< Tp, TUnaryFunction >::raw | ( |  | ) |
| inline

Set the raw value.

Definition at line 63 of file ValueTransform.h.

## ◆ transformed() [1/2]

template<class Tp, class TUnaryFunction>

TransformedType zypp::base::ValueTransform< Tp, TUnaryFunction >::transformed | ( |  | ) | const
| inline

Return a transformed copy of the raw value.

Definition at line 68 of file ValueTransform.h.

## ◆ transformed() [2/2]

template<class Tp, class TUnaryFunction>

TransformedType zypp::base::ValueTransform< Tp, TUnaryFunction >::transformed | ( | const RawType & | raw_r | ) | const
| inline

Return a transformed copy of an arbitrary RawType.

Definition at line 72 of file ValueTransform.h.

## ◆ transformator()

template<class Tp, class TUnaryFunction>

const Transformator & zypp::base::ValueTransform< Tp, TUnaryFunction >::transformator | ( |  | ) | const
| inline

Return the transformator.

Definition at line 76 of file ValueTransform.h.

## Member Data Documentation

## ◆ _raw

template<class Tp, class TUnaryFunction>

RawType zypp::base::ValueTransform< Tp, TUnaryFunction >::_raw
| private

Definition at line 80 of file ValueTransform.h.

## ◆ _transform

template<class Tp, class TUnaryFunction>

Transformator zypp::base::ValueTransform< Tp, TUnaryFunction >::_transform
| private

Definition at line 81 of file ValueTransform.h.

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

- zypp/base/ValueTransform.h