/// <summary>
 /// Initializes a new instance of the <see cref="StorageMetaInfoMessageAdapter"/>.
 /// </summary>
 /// <param name="innerAdapter">The adapter, to which messages will be directed.</param>
 /// <param name="securityStorage">Securities meta info storage.</param>
 /// <param name="positionStorage">Position storage.</param>
 /// <param name="exchangeInfoProvider">Exchanges and trading boards provider.</param>
 /// <param name="storageProcessor">Storage processor.</param>
 public StorageMetaInfoMessageAdapter(IMessageAdapter innerAdapter, ISecurityStorage securityStorage,
                                      IPositionStorage positionStorage, IExchangeInfoProvider exchangeInfoProvider, StorageProcessor storageProcessor)
     : base(innerAdapter)
 {
     _securityStorage      = securityStorage ?? throw new ArgumentNullException(nameof(securityStorage));
     _positionStorage      = positionStorage ?? throw new ArgumentNullException(nameof(positionStorage));
     _exchangeInfoProvider = exchangeInfoProvider ?? throw new ArgumentNullException(nameof(_exchangeInfoProvider));
     _storageProcessor     = storageProcessor ?? throw new ArgumentNullException(nameof(storageProcessor));
 }
        private static StorageProcessor CheckOnNull(StorageProcessor storageProcessor)
        {
            if (storageProcessor == null)
            {
                throw new ArgumentNullException(nameof(storageProcessor));
            }

            return(storageProcessor);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="StorageMessageAdapter"/>.
 /// </summary>
 /// <param name="innerAdapter">The adapter, to which messages will be directed.</param>
 /// <param name="storageProcessor">Storage processor.</param>
 public StorageMessageAdapter(IMessageAdapter innerAdapter, StorageProcessor storageProcessor)
     : base(innerAdapter, CheckOnNull(storageProcessor).Buffer)
 {
     _storageProcessor = storageProcessor;
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StorageMessageAdapter"/>.
 /// </summary>
 /// <param name="innerAdapter">The adapter, to which messages will be directed.</param>
 /// <param name="storageProcessor">Storage processor.</param>
 public StorageMessageAdapter(IMessageAdapter innerAdapter, StorageProcessor storageProcessor)
     : base(innerAdapter)
 {
     _storageProcessor = storageProcessor ?? throw new ArgumentNullException(nameof(storageProcessor));
 }