Libosmium  2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
osmium::ItemStash::handle_type Class Reference

#include <item_stash.hpp>

Public Member Functions

 handle_type () noexcept
 The default constructor creates an invalid handle. More...
 
bool valid () const noexcept
 Is this a valid handle? More...
 

Private Member Functions

 handle_type (std::size_t new_value) noexcept
 

Private Attributes

std::size_t value
 

Friends

class ItemStash
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, const ItemStash::handle_type &handle)
 

Detailed Description

This is the type of the handle returned by the add_item() call. It is used to access the item again with get_item() or get<>() or erase it with remove_item().

There is one special handle, the invalid handle. It can be created by calling the default constructor. You can use it for instance to mark removed objects in your data structures. Valid handles can only be constructed by the ItemStash class.

Constructor & Destructor Documentation

◆ handle_type() [1/2]

osmium::ItemStash::handle_type::handle_type ( std::size_t  new_value)
inlineexplicitprivatenoexcept

◆ handle_type() [2/2]

osmium::ItemStash::handle_type::handle_type ( )
inlinenoexcept

The default constructor creates an invalid handle.

Member Function Documentation

◆ valid()

bool osmium::ItemStash::handle_type::valid ( ) const
inlinenoexcept

Is this a valid handle?

Friends And Related Function Documentation

◆ ItemStash

friend class ItemStash
friend

◆ operator<<

template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< ( std::basic_ostream< TChar, TTraits > &  out,
const ItemStash::handle_type handle 
)
friend

Print the handle for debugging purposes. An invalid handle will be printed as the single letter '-'. A valid handle will be printed as a unique (for an ItemStash object) number.

Member Data Documentation

◆ value

std::size_t osmium::ItemStash::handle_type::value
private

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