Class Cache<T>
Cache template class. The cache is at the core of TuringTrader's auto-magic indicator objects, as well as the the data sources. Cache objects are accessed via a cryptographic key, which is created by the CacheId class.
Inherited Members
Namespace: TuringTrader.Simulator
Assembly: TuringTrader.Simulator.dll
Syntax
public static class Cache<T>
Type Parameters
| Name | Description |
|---|---|
| T | type of cache |
Methods
| Edit this page View SourceGetData(CacheId, Func<T>, bool)
Retrieve data from cache.
Declaration
public static T GetData(CacheId id, Func<T> initialRetrieval, bool global = false)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheId | id | unique ID of data |
| Func<T> | initialRetrieval | lambda to retrieve data not found in cache |
| bool | global | set to true, to cache globally across all threads |
Returns
| Type | Description |
|---|---|
| T | cached data |