19 #include "features/storage/kvstore/include/KVStore.h" 20 #include "platform/PlatformMutex.h" 21 #include "platform/SingletonPtr.h" 22 #include "features/storage/blockdevice/BlockDevice.h" 23 #include "features/storage/filesystem/FileSystem.h" 27 #define MAX_ATTACHED_KVS 3 106 static KVMap instance;
135 int detach(
const char *partition_name);
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;
FileSystem * external_fs
A pointer external FileSystem of the KVStore partition.
int attach(const char *partition_name, kvstore_config_t *kv_config)
Attach a KVStore partition configuration, and add it to the KVMap array.
KVStore * internal_store
A pointer Internal store of the KVStore partition.
KVStore * external_store
A pointer external store of the KVStore partition.
int deinit()
Deinitialize the KVMap array, and deinitialize all the attached partitions.
A hardware device capable of writing and reading blocks.
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.
FileSystem * get_external_filesystem_instance(const char *name)
Getter for the external FileSystem instance.
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.
int detach(const char *partition_name)
Detach a KVStore partition configuration from the KVMap array, and deinitialize its components...
This structure maps between a string name and a partition configuration.
uint32_t flags_mask
This is a flag masking value for the KVStore global API.
BlockDevice * get_external_blockdevice_instance(const char *name)
Getter for the external BlockDevice instance.
BlockDevice * internal_bd
A pointer Internal FlashIAP BlockDevice of the KVStore partition.
KVStore * get_main_kv_instance(const char *name)
Getter for the main KVStore instance.
KVStore * kvstore_main_instance
A Pointer to main instance of the KVStore partition.
kvstore_config_t * kv_config
Configuration struct.
char * partition_name
Partition name string.
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.
int init()
Initializes KVMap.
BlockDevice * get_internal_blockdevice_instance(const char *name)
Getter for the internal BlockDevice instance.
This structure represent a KVStore partition configuration.
BlockDevice * external_bd
A pointer external BlockDevice of the KVStore partition.