Class MySwapQueue<T>
Holds three objects in safe manner, use when Reader requires only last valid data.
One object is used for reading, one for writing and third is used as buffer, so reader/writer don't have to wait on the other.
Inheritance
System.Object
MySwapQueue<T>
Assembly: VRage.Library.dll
Syntax
public class MySwapQueue<T> : Object where T : class
Type Parameters
Constructors
MySwapQueue(T, T, T)
Declaration
public MySwapQueue(T first, T second, T third)
Parameters
Type |
Name |
Description |
T |
first |
|
T |
second |
|
T |
third |
|
MySwapQueue(Func<T>)
Declaration
public MySwapQueue(Func<T> factoryMethod)
Parameters
Type |
Name |
Description |
System.Func<T> |
factoryMethod |
|
Properties
Read
Declaration
Property Value
Write
Declaration
Property Value
Methods
CommitWrite()
Commits Write and replaces write with new object ready for new writing
Declaration
public void CommitWrite()
RefreshRead()
Updates data for reading if there's something new
Returns true when Read was updated, returns false when Read was not changed
Declaration
public bool RefreshRead()
Returns
Type |
Description |
System.Boolean |
|