Lean  $LEAN_TAG$
QuantConnect.Util.ReferenceWrapper< T > Class Template Reference

We wrap a T instance, a value type, with a class, a reference type, to achieve thread safety when assigning new values and reading from multiple threads. This is possible because assignments are atomic operations in C# for reference types (among others). More...

Public Member Functions

 ReferenceWrapper (T value)
 Creates a new instance More...
 

Properties

Value [get]
 The current value More...
 

Detailed Description

We wrap a T instance, a value type, with a class, a reference type, to achieve thread safety when assigning new values and reading from multiple threads. This is possible because assignments are atomic operations in C# for reference types (among others).

This is a simpler, performance oriented version of Ref

Type Constraints
T :struct 

Definition at line 24 of file ReferenceWrapper.cs.

Constructor & Destructor Documentation

◆ ReferenceWrapper()

Creates a new instance

Parameters
valueThe value to use

Definition at line 36 of file ReferenceWrapper.cs.

Property Documentation

◆ Value

The current value

Definition at line 30 of file ReferenceWrapper.cs.


The documentation for this class was generated from the following file: