libzypp 17.37.17
zypp::base::ContainerTransform< TContainer, TUnaryFunction > Class Template Reference

Helper managing a container of raw values with transformed representation. More...

#include <zypp/base/ValueTransform.h>

Public Types

using Container = TContainer
using Transformator = TUnaryFunction
using size_type = typename Container::size_type
using RawType = typename Container::value_type
using TransformedType = std::result_of_t<Transformator (RawType)>
using RawConstIterator = typename Container::const_iterator
using TransformedConstIterator = transform_iterator<Transformator, typename Container::const_iterator>

Public Member Functions

 ContainerTransform ()
 ContainerTransform (Container raw_r)
 ContainerTransform (Container raw_r, Transformator transform_r)
bool empty () const
size_type size () const
RawConstIterator rawBegin () const
RawConstIterator rawEnd () const
const Containerraw () const
 Get the raw value.
Containerraw ()
 Set the raw value.
void clear ()
 Clear the container.
TransformedConstIterator transformedBegin () const
TransformedConstIterator transformedEnd () const
Container transformed () const
 Return copy with transformed variables (expensive)
TransformedType transformed (const RawType &raw_r) const
 Return a transformed copy of an arbitrary RawType.
TransformedType transformed (const RawConstIterator &rawIter_r) const
 Return a transformed copy of a RawConstIterator raw value.
const Transformatortransformator () const
 Return the transformator.

Private Attributes

Container _raw
Transformator _transform

Detailed Description

template<class TContainer, class TUnaryFunction>
class zypp::base::ContainerTransform< TContainer, TUnaryFunction >

Helper managing a container of raw values with transformed representation.

This helper enforces to explicitly state wheter you are using the raw or the variable replaced value. Usually you set raw and get transformed (uness writing raw to some config file).

Offers iterating over transformed strings in the list.

Definition at line 95 of file ValueTransform.h.

Member Typedef Documentation

◆ Container

template<class TContainer, class TUnaryFunction>
using zypp::base::ContainerTransform< TContainer, TUnaryFunction >::Container = TContainer

Definition at line 97 of file ValueTransform.h.

◆ Transformator

template<class TContainer, class TUnaryFunction>
using zypp::base::ContainerTransform< TContainer, TUnaryFunction >::Transformator = TUnaryFunction

Definition at line 98 of file ValueTransform.h.

◆ size_type

template<class TContainer, class TUnaryFunction>
using zypp::base::ContainerTransform< TContainer, TUnaryFunction >::size_type = typename Container::size_type

Definition at line 99 of file ValueTransform.h.

◆ RawType

template<class TContainer, class TUnaryFunction>
using zypp::base::ContainerTransform< TContainer, TUnaryFunction >::RawType = typename Container::value_type

Definition at line 100 of file ValueTransform.h.

◆ TransformedType

template<class TContainer, class TUnaryFunction>
using zypp::base::ContainerTransform< TContainer, TUnaryFunction >::TransformedType = std::result_of_t<Transformator (RawType)>

Definition at line 102 of file ValueTransform.h.

◆ RawConstIterator

template<class TContainer, class TUnaryFunction>
using zypp::base::ContainerTransform< TContainer, TUnaryFunction >::RawConstIterator = typename Container::const_iterator

Definition at line 125 of file ValueTransform.h.

◆ TransformedConstIterator

template<class TContainer, class TUnaryFunction>
using zypp::base::ContainerTransform< TContainer, TUnaryFunction >::TransformedConstIterator = transform_iterator<Transformator, typename Container::const_iterator>

Definition at line 146 of file ValueTransform.h.

Constructor & Destructor Documentation

◆ ContainerTransform() [1/3]

template<class TContainer, class TUnaryFunction>
zypp::base::ContainerTransform< TContainer, TUnaryFunction >::ContainerTransform ( )
inline

Definition at line 107 of file ValueTransform.h.

◆ ContainerTransform() [2/3]

template<class TContainer, class TUnaryFunction>
zypp::base::ContainerTransform< TContainer, TUnaryFunction >::ContainerTransform ( Container raw_r)
inlineexplicit

Definition at line 110 of file ValueTransform.h.

