/// <summary> /// Initializes the current instance with a contained <see cref="RelayNode"/> /// </summary> /// <param name="dataHandler">The data handler.</param> /// <param name="relayNode">The relay node.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="dataHandler"/> is null /// or when <paramref name="relayNode"/> is null.</exception> public SocketServerRelayMessageHandler(IDataHandler dataHandler, IRelayNode relayNode) { if (dataHandler == null) throw new ArgumentNullException("dataHandler"); if (relayNode == null) throw new ArgumentNullException("relayNode"); _dataHandler = dataHandler; _relayNode = relayNode; }
public override void Digest(IDataHandler handler) { foreach (var dataItem in this._data) { handler.HandleDocument(dataItem); } }
public MockSender(ISender ReturnPath, object State, IDataHandler Receiver, int RemoveNPTypes) { this.ReturnPath = ReturnPath; this.State = State; this.Receiver = Receiver; _remove_n_ptypes = RemoveNPTypes; }
public ThreadedMockSender(ISender ReturnPath, object State, IDataHandler Receiver, int RemoveNPTypes, double drop_rate) : base(ReturnPath, State, Receiver, RemoveNPTypes, drop_rate) { _queue = new BlockingQueue(); Thread runner = new Thread(ThreadRun); runner.IsBackground = true; runner.Start(); }
public SSH2PacketBuilder(IDataHandler handler) : base(handler) { _buffer = new DataFragment(0x1000); _packet = new DataFragment(_buffer.Capacity); _sequence = 0; _cipher = null; _mac = null; _head = null; }
public NaivePortfolio(IEventBus eventBus, IDataHandler bars, decimal initialCapital) { this.eventBus = eventBus; this.bars = bars; this.initialCapital = initialCapital; this.HoldingHistory = new Dictionary<DateTime, Holding>(); this.currentPositions = this.bars.Symbols.ToDictionary(symbol => symbol, qty => 0); ; this.currentComission = decimal.Zero; this.currentCash = this.initialCapital; }
public MockSender(ISender ReturnPath, object State, IDataHandler Receiver, int RemoveNPTypes, double drop_rate) { this.ReturnPath = ReturnPath; this.State = State; this.Receiver = Receiver; _remove_n_ptypes = RemoveNPTypes; _drop_rate = drop_rate; _rand = new Random(); }
public override void ViewDidLoad() { base.ViewDidLoad (); TableView.Source = new GenericTableSource<Question>(); _handler = new UITableViewDataHandler<Question> (this); RefreshControl = new UIRefreshControl(); RefreshControl.ValueChanged += (sender, e) => _handler.LoadData (); _handler.LoadData(); }
public BackTest( IEventBus eventBus, IDataHandler bars, IStrategy strategy, IPortfolio portfolio, IExecutionHandler executionHandler) { this.eventBus = eventBus; this.bars = bars; this.strategy = strategy; this.portfolio = portfolio; this.executionHandler = executionHandler; this.stopWatch = new Stopwatch(); }
public void AddHandler(IDataHandler handler) { _handlers.Add(handler); }
public BuyAndHoldStrategy(IEventBus eventBus, IDataHandler dataHandler) { this.eventBus = eventBus; this.bars = dataHandler; this.bought = this.CalculateInitialBought(); }
/// <summary> /// Set callback handler. /// </summary> /// <param name="handler">handler</param> public void SetHandler(IDataHandler handler) { _handler = handler ?? new NullDataHandler(); }
/// <summary> /// Set a core handler. /// </summary> /// <param name="innerHandler">a core handler</param> public void SetInnerHandler(IDataHandler innerHandler) { _innerHandler = innerHandler; }
public void SetHandler(IDataHandler h) { _handler = h; }
internal ChannelSocket(IDataHandler h) : base(h) { }
public SimulatedExecutionHandler(IEventBus eventBus, IDataHandler bars) { this.eventBus = eventBus; this.bars = bars; }
public abstract void Digest(IDataHandler handler);
internal PlainSocket(Socket s, IDataHandler h) : base(h) { _socket = s; Debug.Assert(_socket.Connected); _socketStatus = SocketStatus.Ready; _data = new DataFragment(0x1000); _callback = new AsyncCallback(RepeatCallback); }
/** <summary>Subscribes the out going data from this source to the specified handler.</summary> <param name="hand">Data that the subscriber wants passed to the handler on each call.</param> <param name="state">Data that the subscriber wants passed to the handler on each call.</param> */ public virtual void Subscribe(IDataHandler hand, object state) { lock(_sync) { _sub = new Subscriber(hand, state); } }
protected AbstractGranadosSocket(IDataHandler h) { _handler = h; _single = new byte[1]; _socketStatus = SocketStatus.Unknown; }
/** <summary>Unsubscribes the the IDataHandler if it is the current IDatahandler.</summary> <param name="hand">An IDataHandler that wishes to remove itself as a destination for data coming from this source.</param> */ public virtual void Unsubscribe(IDataHandler hand) { lock(_sync) { if( _sub.Handler == hand ) { _sub = null; } else { throw new Exception(String.Format("Handler: {0}, not subscribed", hand)); } } }
/// <summary> /// Constructor /// </summary> /// <param name="innerHandler">a core handler</param> public FilterDataHandler(IDataHandler innerHandler) { _innerHandler = innerHandler; }
/** <summary>Subscribes the out going data from this source to the specified handler.</summary> <param name="hand">Data that the subscriber wants passed to the handler on each call.</param> <param name="state">Data that the subscriber wants passed to the handler on each call.</param> */ public void Subscribe(IDataHandler h, object state) { Subscriber s = new Subscriber(h, state); //We have to lock so there is no race between the read and the write lock( _sync ) { _subs = Brunet.Collections.Functional.Add(_subs, s); } }
/// <summary> /// Constructor /// </summary> /// <param name="socket">socket object (must be already connected)</param> /// <param name="handler">callback handler (can be null if no handler is specified)</param> public PlainSocket(Socket socket, IDataHandler handler) { _handler = handler ?? new NullDataHandler(); _socket = socket; Debug.Assert(_socket.Connected); _socketStatus = SocketStatus.Ready; _data = new DataFragment(0x1000); }
/** <summary>Unsubscribes the the IDataHandler if it is the current IDatahandler.</summary> <param name="hand">An IDataHandler that wishes to remove itself as a destination for data coming from this source.</param> */ public void Unsubscribe(IDataHandler h) { Subscriber s = new Subscriber(h, null); //We have to lock so there is no race between the read and the write lock( _sync ) { int idx = _subs.IndexOf(s); _subs = Brunet.Collections.Functional.RemoveAt(_subs, idx); } }
public PathEdge(IDataHandler path_handler, Edge e, string local_path, string remote_path) : base(null, e.IsInbound) { _pem = path_handler; _e = e; LocalPath = local_path; RemotePath = remote_path; //Make sure if the edge closes we also close _e.CloseEvent += this.HandleUnderClose; }
/** <summary>Subscribes the out going data from this source to the specified handler.</summary> <param name="dh">Data that the subscriber wants passed to the handler on each call.</param> <param name="state">Data that the subscriber wants passed to the handler on each call.</param> */ public Subscriber(IDataHandler dh, object state) { Handler = dh; State = state; }
public SSH1PacketBuilder(IDataHandler handler) : base(handler) { _buffer = new byte[0x1000]; _readOffset = 0; _writeOffset = 0; _cipher = null; _checkMAC = false; }
public MockSender(ISender ReturnPath, object State, IDataHandler Receiver, int RemoveNPTypes) : this(ReturnPath, State, Receiver, RemoveNPTypes, 0) { }