API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
AEEISettingsStoreFactory.h AEEISettings.h AEESettingsReg.bid
SettingsHeapFactory is an implementation of ISettingsStoreFactory that provides an ISettings implementation (SettingsHeapStore) that allows access to heap-based settings stores. These are useful for modules that wish to have system-wide settings that need not persist across power cycles.
Store Information string format:
The format of the store information string provided to SettingsHeapFactory during an ISettingsStoreFactory_Create() call is defined as follows:

Characters before or after the string as shown above are ignored.
         the maximum size in bytes that the store is allowed to consume. If the
         quota is reached, writes to the store may fail. A single setting's heap
         usage is calculated as the total length in bytes of both the key and
         the value, including NULL terminators.

Standalone Usage: A SettingsHeapStore may be created standalone using the ISettingsStoreFactory interface by providing a quota value to the call to ISettingsStoreFactory_Create(). With the returned ISettings object, the caller may get, set, delete, reset, and enumerate the settings in the heap. However, a standalone SettingsHeapStore does not support change notifications.
Native Settings Usage: Modules may create a heap-based native settings store by adding the following to the module's .cif file:
      local s = require 'SettingsCIFHelpers'
      s:RegisterHeap {
         owner = 0xdeadbeef,
         key = "/myApp/myHeapSettings",
         quota = 0x1000,
         acls = { ... }

If "/myApp/myHeapSettings/setting1" = "hello world", the heap usage for that particular setting would be 21 bytes ("setting1" + "hello world").
See AEESettingsReg.bid for more information on native settings.
Default Settings: SettingsHeapStore does not support default settings. Calling ISettings_Reset on SettingsHeapStore will remove all settings contained in the store.
Default Interface Name