Show / Hide Table of Contents

Class BSONValue

Base class for BSONSimpleValue, BSONArray and BSONObject.

Inheritance
System.Object
BSONValue
BSONCachedValue
BSONValue<T>
Implements
System.IEquatable<BSONValue>
Namespace: Eco.Shared.Serialization
Assembly: Eco.Shared.dll
Syntax
public abstract class BSONValue : Object, IEquatable<BSONValue>

Constructors

BSONValue()

Declaration
protected BSONValue()

Properties

ArrayValue

Declaration
public virtual BSONArray ArrayValue { get; }
Property Value
Type Description
BSONArray

BinaryValue

Returns array of byte values. When possible use ByteSpanValue instead to reduce allocations with pooling. When array accessed then we can't control references on it anymore and can't return it back to pool.

Declaration
public virtual byte[] BinaryValue { get; }
Property Value
Type Description
System.Byte[]

BlobID

Declaration
public virtual int BlobID { get; }
Property Value
Type Description
System.Int32

BoolValue

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

ByteSpanValue

Returns byte System.ReadOnlySpan<>, should always be preferred over BinaryValue because latter disables pooling for the value.

Declaration
public virtual ReadOnlySpan<byte> ByteSpanValue { get; }
Property Value
Type Description
System.ReadOnlySpan<System.Byte>

ByteValue

Declaration
public virtual byte ByteValue { get; }
Property Value
Type Description
System.Byte

ColorValue

Declaration
public virtual Color ColorValue { get; }
Property Value
Type Description
Color

DateTimeValue

Declaration
public virtual DateTime DateTimeValue { get; }
Property Value
Type Description
System.DateTime

DoubleValue

Declaration
public virtual double DoubleValue { get; }
Property Value
Type Description
System.Double

FloatValue

Declaration
public virtual float FloatValue { get; }
Property Value
Type Description
System.Single

GuidValue

Declaration
public virtual Guid GuidValue { get; }
Property Value
Type Description
System.Guid

Int32Value

Declaration
public virtual int Int32Value { get; }
Property Value
Type Description
System.Int32

Int64Value

Declaration
public virtual long Int64Value { get; }
Property Value
Type Description
System.Int64

IntArrayValue

Returns array of int values. When possible use IntSpanValue instead to reduce allocations with pooling. When array accessed then we can't control references on it anymore and can't return it back to pool.

Declaration
public virtual int[] IntArrayValue { get; }
Property Value
Type Description
System.Int32[]

IntSpanValue

Returns int System.ReadOnlySpan<>, should always be preferred over IntArrayValue because latter disables pooling for the value.

Declaration
public virtual ReadOnlySpan<int> IntSpanValue { get; }
Property Value
Type Description
System.ReadOnlySpan<System.Int32>

IsNull

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

LocStringValue

Declaration
public virtual LocString LocStringValue { get; }
Property Value
Type Description
LocString

ObjectValue

Declaration
public virtual BSONObject ObjectValue { get; }
Property Value
Type Description
BSONObject

QuaternionValue

Declaration
public virtual Quaternion QuaternionValue { get; }
Property Value
Type Description
Quaternion

StringValue

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

UInt64Value

Declaration
public virtual ulong UInt64Value { get; }
Property Value
Type Description
System.UInt64

UShortArrayValue

Returns array of ushort values. When possible use UShortSpanValue instead to reduce allocations with pooling. When array accessed then we can't control references on it anymore and can't return it back to pool.

Declaration
public virtual ushort[] UShortArrayValue { get; }
Property Value
Type Description
System.UInt16[]

UShortSpanValue

Returns ushort System.ReadOnlySpan<>, should always be preferred over UShortArrayValue because latter disables pooling for the value.

Declaration
public virtual ReadOnlySpan<ushort> UShortSpanValue { get; }
Property Value
Type Description
System.ReadOnlySpan<System.UInt16>

ValueType

Declaration
public BSONValueType ValueType { get; }
Property Value
Type Description
BSONValueType

Vector2iValue

Declaration
public virtual Vector2i Vector2iValue { get; }
Property Value
Type Description
Vector2i

Vector2Value

Declaration
public virtual Vector2 Vector2Value { get; }
Property Value
Type Description
Vector2

