FeatureCache¶
Namespace: ThinkGeo.Core
FeatureCache is a cache system used in FeatureSource to speed up the fetching data system.
public class FeatureCache
Inheritance Object → FeatureCache
Remarks:
The FeatureCache system uses the BoundingBox as the "Key" to cache the features. For example, if I first get data for a BoundingBox(BoundingBox1) and cache the features within the BoundingBox, in the future if I want to get the features within another BoundingBox(BoundingBox2) which is within BoundingBox1, I will get the features directly from the FeatureCache instead of from FileSystem or DBSystem.
Properties¶
IsActive¶
This boolean property sepcifies whether cache system is active or not.
public bool IsActive { get; set; }
Property Value¶
Constructors¶
FeatureCache()¶
This is the default constructor that will create a new instance of the FeatureCache.
public FeatureCache()
Remarks:
The cache system is not used by default. If you want to use it, you must set the IsActive property to true.
Methods¶
GetFeatures(RectangleShape)¶
This method returns a Collection of Features cached in the FeatureCache system. All of the returning features are within the BoundingBox and were fetched from FileSystem or DBSystem in a previous operation.
public Collection<Feature> GetFeatures(RectangleShape worldExtent)
Parameters¶
worldExtent
RectangleShape
Returns¶
This method returns a Collection of Features cached in the FeatureCache system.
Exceptions¶
ArgumentNullException
In the event you attempt to call this method by passing a null, it will throw an ArgumentNullException.
Remarks:
This method is the concrete wrapper for the virtual method GetFeaturesCore. It will return whatever is returned by the GetBoundingBoxCore method. To determine what the default implementation of the abstract GetBoundingBoxCore method is, please see the documentation for it.
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
GetFeaturesCore(RectangleShape)¶
This method returns a Collection of Features cached in the FeatureCache system. All of the returning features are within the BoundingBox and were fetched from FileSystem or DBSystem in a previous operation.
protected Collection<Feature> GetFeaturesCore(RectangleShape worldExtent)
Parameters¶
worldExtent
RectangleShape
Returns¶
This method returns a Collection of Features cached in the FeatureCache system.
Exceptions¶
ArgumentNullException
In the event you attempt to call this method by passing a null, it will throw an ArgumentNullException.
Remarks:
This method is the concrete wrapper for the virtual method GetFeaturesCore. It will return whatever is returned by the GetBoundingBoxCore method. To determine what the default implementation of the abstract GetBoundingBoxCore method is, please see the documentation for it.
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
Clear()¶
This method clears all of the CachedItems in this FeatureCache.
public void Clear()
Add(RectangleShape, Collection<Feature>)¶
This method will add an item to the FeatureCache system by passing a WorldExtent as "Key" and a collection of features as its corresponding cached features.
public void Add(RectangleShape worldExtent, Collection<Feature> features)
Parameters¶
worldExtent
RectangleShape
features
Collection<Feature>
Exceptions¶
ArgumentNullException
In the event you attempt to call this method by passing a null for the WorldExtent, it will throw an ArgumentNullException.
InvalidOperationException
In the event you attempt to call this method by passing a Invalid RectangleShape for the WorldExtent, it will throw an InvalidOperationException.
ArgumentNullException
In the event you attempt to call this method by passing a null for the Collection of features, it will throw an ArgumentNullException.
Remarks:
This method is the concrete wrapper for the virtual method AddCore. It will return whatever is returned by the AddCore method. To determine what the default implementation of the abstract AddCore method is, please see the documentation for it.
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
AddCore(RectangleShape, Collection<Feature>)¶
This method will add an item to the FeatureCache system by passing a WorldExtent as "Key" and a collection of features as its corresponding cached features.
protected void AddCore(RectangleShape worldExtent, Collection<Feature> features)
Parameters¶
worldExtent
RectangleShape
features
Collection<Feature>
Exceptions¶
ArgumentNullException
In the event you attempt to call this method by passing a null for the WorldExtent, it will throw an ArgumentNullException.
InvalidOperationException
In the event you attempt to call this method by passing a Invalid RectangleShape for the WorldExtent, it will throw an InvalidOperationException.
ArgumentNullException
In the event you attempt to call this method by passing a null for the Collection of features, it will throw an ArgumentNullException.
Remarks:
This method is the concrete wrapper for the virtual method AddCore. It will return whatever is returned by the AddCore method. To determine what the default implementation of the abstract AddCore method is, please see the documentation for it.
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
Open()¶
The default implementation is to do nothing.
public void Open()
Remarks:
This method is the concrete wrapper for the virtual method OpenCore. It will return whatever is returned by the OpenCore method. To determine what the default implementation of the abstract OpenCore method is, please see the documentation for it.
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
OpenCore()¶
The default implementation is to do nothing.
protected void OpenCore()
Remarks:
This method is the concrete wrapper for the virtual method OpenCore. It will return whatever is returned by the OpenCore method. To determine what the default implementation of the abstract OpenCore method is, please see the documentation for it.
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
Close()¶
The default implementation is to do nothing.
public void Close()
Remarks:
This method is the concrete wrapper for the virtual method CloseCore. It will return whatever is returned by the CloseCore method. To determine what the default implementation of the abstract CloseCore method is, please see the documentation for it.
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
CloseCore()¶
The default implementation is to do nothing.
protected void CloseCore()
Remarks:
This method is the concrete wrapper for the virtual method CloseCore. It will return whatever is returned by the CloseCore method. To determine what the default implementation of the abstract CloseCore method is, please see the documentation for it.
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
IsExtentCached(RectangleShape)¶
This method determines whether the WorldExtent is already cached in the FeatureCache System.
public bool IsExtentCached(RectangleShape worldExtent)
Parameters¶
worldExtent
RectangleShape
The target WorldExtent which will be determined as already cached or not.
Returns¶
Boolean
True if the specified WorldExtent is already cached. Otherwise, returns false.