LazyStringMap.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/core/data/share/LazyStringMap.hpp"

LazyStringMap

Lazy String Map keeps keys, and values as memory label. Once value is requested by user, the new memory block is allocated and value is copied to be stored permanently.

namespace oatpp { namespace data { namespace share { 
  template<class Key>
  class LazyStringMap {}
}}}

Methods

Return Type Name Summary
[none] LazyStringMap Multiple implementations:
  1. Constructor.
  2. Default copy-constructor.
  3. Move constructor.
void put Put value to map.
bool putIfNotExists Put value to map if not already exists.
oatpp::String get Get value as oatpp::String.
T getAsMemoryLabel Get value as a memory label.
T getAsMemoryLabel_Unsafe Get value as a memory label without allocating memory for value.
const std::unordered_map<Key, StringKeyLabel>& getAll Get map of all values.
const std::unordered_map<Key, StringKeyLabel>& getAll_Unsafe Get map of all values without allocating memory for those keys/values.
v_int32 getSize Get number of entries in the map.

LazyStringMap::LazyStringMap

  1. Constructor.
    LazyStringMap()
      : m_fullyInitialized(false)
    
  2. Default copy-constructor.
    • @param other
    LazyStringMap(const LazyStringMap& other) = default
    
  3. Move constructor.
    • @param other
    LazyStringMap(LazyStringMap&& other)
      : m_fullyInitialized(false)
      , m_map(std::move(other.m_map))
    

LazyStringMap::put

Put value to map.

  • @param key
  • @param value

void put(const Key& key, const StringKeyLabel& value)

LazyStringMap::putIfNotExists

Put value to map if not already exists.

  • @param key
  • @param value
  • @return

bool putIfNotExists(const Key& key, const StringKeyLabel& value)

LazyStringMap::get

Get value as oatpp::String.

  • @param key
  • @return

oatpp::String get(const Key& key) const

LazyStringMap::getAsMemoryLabel

Get value as a memory label.

template<class T>
T getAsMemoryLabel(const Key& key) const

LazyStringMap::getAsMemoryLabel_Unsafe

Get value as a memory label without allocating memory for value.

template<class T>
T getAsMemoryLabel_Unsafe(const Key& key) const

LazyStringMap::getAll

Get map of all values.

  • @return

const std::unordered_map<Key, StringKeyLabel>& getAll() const

LazyStringMap::getAll_Unsafe

Get map of all values without allocating memory for those keys/values.

  • @return

const std::unordered_map<Key, StringKeyLabel>& getAll_Unsafe() const

LazyStringMap::getSize

Get number of entries in the map.

  • @return

v_int32 getSize() const