Uniot Docs
  • Introduction
  • Guides
    • Getting Started
    • Uniot Badge
    • Device Network
  • Foundations
    • Edge Logic Deployment
  • General Concepts
    • Primitives
    • Scripting
  • Platform
    • Dashboard
    • Sandbox
      • Visual Editor
        • Special
        • Logic
        • Math
        • Loops
        • Text
        • Variables
        • Functions
        • Primitives
      • Logger
      • Emulator
      • Control Panel
  • Advanced
    • Uniot Core
      • Scheduler
        • TaskScheduler
        • IExecutor
        • ISchedulerConnectionKit
        • Task
        • SchedulerTask
      • AppKit
        • AppKit
        • LispDevice
        • LispPrimitives
        • TopDevice
      • CBORWrapper
        • CBORObject
        • COSE
        • COSEMessage
        • ICOSESigner
      • Date
        • Date
        • SimpleNTP
      • EventBus
        • EventBus
        • IEventBusConnectionKit
        • DataChannels
        • EventEmitter
        • EventListener
        • EventEntity
        • CallbackEventListener
      • Hardware
        • Button
      • LispWrapper
        • DefaultPrimitives
        • LispHelper
        • PrimitiveExpeditor
        • unLisp
      • MQTTWrapper
        • CallbackMQTTDevice
        • MQTTDevice
        • MQTTKit
        • MQTTPath
      • Network
        • ConfigCaptivePortal
        • NetworkController
        • NetworkScheduler
      • Register
        • GpioRegister
        • ObjectRegister
        • ObjectRegisterRecord
        • Register
        • RegisterManager
        • RegisterManagerProxy
      • Storage
        • CBORStorage
        • CrashStorage
        • Storage
        • WifiStorage
      • Utils
        • Array
        • Bytes
        • ClearQueue
        • IterableQueue
        • LimitedQueue
        • GlobalBufferMemoryManager
        • Map
        • Singleton
        • TypeId
      • Credentials
    • Uniot Lisp
      • Language Description
      • Embedding Instructions
  • API
    • MQTT Convention
Powered by GitBook
On this page
  1. Advanced
  2. Uniot Core
  3. Utils

Map

The Map utility provides a simple and efficient way to associate keys with values using an iterable queue structure. It offers dynamic key-value management while ensuring minimal memory overhead and optimal performance in resource-constrained environments.

Key Features:

  • Dynamic storage of key-value pairs using an iterable queue.

  • Simple interface for common map operations.

  • Efficient memory usage suitable for embedded systems.

  • Template-based design for flexibility with various data types.

Template Parameters:

  • T_Key The type of the keys used to identify values within the map. Must support equality comparison (operator==).

  • T_Value The type of the values associated with keys in the map.

Methods:

  • bool put(const T_Key& key, const T_Value& value) Inserts a key-value pair into the map. If the key already exists, the method does not overwrite the existing value and returns false to indicate the insertion was unsuccessful.

  • const T_Value& get(const T_Key& key, const T_Value& defaultValue = {}) const Retrieves the value associated with a specific key.

  • bool exist(const T_Key& key) const Checks whether a specific key exists within the map.

  • bool remove(const T_Key& key) Removes a key-value pair from the map based on the provided key.

PreviousGlobalBufferMemoryManagerNextSingleton

Last updated 4 months ago