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

Helper managing raw values with transformed representation. More...

#include <ValueTransform.h>

Public Types

typedef Tp RawType
 
typedef TUnaryFunction Transformator
 
typedef Transformator::result_type TransformedType
 

Public Member Functions

 ValueTransform ()
 
 ValueTransform (RawType raw_r)
 
 ValueTransform (RawType raw_r, Transformator transform_r)
 
const RawTyperaw () const
 Get the raw value. More...
 
RawTyperaw ()
 Set the raw value. More...
 
TransformedType transformed () const
 Return a transformed copy of the raw value. More...
 
TransformedType transformed (const RawType &raw_r) const
 Return a transformed copy of an arbitrary RawType. More...
 
const Transformatortransformator () const
 Return the transformator. More...
 

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>
typedef Tp zypp::base::ValueTransform< Tp, TUnaryFunction >::RawType

Definition at line 37 of file ValueTransform.h.

◆ Transformator

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

Definition at line 38 of file ValueTransform.h.

◆ TransformedType

template<class Tp, class TUnaryFunction>
typedef Transformator::result_type zypp::base::ValueTransform< Tp, TUnaryFunction >::TransformedType

Definition at line 39 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 42 of file ValueTransform.h.

◆ ValueTransform() [2/3]

template<class Tp, class TUnaryFunction>
zypp::base::ValueTransform< Tp, TUnaryFunction >::ValueTransform ( RawType  raw_r)
inlineexplicit

Definition at line 45 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 49 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 55 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 59 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 64 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 68 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 72 of file ValueTransform.h.

Member Data Documentation

◆ _raw

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

Definition at line 76 of file ValueTransform.h.

◆ _transform

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

Definition at line 77 of file ValueTransform.h.


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