Vector3iValue

Declaration
public virtual Vector3i Vector3iValue { get; }
Property Value
Type Description
Vector3i

Vector3iValueNullable

Declaration
public virtual Nullable<Vector3i> Vector3iValueNullable { get; }
Property Value
Type Description
System.Nullable<Vector3i>

Vector3Value

Declaration
public virtual Vector3 Vector3Value { get; }
Property Value
Type Description
System.Numerics.Vector3

ViewID

Declaration
public virtual int ViewID { get; }
Property Value
Type Description
System.Int32

ViewTypeID

Declaration
public virtual int ViewTypeID { get; }
Property Value
Type Description
System.Int32

Methods

Cast<T>()

Declaration
public T Cast<T>()
    where T : IBsonDeserializable, new()
Returns
Type Description
T
Type Parameters
Name Description
T

DebugToString()

Declaration
public string DebugToString()
Returns
Type Description
System.String

Equals(BSONValue)

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

ListValue<T>()

Declaration
public List<T> ListValue<T>()
Returns
Type Description
System.Collections.Generic.List<T>
Type Parameters
Name Description
T

NewBlobRef(Int32)

Declaration
public static BSONValue NewBlobRef(int blobId)
Parameters
Type Name Description
System.Int32 blobId
Returns
Type Description
BSONValue

NewBSONValue(LocString)

Declaration
public static BSONValue NewBSONValue(LocString v)
Parameters
Type Name Description
LocString v
Returns
Type Description
BSONValue

NewBSONValue(Quaternion)

Declaration
public static BSONValue NewBSONValue(Quaternion v)
Parameters
Type Name Description
Quaternion v
Returns
Type Description
BSONValue

NewBSONValue(Vector2)

Declaration
public static BSONValue NewBSONValue(Vector2 v)
Parameters
Type Name Description
Vector2 v
Returns
Type Description
BSONValue

NewBSONValue(Vector2i)

Declaration
public static BSONValue NewBSONValue(Vector2i v)
Parameters
Type Name Description
Vector2i v
Returns
Type Description
BSONValue

NewBSONValue(Vector3i)

Declaration
public static BSONValue NewBSONValue(Vector3i v)
Parameters
Type Name Description
Vector3i v
Returns
Type Description
BSONValue

NewBSONValue(BSONValueType)

Declaration
protected static BSONValue NewBSONValue(BSONValueType valueType)
Parameters
Type Name Description
BSONValueType valueType
Returns
Type Description
BSONValue

NewBSONValue(Color)

Declaration
public static BSONValue NewBSONValue(Color v)
Parameters
Type Name Description
Color v
Returns
Type Description
BSONValue

NewBSONValue(Boolean)

Declaration
public static BSONValue NewBSONValue(bool v)
Parameters
Type Name Description
System.Boolean v
Returns
Type Description
BSONValue

NewBSONValue(Byte)

Declaration
public static BSONValue NewBSONValue(byte v)
Parameters
Type Name Description
System.Byte v
Returns
Type Description
BSONValue

NewBSONValue(Byte[], Boolean, Boolean)

Declaration
public static BSONValue NewBSONValue(byte[] v, bool compressed = false, bool saveInCache = false)
Parameters
Type Name Description
System.Byte[] v
System.Boolean compressed
System.Boolean saveInCache
Returns
Type Description
BSONValue

NewBsonValue(ICollection<Int32>)

Makes new BSONValue from values using pooled array and saving GC allocations.

Declaration
public static BSONValue NewBsonValue(ICollection<int> values)
Parameters
Type Name Description
System.Collections.Generic.ICollection<System.Int32> values
Returns
Type Description
BSONValue

NewBsonValue(ICollection<UInt16>)

Makes new BSONValue from values using pooled array and saving GC allocations.

Declaration
public static BSONValue NewBsonValue(ICollection<ushort> values)
Parameters
Type Name Description
System.Collections.Generic.ICollection<System.UInt16> values
Returns
Type Description
BSONValue

NewBSONValue(DateTime)

Declaration
public static BSONValue NewBSONValue(DateTime v)
Parameters
Type Name Description
System.DateTime v
Returns
Type Description
BSONValue

