19#include "kvstore/KVStore.h"
20#include "rtos/Mutex.h"
21#include "platform/SingletonPtr.h"
22#include "blockdevice/BlockDevice.h"
23#include "filesystem/FileSystem.h"
27#define MAX_ATTACHED_KVS 3
106 static KVMap instance;
154 int lookup(
const char *full_name,
mbed::KVStore **kv_instance,
size_t *key_index, uint32_t *flags_mask = NULL);
211#if !defined(DOXYGEN_ONLY)
229 int config_lookup(
const char *full_name,
kvstore_config_t **kv_config,
size_t *key_index);
233 int _kv_num_attached_kvs;
A hardware device capable of writing and reading blocks.
int init()
Initializes KVMap.
BlockDevice * get_external_blockdevice_instance(const char *name)
Getter for the external BlockDevice instance.
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.
BlockDevice * get_internal_blockdevice_instance(const char *name)
Getter for the internal BlockDevice instance.
KVStore * get_external_kv_instance(const char *name)
Getter for the external KVStore instance.
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.
FileSystem * get_external_filesystem_instance(const char *name)
Getter for the external FileSystem instance.
KVStore * get_main_kv_instance(const char *name)
Getter for the main KVStore instance.
int attach(const char *partition_name, kvstore_config_t *kv_config)
Attach a KVStore partition configuration, and add it to the KVMap array.
static KVMap & get_instance()
As a singleton, return the single instance of the class.
Prevents generation of copy constructor and copy assignment operator in derived classes.
Utility class for creating and using a singleton.
This structure maps between a string name and a partition configuration.
kvstore_config_t * kv_config
Configuration struct.
char * partition_name
Partition name string.
This structure represent a KVStore partition configuration.
BlockDevice * external_bd
A pointer external BlockDevice of the KVStore partition.
FileSystem * external_fs
A pointer external FileSystem of the KVStore partition.
KVStore * internal_store
A pointer Internal store of the KVStore partition.
BlockDevice * internal_bd
A pointer Internal FlashIAP BlockDevice of the KVStore partition.
KVStore * external_store
A pointer external store of the KVStore partition.
uint32_t flags_mask
This is a flag masking value for the KVStore global API.
KVStore * kvstore_main_instance
A Pointer to main instance of the KVStore partition.