certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] jcerti/src/hla/rti1516e/jlc EncoderFactory.java...


From: CERTI CVS commits
Subject: [certi-cvs] jcerti/src/hla/rti1516e/jlc EncoderFactory.java...
Date: Fri, 06 Jan 2012 14:24:11 +0000

CVSROOT:        /sources/certi
Module name:    jcerti
Changes by:     Eric NOULARD <erk>      12/01/06 14:24:11

Modified files:
        src/hla/rti1516e/jlc: EncoderFactory.java 
Added files:
        src/hla/rti1516e/jlc: HLAopaqueDataImpl.java 
Removed files:
        src/hla/rti1516e/jlc: BasicHLAopaqueDataImpl.java 

Log message:
        Rename HLAopaqueDataImpl 
        not really a basic type since it is encoded as variable array of byte.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/jcerti/src/hla/rti1516e/jlc/EncoderFactory.java?cvsroot=certi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/jcerti/src/hla/rti1516e/jlc/HLAopaqueDataImpl.java?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/jcerti/src/hla/rti1516e/jlc/BasicHLAopaqueDataImpl.java?cvsroot=certi&r1=1.1&r2=0

Patches:
Index: EncoderFactory.java
===================================================================
RCS file: /sources/certi/jcerti/src/hla/rti1516e/jlc/EncoderFactory.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- EncoderFactory.java 6 Jan 2012 14:04:39 -0000       1.5
+++ EncoderFactory.java 6 Jan 2012 14:24:11 -0000       1.6
@@ -229,12 +229,12 @@
 
     
     public HLAopaqueData createHLAopaqueData() {
-        return new BasicHLAopaqueDataImpl();
+        return new HLAopaqueDataImpl();
     }
 
     
     public HLAopaqueData createHLAopaqueData(byte[] b) {
-        return new BasicHLAopaqueDataImpl(b);
+        return new HLAopaqueDataImpl(b);
     }
 
     

Index: HLAopaqueDataImpl.java
===================================================================
RCS file: HLAopaqueDataImpl.java
diff -N HLAopaqueDataImpl.java
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ HLAopaqueDataImpl.java      6 Jan 2012 14:24:11 -0000       1.1
@@ -0,0 +1,86 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2011 Eric Noulard
+//
+// This program is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// ----------------------------------------------------------------------------
+package hla.rti1516e.jlc;
+
+import hla.rti1516e.encoding.ByteWrapper;
+import hla.rti1516e.encoding.DecoderException;
+import hla.rti1516e.encoding.EncoderException;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class HLAopaqueDataImpl extends DataElementBase implements
+        hla.rti1516e.encoding.HLAopaqueData {
+
+    private  byte[]   values;
+
+    public HLAopaqueDataImpl() {
+        values  = new byte[0];
+    }
+    
+    public HLAopaqueDataImpl(byte[] bytes) {
+        values = bytes;
+    }
+    
+    public int getOctetBoundary() {
+        return 4;
+    }
+
+    public void encode(ByteWrapper byteWrapper) throws EncoderException {
+       byteWrapper.align(getOctetBoundary());
+       byteWrapper.putInt(values.length);
+       byteWrapper.put(values);
+    }
+
+    public int getEncodedLength() {
+        return 4+values.length;
+    }
+
+    public void decode(ByteWrapper byteWrapper) throws DecoderException {
+        byteWrapper.align(getOctetBoundary());
+        values = new byte[byteWrapper.getInt()];
+        byteWrapper.get(values);
+    }
+
+    public int size() {
+        return values.length;
+    }
+
+    public Iterator<Byte> iterator() {
+        ArrayList<Byte> barray = new ArrayList<Byte>(values.length);
+        for (int i =0; i<values.length;++i) {
+            barray.add(values[i]);
+        }
+        return barray.iterator();
+    }
+
+    public byte[] getValue() {
+        return values;
+    }
+
+    public void setValue(byte[] value) {
+        this.values = value;
+    }
+
+    public byte get(int index) {
+        return values[index];
+    }
+
+}
\ No newline at end of file

Index: BasicHLAopaqueDataImpl.java
===================================================================
RCS file: BasicHLAopaqueDataImpl.java
diff -N BasicHLAopaqueDataImpl.java
--- BasicHLAopaqueDataImpl.java 6 Jan 2012 14:04:39 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,86 +0,0 @@
-// ----------------------------------------------------------------------------
-// CERTI - HLA RunTime Infrastructure
-// Copyright (C) 2011 Eric Noulard
-//
-// This program is free software ; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License
-// as published by the Free Software Foundation ; either version 2 of
-// the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY ; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program ; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// ----------------------------------------------------------------------------
-package hla.rti1516e.jlc;
-
-import hla.rti1516e.encoding.ByteWrapper;
-import hla.rti1516e.encoding.DecoderException;
-import hla.rti1516e.encoding.EncoderException;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-public class BasicHLAopaqueDataImpl extends DataElementBase implements
-        hla.rti1516e.encoding.HLAopaqueData {
-
-    private  byte[]   values;
-
-    public BasicHLAopaqueDataImpl() {
-        values  = new byte[0];
-    }
-    
-    public BasicHLAopaqueDataImpl(byte[] bytes) {
-        values = bytes;
-    }
-    
-    public int getOctetBoundary() {
-        return 4;
-    }
-
-    public void encode(ByteWrapper byteWrapper) throws EncoderException {
-       byteWrapper.align(getOctetBoundary());
-       byteWrapper.putInt(values.length);
-       byteWrapper.put(values);
-    }
-
-    public int getEncodedLength() {
-        return 4+values.length;
-    }
-
-    public void decode(ByteWrapper byteWrapper) throws DecoderException {
-        byteWrapper.align(getOctetBoundary());
-        values = new byte[byteWrapper.getInt()];
-        byteWrapper.get(values);
-    }
-
-    public int size() {
-        return values.length;
-    }
-
-    public Iterator<Byte> iterator() {
-        ArrayList<Byte> barray = new ArrayList<Byte>(values.length);
-        for (int i =0; i<values.length;++i) {
-            barray.add(values[i]);
-        }
-        return barray.iterator();
-    }
-
-    public byte[] getValue() {
-        return values;
-    }
-
-    public void setValue(byte[] value) {
-        this.values = value;
-    }
-
-    public byte get(int index) {
-        return values[index];
-    }
-
-}
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]