Belle II Software  release-05-02-19
KeyValBox< KeyType, ValueType > Class Template Reference

Minimal container storing a pair of < KeyType, ValueType> More...

#include <KeyValBox.h>

Collaboration diagram for KeyValBox< KeyType, ValueType >:

Public Types

using BoxEntry = std::pair< KeyType, ValueType >
 typedef for readable entry-type
 
using Iterator = typename std::vector< BoxEntry >::iterator
 typedef for more readable iterator-type
 
using ConstIterator = typename std::vector< BoxEntry >::const_iterator
 typedef for more readable iterator-type
 

Public Member Functions

ValueType * find (const KeyType &aKey)
 for given key a pointer to the value is returned. More...
 
void push_back (std::pair< KeyType, ValueType > &newPair)
 push_back for new pair given
 
void push_back (std::pair< KeyType, ValueType > newPair)
 push_back for new pair given
 
Iterator begin ()
 returns iterator for container: begin
 
ConstIterator begin () const
 returns iterator for container: begin
 
Iterator end ()
 returns iterator for container: end
 
ConstIterator end () const
 returns iterator for container: end
 
unsigned int size () const
 returns number of entries in container:
 

Protected Attributes

std::vector< std::pair< KeyType, ValueType > > m_container
 the container containing the keys and values
 

Detailed Description

template<class KeyType, class ValueType>
class Belle2::KeyValBox< KeyType, ValueType >

Minimal container storing a pair of < KeyType, ValueType>

Definition at line 34 of file KeyValBox.h.

Member Function Documentation

◆ find()

ValueType* find ( const KeyType &  aKey)
inline

for given key a pointer to the value is returned.

If key was invalid, a NULL-ptr will be returned

Definition at line 55 of file KeyValBox.h.

55  : &foundPos->second);
56  }
57 
58 
60  void push_back(std::pair<KeyType, ValueType>& newPair) { m_container.push_back(newPair); }
61 
62 
64  void push_back(std::pair<KeyType, ValueType> newPair) { m_container.push_back(newPair); }

The documentation for this class was generated from the following file:
Belle2::KeyValBox::m_container
std::vector< std::pair< KeyType, ValueType > > m_container
the container containing the keys and values
Definition: KeyValBox.h:38
Belle2::KeyValBox::push_back
void push_back(std::pair< KeyType, ValueType > &newPair)
push_back for new pair given
Definition: KeyValBox.h:68