Source/NFX/Collections/NamedInterlocked.cs
/// <summary>
/// Enumerates all named amounts. This operation is thread-safe, and returns a snapshot of the instance taken at the time of the first call
/// If exchange is specified, atomicaly flips the value of every slot
/// </summary>
Enumerates all named amounts. This operation is thread-safe, and returns a snapshot of the instance taken at the time of the first call
If exchange is specified, atomicaly flips the value of every slot
Enumerates all named amounts . This operation is thread - safe and returns a snapshot of the instance taken at the time of the first call If exchange is specified atomicaly flips the value of every slot
public IEnumerable<KeyValuePair<string, Amount>> SnapshotAllAmounts(decimal? exchange = null)
      {
        if (exchange.HasValue)
        {
          var xchg = convertDecimalToLong(exchange.Value);
          return m_Data.Select(s => new KeyValuePair<string, Amount>(s.Name,  new Amount(s.Name, convertLongToDecimal(Interlocked.Exchange(ref s.Long, xchg)))) );
        }
        return m_Data.Select(s => new KeyValuePair<string, Amount>(s.Name, new Amount(s.Name, convertLongToDecimal(s.Long))));
      }
public IEnumerable < KeyValuePair < string , Amount > > SnapshotAllAmounts ( decimal ? exchange = null ) { if ( exchange . HasValue ) { var xchg = convertDecimalToLong ( exchange . Value ) ; return m_Data . Select ( s => new KeyValuePair < string , Amount > ( s . Name , new Amount ( s . Name , convertLongToDecimal ( Interlocked . Exchange ( ref s . Long , xchg ) ) ) ) ) ; } return m_Data . Select ( s => new KeyValuePair < string , Amount > ( s . Name , new Amount ( s . Name , convertLongToDecimal ( s . Long ) ) ) ) ; }
Enumerates all named amounts.
Enumerates all named amounts .
exchange
decimal?