NewBSONValue(Double)

Declaration
public static BSONValue NewBSONValue(double v)
Parameters
Type Name Description
System.Double v
Returns
Type Description
BSONValue

NewBSONValue(Guid)

Declaration
public static BSONValue NewBSONValue(Guid v)
Parameters
Type Name Description
System.Guid v
Returns
Type Description
BSONValue

NewBSONValue(Int32)

Declaration
public static BSONValue NewBSONValue(int v)
Parameters
Type Name Description
System.Int32 v
Returns
Type Description
BSONValue

NewBsonValue(Int32[])

Declaration
public static BSONValue NewBsonValue(int[] v)
Parameters
Type Name Description
System.Int32[] v
Returns
Type Description
BSONValue

NewBSONValue(Int64)

Declaration
public static BSONValue NewBSONValue(long v)
Parameters
Type Name Description
System.Int64 v
Returns
Type Description
BSONValue

NewBSONValue(Vector3)

Declaration
public static BSONValue NewBSONValue(Vector3 v)
Parameters
Type Name Description
System.Numerics.Vector3 v
Returns
Type Description
BSONValue

NewBSONValue(Single)

Declaration
public static BSONValue NewBSONValue(float v)
Parameters
Type Name Description
System.Single v
Returns
Type Description
BSONValue

NewBSONValue(String)

Declaration
public static BSONValue NewBSONValue(string v)
Parameters
Type Name Description
System.String v
Returns
Type Description
BSONValue

NewBSONValue(UInt16[])

Declaration
public static BSONValue NewBSONValue(ushort[] v)
Parameters
Type Name Description
System.UInt16[] v
Returns
Type Description
BSONValue

NewBSONValue(UInt64)

Declaration
public static BSONValue NewBSONValue(ulong v)
Parameters
Type Name Description
System.UInt64 v
Returns
Type Description
BSONValue

NewCachedDataRef(String)

Declaration
public static BSONValue NewCachedDataRef(string hash)
Parameters
Type Name Description
System.String hash
Returns
Type Description
BSONValue

NewTypeId(Int32)

Creates new ViewTypeId value.

Declaration
public static BSONValue NewTypeId(int viewTypeId)
Parameters
Type Name Description
System.Int32 viewTypeId
Returns
Type Description
BSONValue

NewViewRef(Int32)

Creates new ViewRef value.

Declaration
public static BSONValue NewViewRef(int viewId)
Parameters
Type Name Description
System.Int32 viewId
Returns
Type Description
BSONValue

Recycle()

Declaration
public abstract void Recycle()

ToString()

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

ToStringIndented(Int32, HashSet<BSONValue>)

Declaration
protected virtual string ToStringIndented(int indentLevel, HashSet<BSONValue> visited)
Parameters
Type Name Description
System.Int32 indentLevel
System.Collections.Generic.HashSet<BSONValue> visited
Returns
Type Description
System.String

Operators

Implicit(LocString to BSONValue)

Declaration
public static implicit operator BSONValue(LocString v)
Parameters
Type Name Description
LocString v
Returns
Type Description
BSONValue

Implicit(Quaternion to BSONValue)

Declaration
public static implicit operator BSONValue(Quaternion v)
Parameters
Type Name Description
Quaternion v
Returns
Type Description
BSONValue

Implicit(Vector2 to BSONValue)

Declaration
public static implicit operator BSONValue(Vector2 v)
Parameters
Type Name Description
Vector2 v
Returns
Type Description
BSONValue

Implicit(Vector2i to BSONValue)

Declaration
public static implicit operator BSONValue(Vector2i v)
Parameters
Type Name Description
Vector2i v
Returns
Type Description
BSONValue

Implicit(Vector3i to BSONValue)

Declaration
public static implicit operator BSONValue(Vector3i v)
Parameters
Type Name Description
Vector3i v
Returns
Type Description
BSONValue

Implicit(BSONValue to LocString)

