Object store. Objects of the specified type can be stored here for later reuse (efficiency improvement). IMPORTANT: Override IsEligible(), NotEligibleMessage() and TryGetNew() and possibly TryStore() methods in derived classes when applicable.
More...
|
virtual bool | IsEligible (T obj) |
| Returns true if the specified object is eligible for storing in this object storage, false if it is not. More...
|
|
virtual 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. WARNING: 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...
|
|
|
virtual void | ClearIneligible () |
| Removes ineligible obects from the list. More...
|
|
virtual String | NotEligibleMessage (object obj) |
| Returns a message indicating why the specified object is not eligible for storage in the current store. More...
|
|
virtual T | TryGetNew () |
| Returns a newly created object eligible for storage, or null if such an object can not be created. This method should not throw an exception. More...
|
|
T | GetNew () |
| Returns a newly xreated object eligible for storage in this object store. Exception is thrown if such an object can not be created. More...
|
|
|
object | Lock [get] |
|
int | Count [get, protected set] |
| 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...
|
|
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 | Lock [get] |
|
Object store. Objects of the specified type can be stored here for later reuse (efficiency improvement). IMPORTANT: Override IsEligible(), NotEligibleMessage() and TryGetNew() and possibly TryStore() methods in derived classes when applicable.
- Template Parameters
-
T | Type of objects to be stored, must be a reference type. |
virtual bool IG.Lib.ObjectStore< T >.IsEligible |
( |
T |
obj | ) |
|
|
inlinevirtual |
virtual void IG.Lib.ObjectStore< T >.ClearIneligible |
( |
| ) |
|
|
inlineprotectedvirtual |
Removes ineligible obects from the list.
virtual String IG.Lib.ObjectStore< T >.NotEligibleMessage |
( |
object |
obj | ) |
|
|
inlineprotectedvirtual |
Returns a message indicating why the specified object is not eligible for storage in the current store.
virtual bool IG.Lib.ObjectStore< T >.TryStore |
( |
T |
obj | ) |
|
|
inlinevirtual |
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.
- Parameters
-
- Returns
- true if the object has actually been stored, false if not.
Implements IG.Lib.IObjectStore< T >.
bool IG.Lib.ObjectStore< T >.StoreEligible |
( |
T |
obj | ) |
|
|
inline |
Stores the specified object in the store. WARNING: 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.
- Returns
- true if the object has actually been stored, false if not.
Implements IG.Lib.IObjectStore< T >.
T IG.Lib.ObjectStore< T >.TryGet |
( |
| ) |
|
|
inline |
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.
Implements IG.Lib.IObjectStore< T >.
T IG.Lib.ObjectStore< T >.TryGetStored |
( |
| ) |
|
|
inline |
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.
Implements IG.Lib.IObjectStore< T >.
T IG.Lib.ObjectStore< T >.GetEligible |
( |
| ) |
|
|
inline |
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.
Implements IG.Lib.IObjectStore< T >.
virtual T IG.Lib.ObjectStore< T >.TryGetNew |
( |
| ) |
|
|
inlineprotectedvirtual |
Returns a newly created object eligible for storage, or null if such an object can not be created. This method should not throw an exception.
T IG.Lib.ObjectStore< T >.GetNew |
( |
| ) |
|
|
inlineprotected |
Returns a newly xreated object eligible for storage in this object store. Exception is thrown if such an object can not be created.
object IG.Lib.ObjectStore< T >._lock = new object() |
|
protected |
List<T> IG.Lib.ObjectStore< T >._objects = new List<T>() |
|
protected |
int IG.Lib.ObjectStore< T >._maxCount = 0 |
|
private |
object IG.Lib.ObjectStore< T >.Lock |
|
get |
int IG.Lib.ObjectStore< T >.Count |
|
getprotected set |
Gets the current number of objects.
int IG.Lib.ObjectStore< T >.MaxCount |
|
getset |
Gets or sets the maximal number of objects that can be stored by this object store.
The documentation for this class was generated from the following file: