AGMemoryStorage Class Reference
Inherits from | AGBaseStorage : NSObject |
Conforms to | AGStore |
Declared in | AGMemoryStorage.h AGMemoryStorage.m |
Overview
An internal AGStore implementation that uses “in-memory” storage.
IMPORTANT: Users are not required to instantiate this class directly, instead an instance of this class is * returned automatically when an DataStore with default configuration is constructed or with the type config option * set to “MEMORY”. See AGDataManager and AGStore class documentation for more information.
Instance Methods
filter:
Reads all, based on a filter, from the underlying storage system.
- (NSArray *)filter:(NSPredicate *)predicate
Parameters
- predicate
The NSPredicate to apply to the data from the underlying storage system.
Return Value
A collection (NSArray), containing all stored objects, matching the given predicate. This method only returns a copy of the data and leaves the underlying storage system intact.
Discussion
Reads all, based on a filter, from the underlying storage system.
Declared In
AGStore.h
isEmpty
Checks if the storage system contains no stored elements.
- (BOOL)isEmpty
Return Value
YES if the storage is empty, otherwise NO.
Discussion
Checks if the storage system contains no stored elements.
Declared In
AGStore.h
read:
Reads a specific object/record from the underlying storage system.
- (id)read:(id)recordId
Parameters
- recordId
id from the desired object.
Return Value
The object (or nil) read from the underlying storage.
Discussion
Reads a specific object/record from the underlying storage system.
Declared In
AGStore.h
readAll
Reads all the data from the underlying storage system.
- (NSArray *)readAll
Return Value
A collection (NSArray), containing all stored objects.
Discussion
Reads all the data from the underlying storage system.
Declared In
AGStore.h
remove:error:
Removes a specific object/record from the underlying storage system.
- (BOOL)remove:(id)record error:(NSError **)error
Parameters
- record
the desired object
- error
An error object containing details of why the remove failed.
Return Value
YES if the operation succeeds, otherwise NO.
Discussion
Removes a specific object/record from the underlying storage system.
Declared In
AGStore.h
reset:
Resets the entire storage system.
- (BOOL)reset:(NSError **)error
Parameters
- error
An error object containing details of why the reset failed.
Return Value
YES if the operation succeeds, otherwise NO.
Discussion
Resets the entire storage system.
Declared In
AGStore.h
save:error:
Saves the given object in the underlying storage system.
- (BOOL)save:(id)data error:(NSError **)error
Parameters
- data
A mutable dictionary representing key/value, dictionary must be mutable as id is optional and can be added after being saved. Data can also be a collection (e.g. NSArray) of mutable dictionary. This parameter is the object being persisted.
- error
An error object containing details of why the save failed.
Return Value
YES if the operation succeeds, otherwise NO.
Discussion
Saves the given object in the underlying storage system.
Declared In
AGStore.h