PostSharp SDK 2023.0 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Declaration­Cache Class

DeclarationCache Class

Caches some frequently-used declarations or constructions with lazy loading.
Inheritance Hierarchy
System.Object
  PostSharp.Sdk.CodeModel.DeclarationCache

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
Syntax
C#
public sealed class DeclarationCache

The DeclarationCache type exposes the following members.

Properties
  NameDescription
Public propertyCoreAssembly
Public propertyGuidAttributeType
Public propertyIdentityGenericMap
Gets a GenericMap mapping generic parameters on themselves, valid for the current module.
Public propertyImportedFromTypeLibAttributeType
Public propertyIsByRefLikeAttributeType Obsolete.
Public propertyIsReadOnlyAttributeType Obsolete.
Public propertyTypeIdentifierAttributeType
Methods
  NameDescription
Public methodClear
Clear the cache content.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetGenericParameter
Public methodGetGenericParameterArray
Creates an array of GenericParameterTypeSignature with incremental ordinals.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetIntrinsic(Type)
Gets an IntrinsicTypeSignature, given a reflection Type.
Public methodGetIntrinsic(IntrinsicType)
Public methodCode exampleGetIntrinsicBoxedType
Gets the boxed type of an intrinsic.
Public methodGetIntrinsicSerializationType
Public methodGetItem<T>
Gets a declaration served by a provider.
Public methodGetModuleItem<T>
Public methodGetType()
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetType(String)
Gets a type (ITypeSignature) given its name.
Public methodGetType(Type)
Gets a type (ITypeSignature) given a reflection type (Type), with default binding options.
Public methodGetType(Type, BindingOptions)
Gets a type (ITypeSignature) given a reflection type (Type), but specifies BindingOptions.
Public methodInvalidateTranslations
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Fields
  NameDescription
Public fieldFieldInfoGetFieldFromHandle
Callback method for the GetItem<T>(Func<T>) method, retrieving the FieldInfo.GetFieldFromHandle(RuntimeFieldHandle) method.
Public fieldFieldInfoGetFieldFromHandle2
Callback method for the GetItem<T>(Func<T>) method, retrieving the FieldInfo.GetFieldFromHandle(RuntimeFieldHandle, RuntimeTypeHandle) method.
Public fieldMethodBaseGetMethodFromHandle
Callback method for the GetItem<T>(Func<T>) method, retrieving the MethodBase.GetMethodFromHandle(RuntimeMethodHandle) method.
Public fieldMethodBaseGetMethodFromHandle2
Callback method for the GetItem<T>(Func<T>) method, retrieving the Type.GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle) method.
Public fieldTaggedObjectSerializationType
Gets an instance of TaggedObjectSerializationType that is valid for the current module.
Public fieldTypeGetTypeFromHandle
Callback method for the GetItem<T>(Func<T>) method, retrieving the Type.GetTypeFromHandle(RuntimeTypeHandle) method.
Public fieldTypeSerializationType
Gets an instance of TypeSerializationType that is valid for the current module.
Remarks

This cache can serve three types of content: types, intrinsic types and arbitrary content served by providers. The last mechanism is used to cache methods (which are difficult to reference otherwise).

The current class provides itself the contents whose key is declared here (see static fields of this class).

See Also