Poco

template < class Key, class Mapped, class Container = std::vector < std::pair < Key, Mapped >>, bool CaseSensitive = false >

class ListMap

File Information

Library: Foundation
Package: Core
Header: Poco/ListMap.h

Description

This class implements a multimap in terms of a sequential container. The use for this type of associative container is wherever automatic ordering of elements is not desirable. Naturally, this container will have inferior data retrieval performance and it is not recommended for use with large datasets. The main purpose within POCO is for Internet messages (email message, http headers etc), to prevent automatic header entry reordering.

Member Summary

Member Functions: begin, clear, empty, end, erase, find, insert, operator =, operator [], size, swap

Types Aliases

ConstIterator

using ConstIterator = typename Container::const_iterator;

ConstPointer

using ConstPointer = const Mapped *;

ConstReference

using ConstReference = const Mapped &;

Iterator

using Iterator = typename Container::iterator;

KeyType

using KeyType = Key;

MappedType

using MappedType = Mapped;

Pointer

using Pointer = Mapped *;

Reference

using Reference = Mapped &;

SizeType

using SizeType = typename Container::size_type;

ValueType

using ValueType = typename Container::value_type;

Constructors

ListMap inline

ListMap();

Creates an empty ListMap.

ListMap inline

explicit ListMap(
    std::size_t initialReserve
);

Creates the ListMap with room for initialReserve entries.

ListMap inline

ListMap(
    const ListMap & other
);

ListMap inline

ListMap(
    ListMap && other
) noexcept;

Member Functions

begin inline

ConstIterator begin() const;

Returns the beginning of the map.

begin inline

Iterator begin();

Returns the beginning of the map.

clear inline

void clear();

empty inline

bool empty() const;

end inline

ConstIterator end() const;

Returns the end of the map.

end inline

Iterator end();

Returns the end of the map.

erase inline

void erase(
    Iterator it
);

erase inline

SizeType erase(
    const KeyType & key
);

find inline

ConstIterator find(
    const KeyType & key
) const;

Finds the first occurrence of the key and returns iterator pointing to the found entry or iterator pointing to the end if entry is not found.

find inline

Iterator find(
    const KeyType & key
);

Finds the first occurrence of the key and returns iterator pointing to the found entry or iterator pointing to the end if entry is not found.

insert inline

Iterator insert(
    const ValueType & val
);

Inserts the value into the map. If one or more values already exist, new value is inserted at the end of the block. Thus, all the equal value entries are located sequentially at all times. Returns iterator pointing to the newly inserted value

operator = inline

ListMap & operator = (
    const ListMap & map
);

Assigns another ListMap.

operator = inline

ListMap & operator = (
    ListMap && map
) noexcept;

Assigns another ListMap.

operator [] inline

ConstReference operator[] (
    const KeyType & key
) const;

operator [] inline

Reference operator[] (
    const KeyType & key
);

size inline

std::size_t size() const;

swap inline

void swap(
    ListMap & map
);

Swaps the ListMap with another one.

Securely control IoT edge devices from anywhere   Connect a Device