FMIceLinkManagedConcurrentDictionary Class Reference

Inherits from NSObject
Conforms to TKey
TValue
__covariant
Declared in FMIceLinkManagedConcurrentDictionary.h
FMIceLinkManagedConcurrentDictionary.m

Overview

A ConcurrentDictonary that maps to the appropriate platform version.

– addOrUpdateWithKey:addValue:updateValueFactory:

Updates a value in the dictionary or adds it if it does not exist.
- (id)addOrUpdateWithKey:(id)key addValue:(id)addValue updateValueFactory:(FMIceLinkFunction2 *)updateValueFactory

Parameters

key

The key to use for updating for adding.

addValue

The value to be added for an absent key.

updateValueFactory

The function to use for generating a value based on an existing key. @return

Discussion

Updates a value in the dictionary or adds it if it does not exist.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– addOrUpdateWithKey:addValue:updateValueFactoryBlock:

Updates a value in the dictionary or adds it if it does not exist.
- (id)addOrUpdateWithKey:(id)key addValue:(id)addValue updateValueFactoryBlock:(id ( ^ ) ( id , id ))updateValueFactoryBlock

Parameters

key

The key to use for updating for adding.

addValue

The value to be added for an absent key.

updateValueFactoryBlock

The function to use for generating a value based on an existing key. @return

Discussion

Updates a value in the dictionary or adds it if it does not exist.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– addOrUpdateWithKeyAndAddValueAndUpdateValueFactoryBlock

Updates a value in the dictionary or adds it if it does not exist.

@inlineparam key The key to use for updating for adding. @inlineparam addValue The value to be added for an absent key. @inlineparam updateValueFactoryBlock The function to use for generating a value based on an existing key. @return

- (id ( ^ ) ( id , id , id ( ^ ) ( id , id ) ))addOrUpdateWithKeyAndAddValueAndUpdateValueFactoryBlock

Discussion

Updates a value in the dictionary or adds it if it does not exist.

@inlineparam key The key to use for updating for adding. @inlineparam addValue The value to be added for an absent key. @inlineparam updateValueFactoryBlock The function to use for generating a value based on an existing key. @return

Declared In

FMIceLinkManagedConcurrentDictionary.h

– clear

Clears the dictionary of all items.
- (void)clear

Discussion

Clears the dictionary of all items.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– containsKey:

True if the dictionary contains the key.
- (bool)containsKey:(id)key

Parameters

key

The key to check.

Discussion

True if the dictionary contains the key.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– count

Gets the number of items in the dictionary.
- (int)count

Discussion

Gets the number of items in the dictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– getOrAddWithKey:valueFactory:

Gets the value from the dictionary or adds a new one if it does not exist.
- (id)getOrAddWithKey:(id)key valueFactory:(FMIceLinkFunction1 *)valueFactory

Parameters

key

The key to use when adding to the dictionary.

valueFactory

The Func that will create a value if needed.

Return Value

The dictionary value if exist, the value returned by the Func if not.

Discussion

Gets the value from the dictionary or adds a new one if it does not exist.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– getOrAddWithKey:valueFactoryBlock:

Gets the value from the dictionary or adds a new one if it does not exist.
- (id)getOrAddWithKey:(id)key valueFactoryBlock:(id ( ^ ) ( id ))valueFactoryBlock

Parameters

key

The key to use when adding to the dictionary.

valueFactoryBlock

The Func that will create a value if needed.

Return Value

The dictionary value if exist, the value returned by the Func if not.

Discussion

Gets the value from the dictionary or adds a new one if it does not exist.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– getOrAddWithKeyAndValueFactoryBlock

Gets the value from the dictionary or adds a new one if it does not exist.

@inlineparam key The key to use when adding to the dictionary. @inlineparam valueFactoryBlock The Func that will create a value if needed.

- (id ( ^ ) ( id , id ( ^ ) ( id ) ))getOrAddWithKeyAndValueFactoryBlock

Return Value

The dictionary value if exist, the value returned by the Func if not.

