TAGContainer Class Reference

TAGContainer Class Reference

Overview

A class that provides access to container values.

Container objects must be created via TAGManager. Once a container is created, it can be queried for key values which may depend on rules established for the container. A container is automatically refreshed periodically (every 12 hours), but can also be manually refreshed with refresh (TAGContainer).

Public Member Functions

(BOOL) - booleanForKey:
 Returns a BOOL representing the configuration value for the given key.
(double) - doubleForKey:
 Returns a double representing the configuration value for the given key.
(int64_t) - int64ForKey:
 Returns an int64_t representing the configuration value for the given key.
(NSString *) - stringForKey:
 Returns an NSString to represent the configuration value for the given key.
(void) - refresh
 Requests that this container be refreshed from the network.
(void) - close
 Closes this container so that it will no longer be refreshed.
(BOOL) - isDefault
 Returns whether this is a default container, or one refreshed from the server.
(void) - registerFunctionCallMacroHandler:forMacro:
 Registers the given macro handler to handle a given function call macro.
(id< TAGFunctionCallMacroHandler >) - functionCallMacroHandlerForMacro:
 Given the name of a function call macro, returns the handler registered for the macro.
(void) - registerFunctionCallTagHandler:forTag:
 Registers the given tag handler to handle a given function call tag.
(id< TAGFunctionCallTagHandler >) - functionCallTagHandlerForTag:
 Given the name of a function call tag, returns the handler registered for the tag.

Properties

NSString * containerId
 The ID for this container.
double lastRefreshTime
 The last time (in milliseconds since midnight Jan 1, 1970 UTC) that this container was refreshed from the network.

Member Function Documentation

- (BOOL) booleanForKey: (NSString *)  key

Returns a BOOL representing the configuration value for the given key.

If the container has no value for this key, NO will be returned.

Parameters:
keyThe key to lookup for the configuration value.
- (double) doubleForKey: (NSString *)  key

Returns a double representing the configuration value for the given key.

If the container has no value for this key, 0.0 will be returned.

Parameters:
keyThe key to lookup for the configuration value.
- (int64_t) int64ForKey: (NSString *)  key

Returns an int64_t representing the configuration value for the given key.

If the container has no value for this key, 0 will be returned.

Parameters:
keyThe key to lookup for the configuration value.
- (NSString *) stringForKey: (NSString *)  key

Returns an NSString to represent the configuration value for the given key.

If the container has no value for this key, an empty string will be returned.

Parameters:
keyThe key to lookup for the configuration value.
- (void) refresh

Requests that this container be refreshed from the network.

This call is asynchronous, so the refresh may take place on another thread.

- (void) close

Closes this container so that it will no longer be refreshed.

After closing, don't make any other calls to the container.

- (BOOL) isDefault

Returns whether this is a default container, or one refreshed from the server.

- (void) registerFunctionCallMacroHandler: (id< TAGFunctionCallMacroHandler >)  handler
forMacro: (NSString *)  macroName 

Registers the given macro handler to handle a given function call macro.

Parameters:
handlerThe handler for the macro. If the parameter is nil, the method unregisters any existing handler for that macro.
macroNameThe name of the macro which is being registered.
- (id<TAGFunctionCallMacroHandler>) functionCallMacroHandlerForMacro: (NSString *)  functionCallMacroName

Given the name of a function call macro, returns the handler registered for the macro.

Returns:
The handler registered for the macro.
- (void) registerFunctionCallTagHandler: (id< TAGFunctionCallTagHandler >)  handler
forTag: (NSString *)  tagName 

Registers the given tag handler to handle a given function call tag.

Parameters:
handlerThe handler for the tag. If the parameter is nil, the method unregisters any existing handler for that tag.
tagNameThe name of the tag which is being registered.
- (id<TAGFunctionCallTagHandler>) functionCallTagHandlerForTag: (NSString *)  functionCallTagName

Given the name of a function call tag, returns the handler registered for the tag.

Returns:
The handler registered for the tag.

Property Documentation

- (NSString*) containerId [read, copy]

The ID for this container.

- (double) lastRefreshTime [read, assign]

The last time (in milliseconds since midnight Jan 1, 1970 UTC) that this container was refreshed from the network.