◆ ContainerTransform() [3/3]

template<class TContainer, class TUnaryFunction>
zypp::base::ContainerTransform< TContainer, TUnaryFunction >::ContainerTransform ( Container raw_r,
Transformator transform_r )
inline

Definition at line 114 of file ValueTransform.h.

Member Function Documentation

◆ empty()

template<class TContainer, class TUnaryFunction>
bool zypp::base::ContainerTransform< TContainer, TUnaryFunction >::empty ( ) const
inline

Definition at line 119 of file ValueTransform.h.

◆ size()

template<class TContainer, class TUnaryFunction>
size_type zypp::base::ContainerTransform< TContainer, TUnaryFunction >::size ( ) const
inline

Definition at line 122 of file ValueTransform.h.

◆ rawBegin()

template<class TContainer, class TUnaryFunction>
RawConstIterator zypp::base::ContainerTransform< TContainer, TUnaryFunction >::rawBegin ( ) const
inline

Definition at line 127 of file ValueTransform.h.

◆ rawEnd()

template<class TContainer, class TUnaryFunction>
RawConstIterator zypp::base::ContainerTransform< TContainer, TUnaryFunction >::rawEnd ( ) const
inline

Definition at line 130 of file ValueTransform.h.

◆ raw() [1/2]

template<class TContainer, class TUnaryFunction>
const Container & zypp::base::ContainerTransform< TContainer, TUnaryFunction >::raw ( ) const
inline

Get the raw value.

Definition at line 134 of file ValueTransform.h.

◆ raw() [2/2]

template<class TContainer, class TUnaryFunction>
Container & zypp::base::ContainerTransform< TContainer, TUnaryFunction >::raw ( )
inline

Set the raw value.

Definition at line 138 of file ValueTransform.h.

◆ clear()

template<class TContainer, class TUnaryFunction>
void zypp::base::ContainerTransform< TContainer, TUnaryFunction >::clear ( )
inline

Clear the container.

Definition at line 142 of file ValueTransform.h.

◆ transformedBegin()

template<class TContainer, class TUnaryFunction>
TransformedConstIterator zypp::base::ContainerTransform< TContainer, TUnaryFunction >::transformedBegin ( ) const
inline

Definition at line 148 of file ValueTransform.h.

◆ transformedEnd()

template<class TContainer, class TUnaryFunction>
TransformedConstIterator zypp::base::ContainerTransform< TContainer, TUnaryFunction >::transformedEnd ( ) const
inline

Definition at line 151 of file ValueTransform.h.

◆ transformed() [1/3]

template<class TContainer, class TUnaryFunction>
Container zypp::base::ContainerTransform< TContainer, TUnaryFunction >::transformed ( ) const
inline

Return copy with transformed variables (expensive)

Definition at line 155 of file ValueTransform.h.

◆ transformed() [2/3]

template<class TContainer, class TUnaryFunction>
TransformedType zypp::base::ContainerTransform< TContainer, TUnaryFunction >::transformed ( const RawType & raw_r) const
inline

Return a transformed copy of an arbitrary RawType.

Definition at line 159 of file ValueTransform.h.

◆ transformed() [3/3]

template<class TContainer, class TUnaryFunction>
TransformedType zypp::base::ContainerTransform< TContainer, TUnaryFunction >::transformed ( const RawConstIterator & rawIter_r) const
inline

Return a transformed copy of a RawConstIterator raw value.

Definition at line 163 of file ValueTransform.h.

◆ transformator()

template<class TContainer, class TUnaryFunction>
const Transformator & zypp::base::ContainerTransform< TContainer, TUnaryFunction >::transformator ( ) const
inline

Return the transformator.

Definition at line 167 of file ValueTransform.h.

Member Data Documentation

◆ _raw

template<class TContainer, class TUnaryFunction>
Container zypp::base::ContainerTransform< TContainer, TUnaryFunction >::_raw
private

Definition at line 171 of file ValueTransform.h.

◆ _transform

template<class TContainer, class TUnaryFunction>
Transformator zypp::base::ContainerTransform< TContainer, TUnaryFunction >::_transform
private

Definition at line 172 of file ValueTransform.h.


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