certi-cvs
[Top][All Lists]
Advanced

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

[certi-cvs] certi/libHLA HLAbasicType.hh HLAenumeratedType....


From: certi-cvs
Subject: [certi-cvs] certi/libHLA HLAbasicType.hh HLAenumeratedType....
Date: Mon, 03 Nov 2008 11:10:58 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Petr Gotthard <gotthardp>       08/11/03 11:10:58

Modified files:
        libHLA         : HLAbasicType.hh HLAenumeratedType.hh 
                         HLAvariableArray.hh 

Log message:
        Added datatypes mandated by IEEE 1516.2; HLAASCIIstring supports 
std::string conversions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libHLA/HLAbasicType.hh?cvsroot=certi&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/certi/libHLA/HLAenumeratedType.hh?cvsroot=certi&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/certi/libHLA/HLAvariableArray.hh?cvsroot=certi&r1=1.1&r2=1.2

Patches:
Index: HLAbasicType.hh
===================================================================
RCS file: /sources/certi/certi/libHLA/HLAbasicType.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- HLAbasicType.hh     2 Aug 2008 14:03:14 -0000       1.1
+++ HLAbasicType.hh     3 Nov 2008 11:10:58 -0000       1.2
@@ -11,7 +11,7 @@
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
-// $Id: HLAbasicType.hh,v 1.1 2008/08/02 14:03:14 gotthardp Exp $
+// $Id: HLAbasicType.hh,v 1.2 2008/11/03 11:10:58 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _HLATYPES_BASICTYPE_HH
@@ -191,6 +191,13 @@
 
 typedef HLAbasicType<char, char, BigEndian> HLAoctet;
 
+/* IEEE 1516.2, Table 25:
+ * Simple datatype table
+ */
+typedef HLAoctet HLAASCIIchar;
+typedef HLAoctetPairBE HLAunicodeChar;
+typedef HLAoctet HLAbyte;
+
 /* Additional datatypes used by RPR-FOM
  */
 typedef HLAbasicType<unsigned short, uint16_t, BigEndian> Unsignedinteger16BE;
@@ -201,5 +208,5 @@
 
 #endif // _HLATYPES_BASICTYPE_HH
 
-// $Id: HLAbasicType.hh,v 1.1 2008/08/02 14:03:14 gotthardp Exp $
+// $Id: HLAbasicType.hh,v 1.2 2008/11/03 11:10:58 gotthardp Exp $
 

Index: HLAenumeratedType.hh
===================================================================
RCS file: /sources/certi/certi/libHLA/HLAenumeratedType.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- HLAenumeratedType.hh        2 Aug 2008 14:03:14 -0000       1.1
+++ HLAenumeratedType.hh        3 Nov 2008 11:10:58 -0000       1.2
@@ -11,7 +11,7 @@
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
-// $Id: HLAenumeratedType.hh,v 1.1 2008/08/02 14:03:14 gotthardp Exp $
+// $Id: HLAenumeratedType.hh,v 1.2 2008/11/03 11:10:58 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _HLATYPES_ENUMERATEDTYPE_HH
@@ -86,9 +86,18 @@
     static const bool m_isVariable = false;
 };
 
+/* IEEE 1516.2, Table 27:
+ * Enumerated datatype table
+ */
+enum __HLAboolean {
+    HLAfalse = 0,
+    HLAtrue = 1
+};
+typedef HLAenumeratedType<__HLAboolean, HLAinteger32BE> HLAboolean;
+
 } // namespace libhla
 
 #endif // _HLATYPES_ENUMERATEDTYPE_HH
 
-// $Id: HLAenumeratedType.hh,v 1.1 2008/08/02 14:03:14 gotthardp Exp $
+// $Id: HLAenumeratedType.hh,v 1.2 2008/11/03 11:10:58 gotthardp Exp $
 

Index: HLAvariableArray.hh
===================================================================
RCS file: /sources/certi/certi/libHLA/HLAvariableArray.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- HLAvariableArray.hh 2 Aug 2008 14:03:15 -0000       1.1
+++ HLAvariableArray.hh 3 Nov 2008 11:10:58 -0000       1.2
@@ -11,7 +11,7 @@
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
-// $Id: HLAvariableArray.hh,v 1.1 2008/08/02 14:03:15 gotthardp Exp $
+// $Id: HLAvariableArray.hh,v 1.2 2008/11/03 11:10:58 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _HLATYPES_VARIABLEARRAY_HH
@@ -211,9 +211,31 @@
     static const bool m_isVariable = true; // variable-size array of 
variable-size elements
 };
 
+/* IEEE 1516.2, Table 29:
+ * Array datatype table
+ */
+struct HLAASCIIstring : public HLAvariableArray<HLAASCIIchar>
+{
+    HLAASCIIstring& operator = (const std::string& it)
+    {
+        set_size(it.size());
+        memcpy((char*)this + emptysizeof(), it.data(), it.size());
+
+        return *this;
+    }
+
+    operator std::string() const
+    {
+        return std::string((char*)this + emptysizeof(), size());
+    }
+};
+
+typedef HLAvariableArray<HLAunicodeChar> HLAunicodeString;
+typedef HLAvariableArray<HLAbyte> HLAopaqueData;
+
 } // namespace libhla
 
 #endif // _HLATYPES_VARIABLEARRAY_HH
 
-// $Id: HLAvariableArray.hh,v 1.1 2008/08/02 14:03:15 gotthardp Exp $
+// $Id: HLAvariableArray.hh,v 1.2 2008/11/03 11:10:58 gotthardp Exp $
 




reply via email to

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