Class: Vigilem::Evdev::TransferAgent
- Inherits:
-
Core::TransferAgent
- Object
- Core::TransferAgent
- Vigilem::Evdev::TransferAgent
- Defined in:
- lib/vigilem/evdev/transfer_agent.rb
Class Method Summary collapse
Class Method Details
.acquire(args = {}) ⇒ TransferAgent
TODO:
move away from singleton and look at the one used by x11
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/vigilem/evdev/transfer_agent.rb', line 21 def acquire(args={}) if @transfer_agent @transfer_agent.multiplexer.add_inputs(*args[:inputs]) if args[:inputs] @transfer_agent.add_observers(args[:outputs]) if args[:outputs] if ((din = @transfer_agent.demultiplexer.input) || (mout = @transfer_agent.multiplexer.out)).nil? or not mout.equal?(din) @transfer_agent.demultiplexer.input = @transfer_agent.multiplexer.out = (mout || din || []) end @transfer_agent else m = Multiplexer.acquire(args[:inputs]) d = Demultiplexer.acquire(args[:outputs]) @transfer_agent = new(d, m) end end |