Declaration
public static implicit operator LocString(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
LocString

Implicit(BSONValue to Quaternion)

Declaration
public static implicit operator Quaternion(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
Quaternion

Implicit(BSONValue to Vector2)

Declaration
public static implicit operator Vector2(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
Vector2

Implicit(BSONValue to Vector2i)

Declaration
public static implicit operator Vector2i(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
Vector2i

Implicit(BSONValue to Vector3i)

Declaration
public static implicit operator Vector3i(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
Vector3i

Implicit(BSONValue to Color)

Declaration
public static implicit operator Color(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
Color

Implicit(BSONValue to Boolean)

Declaration
public static implicit operator bool (BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.Boolean

Implicit(BSONValue to DateTime)

Declaration
public static implicit operator DateTime(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.DateTime

Implicit(BSONValue to Double)

Declaration
public static implicit operator double (BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.Double

Implicit(BSONValue to Guid)

Declaration
public static implicit operator Guid(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.Guid

Implicit(BSONValue to Int32)

Declaration
public static implicit operator int (BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.Int32

Implicit(BSONValue to Int64)

Declaration
public static implicit operator long (BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.Int64

Implicit(BSONValue to Nullable<Vector3i>)

Declaration
public static implicit operator Nullable<Vector3i>(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.Nullable<Vector3i>

Implicit(BSONValue to Vector3)

Declaration
public static implicit operator Vector3(BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.Numerics.Vector3

Implicit(BSONValue to Single)

Declaration
public static implicit operator float (BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.Single

Implicit(BSONValue to String)

Declaration
public static implicit operator string (BSONValue v)
Parameters
Type Name Description
BSONValue v
Returns
Type Description
System.String

Implicit(Color to BSONValue)

Declaration
public static implicit operator BSONValue(Color v)
Parameters
Type Name Description
Color v
Returns
Type Description
BSONValue

Implicit(Boolean to BSONValue)

Declaration
public static implicit operator BSONValue(bool v)
Parameters
Type Name Description
System.Boolean v
Returns
Type Description
BSONValue

Implicit(Byte to BSONValue)

Declaration
public static implicit operator BSONValue(byte v)
Parameters
Type Name Description
System.Byte v
Returns
Type Description
BSONValue

Implicit(Byte[] to BSONValue)

Declaration
public static implicit operator BSONValue(byte[] v)
Parameters
Type Name Description
System.Byte[] v
Returns
Type Description
BSONValue

Implicit(DateTime to BSONValue)

Declaration
public static implicit operator BSONValue(DateTime v)
Parameters
Type Name Description
System.DateTime v
Returns
Type Description
BSONValue

Implicit(Double to BSONValue)

Declaration
public static implicit operator BSONValue(double v)
Parameters
Type Name Description
System.Double v
Returns
Type Description
BSONValue

Implicit(Guid to BSONValue)

Declaration
public static implicit operator BSONValue(Guid v)
Parameters
Type Name Description
System.Guid v
Returns
Type Description
BSONValue

Implicit(Int32 to BSONValue)

Declaration
public static implicit operator BSONValue(int v)
Parameters
Type Name Description
System.Int32 v
Returns
Type Description
BSONValue

Implicit(Int64 to BSONValue)

Declaration
public static implicit operator BSONValue(long v)
Parameters
Type Name Description
System.Int64 v
Returns
Type Description
BSONValue

Implicit(Vector3 to BSONValue)

Declaration
public static implicit operator BSONValue(Vector3 v)
Parameters
Type Name Description
System.Numerics.Vector3 v
Returns
Type Description
BSONValue

Implicit(Single to BSONValue)

Declaration
public static implicit operator BSONValue(float v)
Parameters
Type Name Description
System.Single v
Returns
Type Description
BSONValue

Implicit(String to BSONValue)

Declaration
public static implicit operator BSONValue(string v)
Parameters
Type Name Description
System.String v
Returns
Type Description
BSONValue

Implicit(UInt16[] to BSONValue)

Declaration
public static implicit operator BSONValue(ushort[] v)
Parameters
Type Name Description
System.UInt16[] v
Returns
Type Description
BSONValue

Implements

System.IEquatable<>

Extension Methods

BsonValueBackgroundRecycler.RecycleInBackground(BSONValue)
SimpleBSON.WithStatsRecording(BSONValue)
CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
ViewManager.UnpackageView<T>(BSONValue)
ViewManager.UnpackageView(BSONValue)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