Skip to content

Commit

Permalink
Merge pull request #149 from phutson/Issue-146
Browse files Browse the repository at this point in the history
Issue 146
  • Loading branch information
leif81 authored Jul 11, 2024
2 parents ea7bde0 + 19f89d5 commit 13491c2
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 150 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/nbproject/
*.orig
*.rej
.vscode
31 changes: 6 additions & 25 deletions src/main/java/edu/nps/moves/dis7/AcknowledgePdu.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
*/
public class AcknowledgePdu extends SimulationManagementFamilyPdu implements Serializable {

/**
* Identifier for originating entity(or simulation)
*/
protected EntityID originatingID = new EntityID();

/**
* Identifier for the receiving entity(or simulation)
*/
protected EntityID receivingID = new EntityID();

/**
* type of message being acknowledged
Expand Down Expand Up @@ -50,8 +41,6 @@ public int getMarshalledSize() {
int marshalSize = 0;

marshalSize = super.getMarshalledSize();
marshalSize = marshalSize + originatingID.getMarshalledSize(); // originatingID
marshalSize = marshalSize + receivingID.getMarshalledSize(); // receivingID
marshalSize = marshalSize + 2; // acknowledgeFlag
marshalSize = marshalSize + 2; // responseFlag
marshalSize = marshalSize + 4; // requestID
Expand All @@ -60,19 +49,19 @@ public int getMarshalledSize() {
}

public void setOriginatingID(EntityID pOriginatingID) {
originatingID = pOriginatingID;
setOriginatingEntityID(pOriginatingID);
}

public EntityID getOriginatingID() {
return originatingID;
return getOriginatingEntityID();
}

public void setReceivingID(EntityID pReceivingID) {
receivingID = pReceivingID;
setReceivingEntityID(pReceivingID);
}

public EntityID getReceivingID() {
return receivingID;
return getReceivingEntityID();
}

public void setAcknowledgeFlag(int pAcknowledgeFlag) {
Expand Down Expand Up @@ -102,8 +91,6 @@ public long getRequestID() {
public void marshal(DataOutputStream dos) {
super.marshal(dos);
try {
originatingID.marshal(dos);
receivingID.marshal(dos);
dos.writeShort((short) acknowledgeFlag);
dos.writeShort((short) responseFlag);
dos.writeInt((int) requestID);
Expand All @@ -117,8 +104,6 @@ public void unmarshal(DataInputStream dis) {
super.unmarshal(dis);

try {
originatingID.unmarshal(dis);
receivingID.unmarshal(dis);
acknowledgeFlag = (int) dis.readUnsignedShort();
responseFlag = (int) dis.readUnsignedShort();
requestID = dis.readInt();
Expand All @@ -139,8 +124,6 @@ public void unmarshal(DataInputStream dis) {
*/
public void marshal(java.nio.ByteBuffer buff) {
super.marshal(buff);
originatingID.marshal(buff);
receivingID.marshal(buff);
buff.putShort((short) acknowledgeFlag);
buff.putShort((short) responseFlag);
buff.putInt((int) requestID);
Expand All @@ -157,8 +140,6 @@ public void marshal(java.nio.ByteBuffer buff) {
public void unmarshal(java.nio.ByteBuffer buff) {
super.unmarshal(buff);

originatingID.unmarshal(buff);
receivingID.unmarshal(buff);
acknowledgeFlag = (int) (buff.getShort() & 0xFFFF);
responseFlag = (int) (buff.getShort() & 0xFFFF);
requestID = buff.getInt();
Expand Down Expand Up @@ -196,10 +177,10 @@ public boolean equalsImpl(Object obj) {

final AcknowledgePdu rhs = (AcknowledgePdu) obj;

if (!(originatingID.equals(rhs.originatingID))) {
if (!(getOriginatingEntityID().equals(rhs.getOriginatingEntityID()))) {
ivarsEqual = false;
}
if (!(receivingID.equals(rhs.receivingID))) {
if (!(getReceivingEntityID().equals(rhs.getReceivingEntityID()))) {
ivarsEqual = false;
}
if (!(acknowledgeFlag == rhs.acknowledgeFlag)) {
Expand Down
31 changes: 6 additions & 25 deletions src/main/java/edu/nps/moves/dis7/ActionRequestPdu.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@
*/
public class ActionRequestPdu extends SimulationManagementFamilyPdu implements Serializable {

/**
* Identifier for originating entity(or simulation)
*/
protected EntityID originatingID = new EntityID();

/**
* Identifier for the receiving entity(or simulation)
*/
protected EntityID receivingID = new EntityID();

/**
* identifies the request being made by the simulaton manager
Expand Down Expand Up @@ -66,8 +57,6 @@ public int getMarshalledSize() {
int marshalSize = 0;

marshalSize = super.getMarshalledSize();
marshalSize = marshalSize + originatingID.getMarshalledSize(); // originatingID
marshalSize = marshalSize + receivingID.getMarshalledSize(); // receivingID
marshalSize = marshalSize + 4; // requestID
marshalSize = marshalSize + 4; // actionID
marshalSize = marshalSize + 4; // numberOfFixedDatumRecords
Expand All @@ -85,19 +74,19 @@ public int getMarshalledSize() {
}

public void setOriginatingID(EntityID pOriginatingID) {
originatingID = pOriginatingID;
setOriginatingEntityID(pOriginatingID);
}

public EntityID getOriginatingID() {
return originatingID;
return getOriginatingEntityID();
}

public void setReceivingID(EntityID pReceivingID) {
receivingID = pReceivingID;
setReceivingEntityID(pReceivingID);
}

public EntityID getReceivingID() {
return receivingID;
return getReceivingEntityID();
}

public void setRequestID(long pRequestID) {
Expand Down Expand Up @@ -165,8 +154,6 @@ public List<VariableDatum> getVariableDatums() {
public void marshal(DataOutputStream dos) {
super.marshal(dos);
try {
originatingID.marshal(dos);
receivingID.marshal(dos);
dos.writeInt((int) requestID);
dos.writeInt((int) actionID);
dos.writeInt((int) fixedDatums.size());
Expand All @@ -192,8 +179,6 @@ public void unmarshal(DataInputStream dis) {
super.unmarshal(dis);

try {
originatingID.unmarshal(dis);
receivingID.unmarshal(dis);
requestID = dis.readInt();
actionID = dis.readInt();
numberOfFixedDatumRecords = dis.readInt();
Expand Down Expand Up @@ -227,8 +212,6 @@ public void unmarshal(DataInputStream dis) {
*/
public void marshal(java.nio.ByteBuffer buff) {
super.marshal(buff);
originatingID.marshal(buff);
receivingID.marshal(buff);
buff.putInt((int) requestID);
buff.putInt((int) actionID);
buff.putInt((int) fixedDatums.size());
Expand Down Expand Up @@ -257,8 +240,6 @@ public void marshal(java.nio.ByteBuffer buff) {
public void unmarshal(java.nio.ByteBuffer buff) {
super.unmarshal(buff);

originatingID.unmarshal(buff);
receivingID.unmarshal(buff);
requestID = buff.getInt();
actionID = buff.getInt();
numberOfFixedDatumRecords = buff.getInt();
Expand Down Expand Up @@ -309,10 +290,10 @@ public boolean equalsImpl(Object obj) {

final ActionRequestPdu rhs = (ActionRequestPdu) obj;

if (!(originatingID.equals(rhs.originatingID))) {
if (!(getOriginatingEntityID().equals(rhs.getOriginatingEntityID()))) {
ivarsEqual = false;
}
if (!(receivingID.equals(rhs.receivingID))) {
if (!(getReceivingEntityID().equals(rhs.getReceivingEntityID()))) {
ivarsEqual = false;
}
if (!(requestID == rhs.requestID)) {
Expand Down
31 changes: 6 additions & 25 deletions src/main/java/edu/nps/moves/dis7/ActionResponsePdu.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
*/
public class ActionResponsePdu extends SimulationManagementFamilyPdu implements Serializable {

/**
* Identifier for originating entity(or simulation)
*/
protected EntityID originatingID = new EntityID();

/**
* Identifier for the receiving entity(or simulation)
*/
protected EntityID receivingID = new EntityID();

/**
* Request ID that is unique
Expand Down Expand Up @@ -64,8 +55,6 @@ public int getMarshalledSize() {
int marshalSize = 0;

marshalSize = super.getMarshalledSize();
marshalSize = marshalSize + originatingID.getMarshalledSize(); // originatingID
marshalSize = marshalSize + receivingID.getMarshalledSize(); // receivingID
marshalSize = marshalSize + 4; // requestID
marshalSize = marshalSize + 4; // requestStatus
marshalSize = marshalSize + 4; // numberOfFixedDatumRecords
Expand All @@ -83,19 +72,19 @@ public int getMarshalledSize() {
}

public void setOriginatingID(EntityID pOriginatingID) {
originatingID = pOriginatingID;
setOriginatingEntityID(pOriginatingID);
}

public EntityID getOriginatingID() {
return originatingID;
return getOriginatingEntityID();
}

public void setReceivingID(EntityID pReceivingID) {
receivingID = pReceivingID;
setReceivingEntityID(pReceivingID);
}

public EntityID getReceivingID() {
return receivingID;
return getReceivingEntityID();
}

public void setRequestID(long pRequestID) {
Expand Down Expand Up @@ -163,8 +152,6 @@ public List<VariableDatum> getVariableDatums() {
public void marshal(DataOutputStream dos) {
super.marshal(dos);
try {
originatingID.marshal(dos);
receivingID.marshal(dos);
dos.writeInt((int) requestID);
dos.writeInt((int) requestStatus);
dos.writeInt((int) fixedDatums.size());
Expand All @@ -190,8 +177,6 @@ public void unmarshal(DataInputStream dis) {
super.unmarshal(dis);

try {
originatingID.unmarshal(dis);
receivingID.unmarshal(dis);
requestID = dis.readInt();
requestStatus = dis.readInt();
numberOfFixedDatumRecords = dis.readInt();
Expand Down Expand Up @@ -225,8 +210,6 @@ public void unmarshal(DataInputStream dis) {
*/
public void marshal(java.nio.ByteBuffer buff) {
super.marshal(buff);
originatingID.marshal(buff);
receivingID.marshal(buff);
buff.putInt((int) requestID);
buff.putInt((int) requestStatus);
buff.putInt((int) fixedDatums.size());
Expand Down Expand Up @@ -255,8 +238,6 @@ public void marshal(java.nio.ByteBuffer buff) {
public void unmarshal(java.nio.ByteBuffer buff) {
super.unmarshal(buff);

originatingID.unmarshal(buff);
receivingID.unmarshal(buff);
requestID = buff.getInt();
requestStatus = buff.getInt();
numberOfFixedDatumRecords = buff.getInt();
Expand Down Expand Up @@ -307,10 +288,10 @@ public boolean equalsImpl(Object obj) {

final ActionResponsePdu rhs = (ActionResponsePdu) obj;

if (!(originatingID.equals(rhs.originatingID))) {
if (!(getOriginatingEntityID().equals(rhs.getOriginatingEntityID()))) {
ivarsEqual = false;
}
if (!(receivingID.equals(rhs.receivingID))) {
if (!(getReceivingEntityID().equals(rhs.getReceivingEntityID()))) {
ivarsEqual = false;
}
if (!(requestID == rhs.requestID)) {
Expand Down
31 changes: 6 additions & 25 deletions src/main/java/edu/nps/moves/dis7/CreateEntityPdu.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@
*/
public class CreateEntityPdu extends SimulationManagementFamilyPdu implements Serializable {

/**
* Identifier for the request
*/
protected EntityID originatingID = new EntityID();

/**
* Identifier for the request
*/
protected EntityID receivingID = new EntityID();

/**
* Identifier for the request. See 6.2.75
Expand All @@ -39,27 +30,25 @@ public int getMarshalledSize() {
int marshalSize = 0;

marshalSize = super.getMarshalledSize();
marshalSize = marshalSize + originatingID.getMarshalledSize(); // originatingID
marshalSize = marshalSize + receivingID.getMarshalledSize(); // receivingID
marshalSize = marshalSize + 4; // requestID

return marshalSize;
}

public void setOriginatingID(EntityID pOriginatingID) {
originatingID = pOriginatingID;
setOriginatingEntityID(pOriginatingID);
}

public EntityID getOriginatingID() {
return originatingID;
return getOriginatingEntityID();
}

public void setReceivingID(EntityID pReceivingID) {
receivingID = pReceivingID;
setReceivingEntityID(pReceivingID);
}

public EntityID getReceivingID() {
return receivingID;
return getReceivingEntityID();
}

public void setRequestID(long pRequestID) {
Expand All @@ -73,8 +62,6 @@ public long getRequestID() {
public void marshal(DataOutputStream dos) {
super.marshal(dos);
try {
originatingID.marshal(dos);
receivingID.marshal(dos);
dos.writeInt((int) requestID);
} // end try
catch (Exception e) {
Expand All @@ -86,8 +73,6 @@ public void unmarshal(DataInputStream dis) {
super.unmarshal(dis);

try {
originatingID.unmarshal(dis);
receivingID.unmarshal(dis);
requestID = dis.readInt();
} // end try
catch (Exception e) {
Expand All @@ -106,8 +91,6 @@ public void unmarshal(DataInputStream dis) {
*/
public void marshal(java.nio.ByteBuffer buff) {
super.marshal(buff);
originatingID.marshal(buff);
receivingID.marshal(buff);
buff.putInt((int) requestID);
} // end of marshal method

Expand All @@ -122,8 +105,6 @@ public void marshal(java.nio.ByteBuffer buff) {
public void unmarshal(java.nio.ByteBuffer buff) {
super.unmarshal(buff);

originatingID.unmarshal(buff);
receivingID.unmarshal(buff);
requestID = buff.getInt();
} // end of unmarshal method

Expand Down Expand Up @@ -159,10 +140,10 @@ public boolean equalsImpl(Object obj) {

final CreateEntityPdu rhs = (CreateEntityPdu) obj;

if (!(originatingID.equals(rhs.originatingID))) {
if (!(getOriginatingEntityID().equals(rhs.getOriginatingEntityID()))) {
ivarsEqual = false;
}
if (!(receivingID.equals(rhs.receivingID))) {
if (!(getReceivingEntityID().equals(rhs.getReceivingEntityID()))) {
ivarsEqual = false;
}
if (!(requestID == rhs.requestID)) {
Expand Down
Loading

0 comments on commit 13491c2

Please sign in to comment.