This document is archived and information here might be outdated. Recommended version. |
The locator will examine the NAContext and its associated NASolver to build a cache of network elements that cannot be located on due to restrictions, barriers, etc. This method should be called before querying the locator whenever ExcludeRestrictedElements i
[Visual Basic .NET] Public Sub CacheRestrictedElements ( _ ByVal Context As INAContext _ )
[C#] public void CacheRestrictedElements ( INAContext Context );
[C++]
HRESULT CacheRestrictedElements(
INAContext* Context
);
[C++] Parameters Context [in]
Context is a parameter of type INAContext*
Use this method in conjunction with INALocator3::ExcludeRestrictedElements, in order to avoid loading locations on elements where travel is not allowed. If you set ExcludeRestrictedElements to true, then before calling any of the query location methods, be sure to call CacheRestrictedElements in order to inform the NALocator of the restrictions of which the passed-in NAContext is currently aware. Subsequently, if any changes are made to solver restrictions, impedances attributes or solver barriers, be sure to call CacheRestrictedElements so that the locator can avoid locating on restricted network elements.
Note that it is appropriate to locate barriers on restricted elements. Therefore, when loading barriers, ExcludeRestrictedElements should be set to false. If loading is done via the NAClassLoader then the caller must call CacheRestrictedElements prior to using the NAClassLoader but the NAClassLoader will internally set ExcludeRestrictedElements to be false when loading any barrier NAClass.