Deleted Redundent Files
[iotcloud.git] / src / js / iotjs / orig / lastmessage.js
1 class LastMessage extends Entry{
2         constructor(slot,_machineid,_seqnum){
3                 super(slot);
4                 this.machineid = _machineid;
5                 this.seqnum = _seqnum;
6         }
7         getMachineID(){
8                 return this.machineid;
9         }
10         getSequenceNumber() {
11                 return this.seqnum;
12         }
13         decode(slot,bb){
14                 //slot and bb are instancesof Slot and ByteBuffer
15                 if(!(slot instanceof Slot && bb instanceof ByteBuffer)){
16                         throw new Error('Problem with the Arguments');
17                 }
18                 var machineid = bb.readInt64();
19                 var seqnum = bb.readInt64();
20                 return new LastMessage(slot,machineid,seqnum);
21         }
22         encode(bb){
23                 bb.writeByte(Entry.TypeLastMessage);
24                 bb.writeInt64(this.machineid);
25                 bb.writeInt64(this.seqnum);
26         }
27         getSize(){
28                 return 2*(1+1);
29         }
30         getType(){
31                 return Entry.TypeLastMessage;
32         }
33         getCopy(s){
34                 if(!(s instanceof Slot)){
35                         throw new Error('Argument must be a slot object');
36                 }
37                 return new LastMessage(s,this.machineid,this.seqnum);
38         }
39 }