Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
KVMap Class Reference
#include <KVMap.h>
Inherits NonCopyable< KVMap >.
Public Member Functions | |
int | init () |
Initializes KVMap. | |
int | attach (const char *partition_name, kvstore_config_t *kv_config) |
Attach a KVStore partition configuration, and add it to the KVMap array. | |
int | detach (const char *partition_name) |
Detach a KVStore partition configuration from the KVMap array, and deinitialize its components. | |
int | deinit () |
Deinitialize the KVMap array, and deinitialize all the attached partitions. | |
int | lookup (const char *full_name, mbed::KVStore **kv_instance, size_t *key_index, uint32_t *flags_mask=NULL) |
Full name lookup, and then break it into KVStore instance and key. | |
KVStore * | get_internal_kv_instance (const char *name) |
Getter for the internal KVStore instance. | |
KVStore * | get_external_kv_instance (const char *name) |
Getter for the external KVStore instance. | |
KVStore * | get_main_kv_instance (const char *name) |
Getter for the main KVStore instance. | |
BlockDevice * | get_internal_blockdevice_instance (const char *name) |
Getter for the internal BlockDevice instance. | |
BlockDevice * | get_external_blockdevice_instance (const char *name) |
Getter for the external BlockDevice instance. | |
FileSystem * | get_external_filesystem_instance (const char *name) |
Getter for the external FileSystem instance. | |
Static Public Member Functions | |
static KVMap & | get_instance () |
As a singleton, return the single instance of the class. | |
Private Member Functions | |
MBED_DEPRECATED ("Invalid copy construction of a NonCopyable resource.") NonCopyable(const NonCopyable &) | |
NonCopyable copy constructor. | |
MBED_DEPRECATED ("Invalid copy assignment of a NonCopyable resource.") NonCopyable &operator | |
NonCopyable copy assignment operator. |
Detailed Description
KVMap class.
Singleton class to manage the mapping of KVStore partition and its naming.
Definition at line 90 of file KVMap.h.
Member Function Documentation
int attach | ( | const char * | partition_name, |
kvstore_config_t * | kv_config | ||
) |
int deinit | ( | ) |
int detach | ( | const char * | partition_name ) |
BlockDevice * get_external_blockdevice_instance | ( | const char * | name ) |
Getter for the external BlockDevice instance.
- Parameters:
-
name String parameter contains the /partition name/.
- Returns:
- Pointer to the external BlockDevice on success, NULL on failure or if not exist
FileSystem * get_external_filesystem_instance | ( | const char * | name ) |
Getter for the external FileSystem instance.
- Parameters:
-
name String parameter contains the /partition name/.
- Returns:
- Pointer to the external FileSystem on success, NULL on failure or if not exist
KVStore * get_external_kv_instance | ( | const char * | name ) |
static KVMap& get_instance | ( | ) | [static] |
As a singleton, return the single instance of the class.
This class is a singleton for the following reasons:
- Ease of use, so you don't have to coordinate instantiations.
- Lazy instantiation of internal data, (which we can't achieve with simple static classes).
- Returns:
- Singleton instance reference.
BlockDevice * get_internal_blockdevice_instance | ( | const char * | name ) |
Getter for the internal BlockDevice instance.
- Parameters:
-
name String parameter contains the /partition name/.
- Returns:
- Pointer to the internal BlockDevice on success, NULL on failure or if not exist
KVStore * get_internal_kv_instance | ( | const char * | name ) |
KVStore * get_main_kv_instance | ( | const char * | name ) |
int init | ( | ) |
int lookup | ( | const char * | full_name, |
mbed::KVStore ** | kv_instance, | ||
size_t * | key_index, | ||
uint32_t * | flags_mask = NULL |
||
) |
Full name lookup, and then break it into KVStore instance and key.
- Parameters:
-
[in] full_name String parameter contains the partition name to look for. The String should be formated as follow "/partition name/key". The key is optional. [out] kv_instance Returns the main KVStore instance associated with the required partition name. [out] key_index Returns an index to the first character of the key. [out] flags_mask Return the flag masking for the current configuration
- Returns:
- 0 on success, negative error code on failure
Generated on Tue Jul 12 2022 13:55:43 by
