Honeycomb  0.1
Component-Model Framework
Classes | Public Types | Public Member Functions | Friends | List of all members
honey::MtMapElem< Key_, Val_, List_ > Class Template Reference

Map element in recursive list. More...

#include <MtMap.h>

Inheritance diagram for honey::MtMapElem< Key_, Val_, List_ >:
Inheritance graph
[legend]
Collaboration diagram for honey::MtMapElem< Key_, Val_, List_ >:
Collaboration graph
[legend]

Public Types

template<class Key >
using hasKey_ = typename Super::template hasKey_< Key >
 
template<class Key >
using getResult = typename Super::template getResult< Key >
 
template<class Key >
using iterResult = typename Super::template iterResult< Key >
 
template<class Key >
using iterResult_const = typename Super::template iterResult_const< Key >
 
template<class... Pairs>
using insertResult = typename Super::template insertResult< Pairs... >
 
template<class... Keys>
using eraseResult = typename Super::template eraseResult< Keys... >
 
typedef Key_ Key
 Key type. More...
 
typedef Val_ Val
 Value type. More...
 
typedef List_ List
 Rest of map. More...
 
typedef MtMapIter< Subclass > beginResult
 Result type of begin() More...
 
typedef MtMapIter< const Subclass > beginResult_const
 
typedef MtMapIter< Subclass, MtMapTailendResult
 Result type of end() More...
 
typedef MtMapIter< const Subclass, MtMapTailendResult_const
 
typedef clearResult_::type clearResult
 Result type of clear() More...
 
- Public Types inherited from honey::MtMapCommon< MtMapElem< Key_, Val_, List_ >, Key_, Val_, List_ >
typedef Key_ Key
 Key type. More...
 
typedef Val_ Val
 Value type. More...
 
typedef List_ List
 Rest of map. More...
 
using getResult = typename findElem< Key >::type::Val
 Result type of get() More...
 
typedef MtMapIter< MtMapElem< Key_, Val_, List_ > > beginResult
 Result type of begin() More...
 
typedef MtMapIter< const MtMapElem< Key_, Val_, List_ > > beginResult_const
 
typedef MtMapIter< MtMapElem< Key_, Val_, List_ >, MtMapTailendResult
 Result type of end() More...
 
typedef MtMapIter< const MtMapElem< Key_, Val_, List_ >, MtMapTailendResult_const
 
using iterResult = MtMapIter< MtMapElem< Key_, Val_, List_ >, typename findElem< Key >::type >
 Result type of iter() More...
 
using iterResult_const = MtMapIter< const MtMapElem< Key_, Val_, List_ >, typename findElem< Key >::type >
 
using insertResult = typename insertResult_< Pairs... >::type
 Result type of insert(). New pairs are inserted at the front. More...
 
using eraseResult = typename eraseResult_< isTail, Keys... >::type
 Result type of erase(). Reconstructs type without matching keys. More...
 
typedef clearResult_::type clearResult
 Result type of clear() More...
 

Public Member Functions

 MtMapElem ()
 
template<class Pair , class... Pairs>
 MtMapElem (mt::tag< 0 >, Pair &&pair, Pairs &&...pairs)
 Ctor, pairs must be in correct order. More...
 
template<class Map >
 MtMapElem (Map &&map)
 Copy/Move any map type. Init with matching key in other map, recurse to tail. More...
 
template<class Map >
MtMapElemoperator= (Map &&rhs)
 Copy/Move-assign any map type. Assign to matching key in other map, recurse to tail. More...
 
const Valoperator[] (Key) const
 Get value at key. More...
 
Valoperator[] (Key)
 
const Valget (Key) const
 Get value at key. More...
 
Valget (Key)
 
template<class Val >
bool set (MtPair< Key, Val > &&pair)
 Set value at key from the pair (key() = value). Returns false if the key isn't found. More...
 
template<class Map >
void setDefaults (Map &&defaults)
 Set any uninitialized optional values to the defaults provided. A default for a key must be a functor that returns the value, so that the value ctor can be omitted if the key is already set. More...
 
- Public Member Functions inherited from honey::MtMapCommon< MtMapElem< Key_, Val_, List_ >, Key_, Val_, List_ >
bool hasKey (Key) const
 Check if has key. More...
 
beginResult begin ()
 Get beginning of an iterator over keys and values of this map. More...
 
beginResult_const begin () const
 
endResult end ()
 Get end of an iterator over keys and values of this map. More...
 
endResult_const end () const
 
iterResult< Keyiter (Key)
 Get iterator to element by key. More...
 
iterResult_const< Keyiter (Key) const
 
insertResult_seq< honey::priv::PairSeqGen< Pairs... >, Pairs... >::type insert (Pairs &&...pairs) const
 Insert pairs of the form (key() = value) into the map. More...
 
eraseResult< Keys... > erase (Keys...) const
 Erase keys from the map. More...
 
clearResult clear ()
 Clear map of all keys. More...
 
szt size () const
 Get size of map. More...
 
bool empty () const
 Check if empty. More...
 

Friends

template<class , class , class , class >
class MtMapCommon
 
template<class , class , class >
class MtMapElem
 
template<class , class >
class MtMapIter
 

Detailed Description

template<class Key_, class Val_, class List_>
class honey::MtMapElem< Key_, Val_, List_ >

