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.mqttmsg; 12 13 import collie.codec.mqtt.mqttfixedheader; 14 15 class MqttMsg 16 { 17 public: 18 this(MqttFixedHeader mqttFixedHeader) { 19 this(mqttFixedHeader, null, null); 20 } 21 22 this(MqttFixedHeader mqttFixedHeader, Object variableHeader) { 23 this(mqttFixedHeader, variableHeader, null); 24 } 25 26 this(MqttFixedHeader mqttFixedHeader, Object variableHeader, Object payload) { 27 this(mqttFixedHeader, variableHeader, payload, true); 28 } 29 30 this(MqttFixedHeader mqttFixedHeader, 31 Object variableHeader, 32 Object payload, 33 bool decoderResult) { 34 this._mqttFixedHeader = mqttFixedHeader; 35 this._variableHeader = variableHeader; 36 this._payload = payload; 37 this._decoderResult = decoderResult; 38 } 39 40 MqttFixedHeader fixedHeader() { 41 return _mqttFixedHeader; 42 } 43 44 Object variableHeader() { 45 return _variableHeader; 46 } 47 48 Object payload() { 49 return _payload; 50 } 51 52 bool decoderResult() { 53 return _decoderResult; 54 } 55 56 57 override string toString() { 58 return ""; 59 } 60 61 private: 62 MqttFixedHeader _mqttFixedHeader; 63 Object _variableHeader; 64 Object _payload; 65 bool _decoderResult; 66 } 67