3 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
5 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
9 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
11 var LastMessage = function (_Entry) {
12 _inherits(LastMessage, _Entry);
14 function LastMessage(slot, _machineid, _seqnum) {
15 _classCallCheck(this, LastMessage);
17 var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(LastMessage).call(this, slot));
19 _this.machineid = _machineid;
20 _this.seqnum = _seqnum;
24 _createClass(LastMessage, [{
26 value: function getMachineID() {
27 return this.machineid;
30 key: 'getSequenceNumber',
31 value: function getSequenceNumber() {
36 value: function decode(slot, bb) {
37 //slot and bb are instancesof Slot and ByteBuffer
38 if (!(slot instanceof Slot && bb instanceof ByteBuffer)) {
39 throw new Error('Problem with the Arguments');
41 var machineid = bb.readByte();
42 var seqnum = bb.readByte();
43 return new LastMessage(slot, machineid, seqnum);
47 value: function encode(bb) {
48 bb.writeByte(Entry.TypeLastMessage);
49 bb.writeByte(this.machineid);
50 bb.writeByte(this.seqnum);
54 value: function getSize() {
59 value: function getType() {
60 return Entry.TypeLastMessage;
64 value: function getCopy(s) {
65 if (!(s instanceof Slot)) {
66 throw new Error('Argument must be a slot object');
68 return new LastMessage(s, this.machineid, this.seqnum);