Map element in recursive list.

See also
MtMapCommon for the rest of the members.
Meta-map for more info and examples.

Member Typedef Documentation

template<class Key_ , class Val_ , class List_ >
typedef MtMapIter<Subclass> honey::MtMapCommon< Subclass, Key_, Val_, List_ >::beginResult

Result type of begin()

template<class Key_ , class Val_ , class List_ >
typedef MtMapIter<const Subclass> honey::MtMapCommon< Subclass, Key_, Val_, List_ >::beginResult_const
template<class Key_ , class Val_ , class List_ >
typedef clearResult_ ::type honey::MtMapCommon< Subclass, Key_, Val_, List_ >::clearResult

Result type of clear()

template<class Key_ , class Val_ , class List_ >
typedef MtMapIter<Subclass, MtMapTail> honey::MtMapCommon< Subclass, Key_, Val_, List_ >::endResult

Result type of end()

template<class Key_ , class Val_ , class List_ >
typedef MtMapIter<const Subclass, MtMapTail> honey::MtMapCommon< Subclass, Key_, Val_, List_ >::endResult_const
template<class Key_ , class Val_ , class List_ >
template<class... Keys>
using honey::MtMapElem< Key_, Val_, List_ >::eraseResult = typename Super::template eraseResult<Keys...>
template<class Key_ , class Val_ , class List_ >
template<class Key >
using honey::MtMapElem< Key_, Val_, List_ >::getResult = typename Super::template getResult<Key>
template<class Key_ , class Val_ , class List_ >
template<class Key >
using honey::MtMapElem< Key_, Val_, List_ >::hasKey_ = typename Super::template hasKey_<Key>
template<class Key_ , class Val_ , class List_ >
template<class... Pairs>
using honey::MtMapElem< Key_, Val_, List_ >::insertResult = typename Super::template insertResult<Pairs...>
template<class Key_ , class Val_ , class List_ >
template<class Key >
using honey::MtMapElem< Key_, Val_, List_ >::iterResult = typename Super::template iterResult<Key>
template<class Key_ , class Val_ , class List_ >
template<class Key >
using honey::MtMapElem< Key_, Val_, List_ >::iterResult_const = typename Super::template iterResult_const<Key>
template<class Key_ , class Val_ , class List_ >
typedef Key_ honey::MtMapCommon< Subclass, Key_, Val_, List_ >::Key

Key type.

template<class Key_ , class Val_ , class List_ >
typedef List_ honey::MtMapCommon< Subclass, Key_, Val_, List_ >::List

Rest of map.

template<class Key_ , class Val_ , class List_ >
typedef Val_ honey::MtMapCommon< Subclass, Key_, Val_, List_ >::Val

Value type.

Constructor & Destructor Documentation

template<class Key_ , class Val_ , class List_ >
honey::MtMapElem< Key_, Val_, List_ >::MtMapElem ( )
inline
template<class Key_ , class Val_ , class List_ >
template<class Pair , class... Pairs>
honey::MtMapElem< Key_, Val_, List_ >::MtMapElem ( mt::tag< 0 >  ,
Pair &&  pair,
Pairs &&...  pairs 
)
inline

Ctor, pairs must be in correct order.

template<class Key_ , class Val_ , class List_ >
template<class Map >
honey::MtMapElem< Key_, Val_, List_ >::MtMapElem ( Map &&  map)
inline

Copy/Move any map type. Init with matching key in other map, recurse to tail.

Member Function Documentation

template<class Key_ , class Val_ , class List_ >
const Val& honey::MtMapElem< Key_, Val_, List_ >::get ( Key  ) const
inline

Get value at key.

template<class Key_ , class Val_ , class List_ >
Val& honey::MtMapElem< Key_, Val_, List_ >::get ( Key  )
inline
template<class Key_ , class Val_ , class List_ >
template<class Map >
MtMapElem& honey::MtMapElem< Key_, Val_, List_ >::operator= ( Map &&  rhs)
inline

Copy/Move-assign any map type. Assign to matching key in other map, recurse to tail.

template<class Key_ , class Val_ , class List_ >
const Val& honey::MtMapElem< Key_, Val_, List_ >::operator[] ( Key  ) const
inline

Get value at key.

template<class Key_ , class Val_ , class List_ >
Val& honey::MtMapElem< Key_, Val_, List_ >::operator[] ( Key  )
inline
template<class Key_ , class Val_ , class List_ >
template<class Val >
bool honey::MtMapElem< Key_, Val_, List_ >::set ( MtPair< Key, Val > &&  pair)
inline

Set value at key from the pair (key() = value). Returns false if the key isn't found.

template<class Key_ , class Val_ , class List_ >
template<class Map >
void honey::MtMapElem< Key_, Val_, List_ >::setDefaults ( Map &&  defaults)
inline

Set any uninitialized optional values to the defaults provided. A default for a key must be a functor that returns the value, so that the value ctor can be omitted if the key is already set.

Friends And Related Function Documentation

template<class Key_ , class Val_ , class List_ >
template<class , class , class , class >
friend class MtMapCommon
friend
template<class Key_ , class Val_ , class List_ >
template<class , class , class >
friend class MtMapElem
friend
template<class Key_ , class Val_ , class List_ >
template<class , class >
friend class MtMapIter
friend

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