Struct MetaHandle
Represents a tuple of an unsigned integer with optional int or string metadata. If metadata is null then integer is stored by itself in an efficient way.
The type is useful for storage of handles/indexes (such as pointer surrogates) with optional description of pointed-to data (such as type information).
A special case is reserved for strings which are immutable yet reference types, in which case a special handle INLINED_STRING_HANDLE is set to indicate that
"Metadata" really contains string data that this handle should resolve into. Check "IsInlinedString" property to see if string was inlined.
Check "IsInlinedValueType" is set to true when a struct/valuetype is inlined and "Metadata" contains type spec
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.dll
[Serializable]
public struct MetaHandle : IEquatable<MetaHandle>
Constructors
Declaration
public MetaHandle(bool serializer, uint handle)
Parameters
Type |
Name |
Description |
System.Boolean |
serializer |
|
System.UInt32 |
handle |
|
Declaration
public MetaHandle(uint handle)
Parameters
Type |
Name |
Description |
System.UInt32 |
handle |
|
Declaration
public MetaHandle(uint handle, VarIntStr? metadata)
Parameters
Type |
Name |
Description |
System.UInt32 |
handle |
|
System.Nullable<VarIntStr> |
metadata |
|
Properties
Returns handle value. This value is invalid if special conditions such as inlining are true
Declaration
public uint Handle { get; }
Property Value
Type |
Description |
System.UInt32 |
|
Declaration
public uint IntMetadata { get; }
Property Value
Type |
Description |
System.UInt32 |
|
Indicates whether a reference (reference type) instance is inlined right after this handle and Metadata property contains type.
This is used for handling of ref types that are natively supported by streamers
Declaration
public bool IsInlinedRefType { get; }
Property Value
Type |
Description |
System.Boolean |
|
Indicates whether a string instance is inlined in Metadata property
Declaration
public bool IsInlinedString { get; }
Property Value
Type |
Description |
System.Boolean |
|
Indicates whether a reference to TYPE is inlined - that is a Metadata parameter points to the value of type (reference to Type)
Declaration
public bool IsInlinedTypeValue { get; }
Property Value
Type |
Description |
System.Boolean |
|
Indicates whether a struct (value type) instance is inlined right after this handle and Metadata property contains type
Declaration
public bool IsInlinedValueType { get; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public VarIntStr? Metadata { get; }
Property Value
Declaration
public string StringMetadata { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Declaration
public bool Equals(MetaHandle other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
Inlines ref type instead of pointer handle
Declaration
public static MetaHandle InlineRefType(VarIntStr? inlinedRefType)
Parameters
Type |
Name |
Description |
System.Nullable<VarIntStr> |
inlinedRefType |
|
Returns
Inlines string instance instead of pointer handle
Declaration
public static MetaHandle InlineString(string inlinedString)
Parameters
Type |
Name |
Description |
System.String |
inlinedString |
|
Returns
Inlines type value instead of pointer handle
Declaration
public static MetaHandle InlineTypeValue(VarIntStr? inlinedTypeValue)
Parameters
Type |
Name |
Description |
System.Nullable<VarIntStr> |
inlinedTypeValue |
|
Returns
Inlines value type instead of pointer handle
Declaration
public static MetaHandle InlineValueType(VarIntStr? inlinedValueType)
Parameters
Type |
Name |
Description |
System.Nullable<VarIntStr> |
inlinedValueType |
|
Returns
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.ValueType.ToString()
Implements
System.IEquatable<T>
Extension Methods