IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Object store. Objects of the specified type can be stored here for later reuse (efficiency improvement).
T | Type of objects to be stored, must be a reference type. |
Public Member Functions | |
bool | IsEligible (T obj) |
Returns true if the specified object is eligible for storing in this object storage, false if it is not. More... | |
bool | TryStore (T obj) |
Stores the specified object if the object is eligible for storage in this store and if The maximal number of stored object will not be exceeded. More... | |
bool | StoreEligible (T obj) |
Stores the specified object in the store. Throws ArgumentException if the specified object is not eligible for storing in this store. If the maximum number of objects would be exceeded then nothing happens. More... | |
T | TryGet () |
Returns an object from this object store, or null if it is not possible to provide an eligible object. If the store contains no objects, it tries to create and return a new eligible object. Should not throw an exception. More... | |
T | TryGetStored () |
Returns the last object from this object store, or null if there are no objects on it. Dose not attempt to create a new object. More... | |
T | GetEligible () |
Returns a non-null object that is eligible for storing in this object store. If the store itself does not contain any objects, an object is created anew, or exception is thrown if this is not possible. IMPORTANT: TryGet returns an object or null if the object can not be returned (does not throw an exception), and TryGetStored returns an eligible object only if any are stored, otherwise returns null. More... | |
Properties | |
int | Count [get] |
Gets the current number of objects. More... | |
int | MaxCount [get, set] |
Gets or sets the maximal number of objects that can be stored by this object store. More... | |
Object store. Objects of the specified type can be stored here for later reuse (efficiency improvement).
T | Type of objects to be stored, must be a reference type. |
T | : | class |
bool IG.Lib.IObjectStore< T >.IsEligible | ( | T | obj | ) |
Returns true if the specified object is eligible for storing in this object storage, false if it is not.
Implemented in IG.Num.MatrixStore< T >, IG.Num.VectorStore< T >, and IG.Lib.ObjectStore< T >.
bool IG.Lib.IObjectStore< T >.TryStore | ( | T | obj | ) |
Stores the specified object if the object is eligible for storage in this store and if The maximal number of stored object will not be exceeded.
obj | Object to be stored. |
Implemented in IG.Lib.ObjectStore< T >.
bool IG.Lib.IObjectStore< T >.StoreEligible | ( | T | obj | ) |
Stores the specified object in the store. Throws ArgumentException if the specified object is not eligible for storing in this store. If the maximum number of objects would be exceeded then nothing happens.
Implemented in IG.Lib.ObjectStore< T >.
T IG.Lib.IObjectStore< T >.TryGet | ( | ) |
Returns an object from this object store, or null if it is not possible to provide an eligible object. If the store contains no objects, it tries to create and return a new eligible object. Should not throw an exception.
Implemented in IG.Lib.ObjectStore< T >.
T IG.Lib.IObjectStore< T >.TryGetStored | ( | ) |
Returns the last object from this object store, or null if there are no objects on it. Dose not attempt to create a new object.
Implemented in IG.Lib.ObjectStore< T >.
T IG.Lib.IObjectStore< T >.GetEligible | ( | ) |
Returns a non-null object that is eligible for storing in this object store. If the store itself does not contain any objects, an object is created anew, or exception is thrown if this is not possible. IMPORTANT: TryGet returns an object or null if the object can not be returned (does not throw an exception), and TryGetStored returns an eligible object only if any are stored, otherwise returns null.
Implemented in IG.Lib.ObjectStore< T >.
|
get |
Gets the current number of objects.
|
getset |
Gets or sets the maximal number of objects that can be stored by this object store.