libzypp  13.10.6
zypp::NamedValue< _Tp, _WithAlias > Class Template Reference

#include <NamedValue.h>

Classes

class  _Inserter
 

Public Member Functions

bool empty () const
 Whether not initialized (no (name,value) pair remembered) More...
 
bool insert (const _Tp &value_r, const std::string &name_r)
 Remember name (1st call) or alias (subsequent calls). More...
 
Get value for name or alias.
bool haveValue (const std::string &name_r) const
 Whether there is a value mapped for name_r. More...
 
bool getValue (const std::string &name_r, _Tp &value_r) const
 Get value mapped for name or alias. More...
 
const _Tp & getValue (const std::string &name_r) const
 
Get name for value.
bool haveName (const std::string &value_r) const
 Whether there is a name mapped for value_r. More...
 
bool getName (const _Tp &value_r, std::string &name_r) const
 Get name of value. More...
 
const std::string & getName (const _Tp &value_r) const
 
Inserter
_Inserter operator() (const _Tp &value_r)
 

Private Types

typedef std::map< std::string,
_Tp > 
NameMap
 
typedef std::map< _Tp,
std::string > 
ValueMap
 

Private Attributes

NameMap _nameMap
 
ValueMap _valueMap
 

Detailed Description

template<class _Tp, const bool _WithAlias = true>
class zypp::NamedValue< _Tp, _WithAlias >

Definition at line 41 of file NamedValue.h.

Member Typedef Documentation

template<class _Tp , const bool _WithAlias = true>
typedef std::map< std::string, _Tp > zypp::NamedValue< _Tp, _WithAlias >::NameMap
private

Definition at line 43 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
typedef std::map< _Tp, std::string > zypp::NamedValue< _Tp, _WithAlias >::ValueMap
private

Definition at line 44 of file NamedValue.h.

Member Function Documentation

template<class _Tp , const bool _WithAlias = true>
bool zypp::NamedValue< _Tp, _WithAlias >::empty ( ) const
inline

Whether not initialized (no (name,value) pair remembered)

Definition at line 48 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
bool zypp::NamedValue< _Tp, _WithAlias >::haveValue ( const std::string &  name_r) const
inline

Whether there is a value mapped for name_r.

Definition at line 56 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
bool zypp::NamedValue< _Tp, _WithAlias >::getValue ( const std::string &  name_r,
_Tp &  value_r 
) const
inline

Get value mapped for name or alias.

Returns
true if name or alias was found.

Definition at line 65 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
const _Tp& zypp::NamedValue< _Tp, _WithAlias >::getValue ( const std::string &  name_r) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 74 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
bool zypp::NamedValue< _Tp, _WithAlias >::haveName ( const std::string &  value_r) const
inline

Whether there is a name mapped for value_r.

Definition at line 83 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
bool zypp::NamedValue< _Tp, _WithAlias >::getName ( const _Tp &  value_r,
std::string &  name_r 
) const
inline

Get name of value.

Returns
true if name or alias was found.

Definition at line 92 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
const std::string& zypp::NamedValue< _Tp, _WithAlias >::getName ( const _Tp &  value_r) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 101 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
_Inserter zypp::NamedValue< _Tp, _WithAlias >::operator() ( const _Tp &  value_r)
inline

Definition at line 123 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
bool zypp::NamedValue< _Tp, _WithAlias >::insert ( const _Tp &  value_r,
const std::string &  name_r 
)
inline

Remember name (1st call) or alias (subsequent calls).

Returns
true if this is the 1st call for value_r.
Exceptions
std::logic_errorif name_r is already used as name or alias.
std::logic_errorif _WithAlias is false and a name for value_r is already defined.

Definition at line 132 of file NamedValue.h.

Member Data Documentation

template<class _Tp , const bool _WithAlias = true>
NameMap zypp::NamedValue< _Tp, _WithAlias >::_nameMap
private

Definition at line 154 of file NamedValue.h.

template<class _Tp , const bool _WithAlias = true>
ValueMap zypp::NamedValue< _Tp, _WithAlias >::_valueMap
private

Definition at line 155 of file NamedValue.h.


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