Click or drag to resize

CalculationContext Class

The context in which calculations are performed. This holds a number of facets which describe the problem. Facets can include things like central bodies and leap seconds. To use a facet, call the facet's static method that returns the context. Avoid calling GetFacet(Int32) directly.
Inheritance Hierarchy
SystemObject
  AGI.Foundation.InfrastructureCalculationContext

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public class CalculationContext : IThreadAware, 
	ICloneWithContext

The CalculationContext type exposes the following members.

Constructors
  NameDescription
Public methodCalculationContext
Initializes a new calculation context with default facets.
Protected methodCalculationContext(CalculationContext, CopyContext)
Initializes a new instance as a copy of an existing instance.
Top
Properties
  NameDescription
Public propertyStatic memberCalculationContextStorageStrategy
Gets or sets the strategy that is used to store calculation contexts. The default strategy ensures that each thread has its own context.
Public propertyStatic memberDefaultForNewContexts
Gets or sets the calculation context to use for contexts that do not yet have a calculation context. When using the default CalculationContextStorageStrategy, a context is a thread so this property specifies the calculation context that will be used for new threads that do not yet have a CalculationContext.
Public propertyStatic memberInstance
Gets or sets the current calculation context. By default, each thread has its own context.
Public propertyIsThreadSafe
Gets a value indicating whether the methods on this instance are safe to call from multiple threads simultaneously.
Top
Methods
  NameDescription
Public methodAddFacet
Adds a facet to the context.
Public methodClone
Clones this object using the specified context.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetFacet
Gets the facet with the given ID.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodStatic memberGetNextFacetId
Gets the next available facet ID. Each time this method is called a unique ID is returned. It is safe to call this method from multiple threads simultaneously.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

CalculationContexts start off empty. It is up to each facet to decide what to do when the facet does not yet exist in the context. See the documentation for each facet for more information about that specific facet's behavior.

See Also