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

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

#include <base/ValueTransform.h>

Public Types

typedef TContainer Container
 
typedef TUnaryFunction Transformator
 
typedef Container::size_type size_type
 
typedef Container::value_type RawType
 
typedef std::result_of< Transformator(RawType)>::type TransformedType
 
typedef Container::const_iterator RawConstIterator
 
typedef transform_iterator< Transformator, typename Container::const_iterator > TransformedConstIterator
 

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.
 
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 91 of file ValueTransform.h.

Member Typedef Documentation

◆ Container

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

Definition at line 93 of file ValueTransform.h.

◆ Transformator

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

Definition at line 94 of file ValueTransform.h.

◆ size_type

template<class TContainer , class TUnaryFunction >
typedef Container::size_type zypp::base::ContainerTransform< TContainer, TUnaryFunction >::size_type

Definition at line 95 of file ValueTransform.h.

◆ RawType

template<class TContainer , class TUnaryFunction >
typedef Container::value_type zypp::base::ContainerTransform< TContainer, TUnaryFunction >::RawType

Definition at line 96 of file ValueTransform.h.

◆ TransformedType

template<class TContainer , class TUnaryFunction >
typedef std::result_of<Transformator(RawType)>::type zypp::base::ContainerTransform< TContainer, TUnaryFunction >::TransformedType

Definition at line 97 of file ValueTransform.h.

◆ RawConstIterator

template<class TContainer , class TUnaryFunction >
typedef Container::const_iterator zypp::base::ContainerTransform< TContainer, TUnaryFunction >::RawConstIterator

Definition at line 118 of file ValueTransform.h.

◆ TransformedConstIterator

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

Definition at line 135 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 100 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 103 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 107 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 112 of file ValueTransform.h.

◆ size()

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

Definition at line 115 of file ValueTransform.h.

◆ rawBegin()

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

Definition at line 120 of file ValueTransform.h.

◆ rawEnd()

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

Definition at line 123 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 127 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 131 of file ValueTransform.h.

◆ transformedBegin()

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

Definition at line 137 of file ValueTransform.h.

◆ transformedEnd()

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

Definition at line 140 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 144 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 148 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 152 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 156 of file ValueTransform.h.

Member Data Documentation

◆ _raw

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

Definition at line 160 of file ValueTransform.h.

◆ _transform

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

Definition at line 161 of file ValueTransform.h.


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