1 /* 2 * hunt-proton: AMQP Protocol library for D programming language. 3 * 4 * Copyright (C) 2018-2019 HuntLabs 5 * 6 * Website: https://www.huntlabs.net/ 7 * 8 * Licensed under the Apache-2.0 License. 9 * 10 */ 11 12 module hunt.proton.engine.impl.PlainTransportWrapper; 13 14 import hunt.io.ByteBuffer; 15 16 import hunt.proton.engine.TransportException; 17 import hunt.proton.engine.impl.TransportWrapper; 18 import hunt.proton.engine.impl.TransportInput; 19 import hunt.proton.engine.impl.TransportOutput; 20 21 22 class PlainTransportWrapper : TransportWrapper 23 { 24 private TransportOutput _outputProcessor; 25 private TransportInput _inputProcessor; 26 27 this(TransportOutput outputProcessor, 28 TransportInput inputProcessor) 29 { 30 _outputProcessor = outputProcessor; 31 _inputProcessor = inputProcessor; 32 } 33 34 public int capacity() 35 { 36 return _inputProcessor.capacity(); 37 } 38 39 public int position() 40 { 41 return _inputProcessor.position(); 42 } 43 44 public ByteBuffer tail() 45 { 46 return _inputProcessor.tail(); 47 } 48 49 public void process() 50 { 51 _inputProcessor.process(); 52 } 53 54 public void close_tail() 55 { 56 _inputProcessor.close_tail(); 57 } 58 59 public int pending() 60 { 61 return _outputProcessor.pending(); 62 } 63 64 public ByteBuffer head() 65 { 66 return _outputProcessor.head(); 67 } 68 69 public void pop(int bytes) 70 { 71 _outputProcessor.pop(bytes); 72 } 73 74 public void close_head() 75 { 76 _outputProcessor.close_head(); 77 } 78 79 }