Discussion

Gets the value from the dictionary or adds a new one if it does not exist.

@inlineparam key The key to use when adding to the dictionary. @inlineparam valueFactoryBlock The Func that will create a value if needed.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– init

Creates a new instance.
- (instancetype)init

Discussion

Creates a new instance.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– initWithHashCallback:

Creates a new ManagedConcurrentDictionary.
- (instancetype)initWithHashCallback:(FMIceLinkFunction1 *)hashCallback

Parameters

hashCallback

The hash function to use when the backing dictionary requires the key to be a string.

Discussion

Creates a new ManagedConcurrentDictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– initWithHashCallbackBlock:

Creates a new ManagedConcurrentDictionary.
- (instancetype)initWithHashCallbackBlock:(NSString *( ^ ) ( id ))hashCallbackBlock

Parameters

hashCallbackBlock

The hash function to use when the backing dictionary requires the key to be a string.

Discussion

Creates a new ManagedConcurrentDictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– isEmpty

Gets true if dictionary is empty.
- (bool)isEmpty

Discussion

Gets true if dictionary is empty.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– keys

Gets an array of keys.
- (NSMutableArray *)keys

Discussion

Gets an array of keys.

Declared In

FMIceLinkManagedConcurrentDictionary.h

+ managedConcurrentDictionary

Creates a new instance.
+ (FMIceLinkManagedConcurrentDictionary *)managedConcurrentDictionary

Discussion

Creates a new instance.

Declared In

FMIceLinkManagedConcurrentDictionary.h

+ managedConcurrentDictionaryWithHashCallback:

Creates a new ManagedConcurrentDictionary.
+ (FMIceLinkManagedConcurrentDictionary *)managedConcurrentDictionaryWithHashCallback:(FMIceLinkFunction1 *)hashCallback

Parameters

hashCallback

The hash function to use when the backing dictionary requires the key to be a string.

Discussion

Creates a new ManagedConcurrentDictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

+ managedConcurrentDictionaryWithHashCallbackBlock:

Creates a new ManagedConcurrentDictionary.
+ (FMIceLinkManagedConcurrentDictionary *)managedConcurrentDictionaryWithHashCallbackBlock:(NSString *( ^ ) ( id ))hashCallbackBlock

Parameters

hashCallbackBlock

The hash function to use when the backing dictionary requires the key to be a string.

Discussion

Creates a new ManagedConcurrentDictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– tryAddWithKey:value:

Tries to add a new value to the dictionary.
- (bool)tryAddWithKey:(id)key value:(id)value

Parameters

key

The key to use when adding.

value

The value to be added to the dictionary.

Return Value

True if added, false if key already exists.

Discussion

Tries to add a new value to the dictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– tryGetValueWithKey:value:

Tries to get a value from the dictionary.
- (bool)tryGetValueWithKey:(id)key value:(id *)value

Parameters

key

They key of the item to get form the dictionary.

value

The value that was just received or null if failed.

Return Value

True if succeeded.

Discussion

Tries to get a value from the dictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– tryRemoveWithKey:value:

Tries and removes a value from the dictionary.
- (bool)tryRemoveWithKey:(id)key value:(id *)value

Parameters

key

The key of the item to remove.

value

The value that was just removed.

Return Value

True if successful.

Discussion

Tries and removes a value from the dictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– tryUpdateWithKey:newValue:comparisonValue:

Tries to update the value in the dictionary.
- (bool)tryUpdateWithKey:(id)key newValue:(id)newValue comparisonValue:(id)comparisonValue

Parameters

key

The key to use when updating.

newValue

The new value.

comparisonValue

The value to compare with the current value in the dictionary.

Return Value

True if succeeded.

Discussion

Tries to update the value in the dictionary.

Declared In

FMIceLinkManagedConcurrentDictionary.h

– values

Gets an array of Values.
- (NSMutableArray *)values

Discussion

Gets an array of Values.

Declared In

FMIceLinkManagedConcurrentDictionary.h