IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Lib::IObjectStore< T > Interface Template Reference

Object store. Objects of the specified type can be stored here for later reuse (efficiency improvement).

Template Parameters:
TType of objects to be stored, must be a reference type.
More...

Inheritance diagram for IG::Lib::IObjectStore< T >:

List of all members.

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.
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.
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.
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.
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.
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.

Properties

int Count [get]
 Gets the current number of objects.
int MaxCount [get, set]
 Gets or sets the maximal number of objects that can be stored by this object store.

Detailed Description

template<T>
interface IG::Lib::IObjectStore< T >

Object store. Objects of the specified type can be stored here for later reuse (efficiency improvement).

Template Parameters:
TType of objects to be stored, must be a reference type.
Type Constraints
T :class 

Member Function Documentation

template<T >
bool IG::Lib::IObjectStore< T >::IsEligible ( 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 >.

template<T >
bool IG::Lib::IObjectStore< T >::TryStore ( 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.

Parameters:
objObject to be stored.
Returns:
true if the object has actually been stored, false if not.

Implemented in IG::Lib::ObjectStore< T >.

template<T >
bool IG::Lib::IObjectStore< T >::StoreEligible ( 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.

Returns:
true if the object has actually been stored, false if not.

Implemented in IG::Lib::ObjectStore< T >.

template<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 >.

template<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 >.

template<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 >.


Property Documentation

template<T >
int IG::Lib::IObjectStore< T >::Count [get]

Gets the current number of objects.

Implemented in IG::Lib::ObjectStore< T >.

template<T >
int IG::Lib::IObjectStore< T >::MaxCount [get, set]

Gets or sets the maximal number of objects that can be stored by this object store.

Implemented in IG::Lib::ObjectStore< T >.


The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events