Lean
$LEAN_TAG$
|
Helper class for easier access to IObjectStore methods More...
Public Member Functions | |
ObjectStore (IObjectStore store) | |
Initializes a new instance of the ObjectStore class More... | |
void | Initialize (int userId, int projectId, string userToken, Controls controls) |
Initializes the object store More... | |
void | Clear () |
Will clear the object store state cache. This is useful when the object store is used concurrently by nodes which want to share information More... | |
bool | ContainsKey (string path) |
Determines whether the store contains data for the specified path More... | |
byte[] | ReadBytes (string path) |
Returns the object data for the specified path More... | |
bool | SaveBytes (string path, byte[] contents) |
Saves the object data for the specified path More... | |
bool | Delete (string path) |
Deletes the object data for the specified path More... | |
string | GetFilePath (string path) |
Returns the file path for the specified path More... | |
string | Read (string path, Encoding encoding=null) |
Returns the string object data for the specified path More... | |
string | ReadString (string path, Encoding encoding=null) |
Returns the string object data for the specified path More... | |
T | ReadJson< T > (string path, Encoding encoding=null, JsonSerializerSettings settings=null) |
Returns the JSON deserialized object data for the specified path More... | |
T | ReadXml< T > (string path, Encoding encoding=null) |
Returns the XML deserialized object data for the specified path More... | |
bool | Save (string path) |
Saves the data from a local file path associated with the specified path More... | |
bool | Save (string path, string text, Encoding encoding=null) |
Saves the object data in text format for the specified path More... | |
bool | SaveString (string path, string text, Encoding encoding=null) |
Saves the object data in text format for the specified path More... | |
bool | SaveJson< T > (string path, T obj, Encoding encoding=null, JsonSerializerSettings settings=null) |
Saves the object data in JSON format for the specified path More... | |
bool | SaveXml< T > (string path, T obj, Encoding encoding=null) |
Saves the object data in XML format for the specified path More... | |
IEnumerator< KeyValuePair< string, byte[]> > | GetEnumerator () |
Returns an enumerator that iterates through the collection. More... | |
void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
Public Attributes | |
ICollection< string > | Keys => _store.Keys |
Returns the file paths present in the object store. This is specially useful not to load the object store into memory More... | |
Properties | |
EventHandler< ObjectStoreErrorRaisedEventArgs > | ErrorRaised |
Event raised each time there's an error More... | |
Properties inherited from QuantConnect.Interfaces.IObjectStore | |
ICollection< string > | Keys [get] |
Returns the file paths present in the object store. This is specially useful not to load the object store into memory More... | |
Additional Inherited Members | |
Events inherited from QuantConnect.Interfaces.IObjectStore | |
EventHandler< ObjectStoreErrorRaisedEventArgs > | ErrorRaised |
Event raised each time there's an error More... | |
Helper class for easier access to IObjectStore methods
Definition at line 31 of file ObjectStore.cs.
QuantConnect.Storage.ObjectStore.ObjectStore | ( | IObjectStore | store | ) |
Initializes a new instance of the ObjectStore class
store | The IObjectStore instance to wrap |
Definition at line 48 of file ObjectStore.cs.
void QuantConnect.Storage.ObjectStore.Initialize | ( | int | userId, |
int | projectId, | ||
string | userToken, | ||
Controls | controls | ||
) |
Initializes the object store
userId | The user id |
projectId | The project id |
userToken | The user token |
controls | The job controls instance |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 60 of file ObjectStore.cs.
void QuantConnect.Storage.ObjectStore.Clear | ( | ) |
Will clear the object store state cache. This is useful when the object store is used concurrently by nodes which want to share information
Implements QuantConnect.Interfaces.IObjectStore.
bool QuantConnect.Storage.ObjectStore.ContainsKey | ( | string | path | ) |
Determines whether the store contains data for the specified path
path | The object path |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 80 of file ObjectStore.cs.
byte [] QuantConnect.Storage.ObjectStore.ReadBytes | ( | string | path | ) |
Returns the object data for the specified path
path | The object path |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 90 of file ObjectStore.cs.
bool QuantConnect.Storage.ObjectStore.SaveBytes | ( | string | path, |
byte[] | contents | ||
) |
Saves the object data for the specified path
path | The object path |
contents | The object data |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 101 of file ObjectStore.cs.
bool QuantConnect.Storage.ObjectStore.Delete | ( | string | path | ) |
Deletes the object data for the specified path
path | The object path |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 111 of file ObjectStore.cs.
string QuantConnect.Storage.ObjectStore.GetFilePath | ( | string | path | ) |
Returns the file path for the specified path
path | The object path |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 121 of file ObjectStore.cs.
string QuantConnect.Storage.ObjectStore.Read | ( | string | path, |
Encoding | encoding = null |
||
) |
Returns the string object data for the specified path
path | The object path |
encoding | The string encoding used |
Definition at line 132 of file ObjectStore.cs.
string QuantConnect.Storage.ObjectStore.ReadString | ( | string | path, |
Encoding | encoding = null |
||
) |
Returns the string object data for the specified path
path | The object path |
encoding | The string encoding used |
Definition at line 146 of file ObjectStore.cs.
T QuantConnect.Storage.ObjectStore.ReadJson< T > | ( | string | path, |
Encoding | encoding = null , |
||
JsonSerializerSettings | settings = null |
||
) |
Returns the JSON deserialized object data for the specified path
path | The object path |
encoding | The string encoding used |
settings | The settings used by the JSON deserializer |
Definition at line 158 of file ObjectStore.cs.
T QuantConnect.Storage.ObjectStore.ReadXml< T > | ( | string | path, |
Encoding | encoding = null |
||
) |
Returns the XML deserialized object data for the specified path
path | The object path |
encoding | The string encoding used |
Definition at line 172 of file ObjectStore.cs.
bool QuantConnect.Storage.ObjectStore.Save | ( | string | path | ) |
Saves the data from a local file path associated with the specified path
If the file does not exist it will throw an exception
path | The object path |
Definition at line 191 of file ObjectStore.cs.
bool QuantConnect.Storage.ObjectStore.Save | ( | string | path, |
string | text, | ||
Encoding | encoding = null |
||
) |
Saves the object data in text format for the specified path
path | The object path |
text | The string object to be saved |
encoding | The string encoding used, Encoding.UTF8 by default |
Definition at line 211 of file ObjectStore.cs.
bool QuantConnect.Storage.ObjectStore.SaveString | ( | string | path, |
string | text, | ||
Encoding | encoding = null |
||
) |
Saves the object data in text format for the specified path
path | The object path |
text | The string object to be saved |
encoding | The string encoding used |
Definition at line 224 of file ObjectStore.cs.
bool QuantConnect.Storage.ObjectStore.SaveJson< T > | ( | string | path, |
T | obj, | ||
Encoding | encoding = null , |
||
JsonSerializerSettings | settings = null |
||
) |
Saves the object data in JSON format for the specified path
path | The object path |
obj | The object to be saved |
encoding | The string encoding used |
settings | The settings used by the JSON serializer |
Definition at line 239 of file ObjectStore.cs.
bool QuantConnect.Storage.ObjectStore.SaveXml< T > | ( | string | path, |
T | obj, | ||
Encoding | encoding = null |
||
) |
Saves the object data in XML format for the specified path
path | The object path |
obj | The object to be saved |
encoding | The string encoding used |
Definition at line 254 of file ObjectStore.cs.
IEnumerator<KeyValuePair<string, byte[]> > QuantConnect.Storage.ObjectStore.GetEnumerator | ( | ) |
Returns an enumerator that iterates through the collection.
<filterpriority>1</filterpriority>
Definition at line 271 of file ObjectStore.cs.
void QuantConnect.Storage.ObjectStore.Dispose | ( | ) |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
<filterpriority>2</filterpriority>
Definition at line 286 of file ObjectStore.cs.
ICollection<string> QuantConnect.Storage.ObjectStore.Keys => _store.Keys |
Returns the file paths present in the object store. This is specially useful not to load the object store into memory
Definition at line 68 of file ObjectStore.cs.
|
addremove |
Event raised each time there's an error
Definition at line 37 of file ObjectStore.cs.