1 /* 2 * Collie - An asynchronous event-driven network framework using Dlang development 3 * 4 * Copyright (C) 2015-2017 Shanghai Putao Technology Co., Ltd 5 * 6 * Developer: putao's Dlang team 7 * 8 * Licensed under the Apache-2.0 License. 9 * 10 */ 11 module collie.codec.mqtt.mqttfixedheader; 12 13 import collie.codec.mqtt.mqttmsgtype; 14 import collie.codec.mqtt.mqttqos; 15 16 final class MqttFixedHeader 17 { 18 public: 19 this(MqttMsgType messageType, 20 bool isDup, 21 MqttQoS qosLevel, 22 bool isRetain, 23 int remainingLength) 24 { 25 // Constructor code 26 this._messageType = messageType; 27 this._isDup = isDup; 28 this._qosLevel = qosLevel; 29 this._isRetain = isRetain; 30 this._remainingLength = remainingLength; 31 } 32 33 34 MqttMsgType messageType() { 35 return _messageType; 36 } 37 38 bool isDup() { 39 return _isDup; 40 } 41 42 MqttQoS qosLevel() { 43 return _qosLevel; 44 } 45 46 bool isRetain() { 47 return _isRetain; 48 } 49 50 int remainingLength() { 51 return _remainingLength; 52 } 53 54 55 override string toString() { 56 return ""; 57 } 58 59 private: 60 MqttMsgType _messageType; 61 bool _isDup; 62 MqttQoS _qosLevel; 63 bool _isRetain; 64 int _remainingLength; 65 } 66