Show / Hide Table of Contents

Struct SealedString

Represents an immutable string data that is stored in an efficient way that relieves the GC pressure. The string can not be changed or deleted. Once created it stays as-is until the process is terminated. This structure is used to store much dictionary data (100s of millions of strings) in the process without causing GC overload. Note: The default .ctor DOES NOT check whether the same string is already present in memory. Use SealedString.Scope to store unique strings only (do not store the repetitions). This struct is THREAD SAFE and NOT SERIALIZABLE.

Implements
System.IEquatable<SealedString>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: NFX
Assembly: NFX.dll
Syntax
[SlimSerializationProhibited]
public struct SealedString : IEquatable<SealedString>

Constructors

SealedString(String)

Creates a sealed copy of string data. This .ctor DOES NOT check whether this string was already sealed

Declaration
public SealedString(string value)
Parameters
Type Name Description
System.String value

Fields

Address

Declaration
public readonly int Address
Field Value
Type Description
System.Int32

Segment

Declaration
public readonly ushort Segment
Field Value
Type Description
System.UInt16

Properties

IsAssigned

Returns true if this instance represents an assigned valid string (is not equal to Unassigned)

Declaration
public bool IsAssigned { get; }
Property Value
Type Description
System.Boolean

TotalBytesAllocated

Returns the total number of bytes allocated

Declaration
public static long TotalBytesAllocated { get; }
Property Value
Type Description
System.Int64

TotalBytesUsed

Returns the total number of bytes used

Declaration
public static long TotalBytesUsed { get; }
Property Value
Type Description
System.Int64

TotalCount

Returns the total count of strings allocated

Declaration
public static long TotalCount { get; }
Property Value
Type Description
System.Int64

TotalSegmentCount

Total number of segments

Declaration
public static int TotalSegmentCount { get; }
Property Value
Type Description
System.Int32

Unassigned

Returns a SealedString that is IsAssigned==false - a special invalid value

Declaration
public static SealedString Unassigned { get; }
Property Value
Type Description
SealedString

Value

Returns the original string copy

Declaration
public string Value { get; }
Property Value
Type Description
System.String

Methods

Equals(SealedString)

Declaration
public bool Equals(SealedString other)
Parameters
Type Name Description
SealedString other
Returns
Type Description
System.Boolean

Equals(Object)

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)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.ValueType.ToString()

Operators

Equality(SealedString, SealedString)

Declaration
public static bool operator ==(SealedString l, SealedString r)
Parameters
Type Name Description
SealedString l
SealedString r
Returns
Type Description
System.Boolean

Inequality(SealedString, SealedString)

Declaration
public static bool operator !=(SealedString l, SealedString r)
Parameters
Type Name Description
SealedString l
SealedString r
Returns
Type Description
System.Boolean

Implements

System.IEquatable<T>

Extension Methods

ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX