Definitions.xid.xml 16 KB
<?xml version="1.0" encoding="UTF-8" ?>

<!--
  Copyright (c) 2018, TeleCommunication Systems, Inc.,
  a wholly-owned subsidiary of Comtech Telecommunications Corp.
  and/or affiliates of TeleCommunication Systems, Inc.
  All rights reserved.
  TeleCommunication Systems, Inc. PROPRIETARY/CONFIDENTIAL.
  Use is subject to license terms included in the distribution.
-->

<specification xmlns="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
               xmlns:xid="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
               identity="Definitions.xid.xml">
    <title>Tensor Defitions</title>
    <comment>
       Defines fundamental type mappings.
    </comment>

    <tag name="package" value="com.telecomsys"/>

    <namespace name="Tensor">
        <type name="void" size="0">
            <comment>represents nothing. &lt;br/&gt;Useful in &lt;operation&gt; with no &lt;input&gt;</comment>
            <lang name="c" type="void"/>
            <lang name="cpp" type="void"/>
            <lang name="java" type="void"/>
            <lang name="node" type="void"/>
        </type>
        <type name="bool" size="1">
            <comment>represents true/false</comment>
            <lang name="c" type="bool" include="stdbool.h"/>
            <lang name="cpp" type="bool"/>
            <lang name="java" type="XidBool" include="com.telecomsys.tensor.xid.XidBool">
                <tag name="native" value="boolean"/>
            </lang>
            <lang name="node" type="XidBool"/>
        </type>

        <type name="uint8" size="1">
            <comment>8-bit, unsigned value</comment>
            <lang name="c" type="uint8_t" include="stdint.h"/>
            <lang name="cpp" type="uint8_t" include="cstdint"/>
            <lang name="java" type="XidByte" include="com.telecomsys.tensor.xid.XidByte">
                <tag name="native" value="byte"/>
            </lang>
            <lang name="node" type="XidUInt8"/>
        </type>
        <type name="uint16" size="2">
            <comment>16-bit, unsigned value</comment>
            <lang name="c" type="uint16_t" include="stdint.h"/>
            <lang name="cpp" type="uint16_t" include="cstdint"/>
            <lang name="java" type="XidShort" include="com.telecomsys.tensor.xid.XidShort">
                <tag name="native" value="short"/>
            </lang>
            <lang name="node" type="XidUShort"/>
        </type>
        <type name="uint24" size="3">
            <comment>24-bit, unsigned value</comment>
            <lang name="c" type="uint24_t" include="Tensor/CXMF/int24.h"/>
            <lang name="cpp" type="uint24_t" include="Tensor/Types/int24.h"/>
            <lang name="java" type="XidInt24" include="com.telecomsys.tensor.xid.XidInt24"/>
            <lang name="node" type="XidUInt24"/>
        </type>
        <type name="uint32" size="4">
            <comment>32-bit, unsigned value</comment>
            <lang name="c" type="uint32_t" include="stdint.h"/>
            <lang name="cpp" type="uint32_t" include="cstdint"/>
            <lang name="java" type="XidInt" include="com.telecomsys.tensor.xid.XidInt">
                <tag name="native" value="int"/>
            </lang>
             <lang name="node" type="XidUInt"/>
        </type>
        <type name="uint64" size="8">
            <comment>64-bit, unsigned value</comment>
            <lang name="c" type="uint64_t" include="stdint.h"/>
            <lang name="cpp" type="uint64_t" include="cstdint"/>
            <lang name="java" type="XidLong" include="com.telecomsys.tensor.xid.XidLong">
                <tag name="native" value="long"/>
            </lang>
             <lang name="node" type="XidULong"/>
        </type>

        <type name="int8" size="1">
            <comment>8-bit, signed value</comment>
            <lang name="c" type="int8_t" include="stdint.h"/>
            <lang name="cpp" type="int8_t" include="cstdint"/>
            <lang name="java" type="XidByte" include="com.telecomsys.tensor.xid.XidByte">
                <tag name="native" value="byte"/>
            </lang>
            <lang name="node" type="XidInt8"/>
        </type>
        <type name="int16" size="2">
            <comment>16-bit, signed value</comment>
            <lang name="c" type="int16_t" include="stdint.h"/>
            <lang name="cpp" type="int16_t" include="cstdint"/>
            <lang name="java" type="XidShort" include="com.telecomsys.tensor.xid.XidShort">
                <tag name="native" value="short"/>
            </lang>
            <lang name="node" type="XidShort"/>
        </type>
        <type name="int24" size="3">
            <comment>24-bit, unsigned value</comment>
            <lang name="c" type="int24_t" include="Tensor/CXMF/int24.h"/>
            <lang name="cpp" type="int24_t" include="Tensor/Types/int24.h"/>
            <lang name="java" type="XidInt24" include="com.telecomsys.tensor.xid.XidInt24"/>
             <lang name="node" type="XidInt24"/>
        </type>
        <type name="int32" size="4">
            <comment>32-bit, signed value</comment>
            <lang name="c" type="int32_t" include="stdint.h"/>
            <lang name="cpp" type="int32_t" include="cstdint"/>
            <lang name="java" type="XidInt" include="com.telecomsys.tensor.xid.XidInt">
                <tag name="native" value="int"/>
            </lang>
            <lang name="node" type="XidInt"/>
        </type>
        <type name="int64" size="8">
            <comment>64-bit, signed value</comment>
            <lang name="c" type="int64_t" include="stdint.h"/>
            <lang name="cpp" type="int64_t" include="cstdint"/>
            <lang name="java" type="XidLong" include="com.telecomsys.tensor.xid.XidLong">
                <tag name="native" value="long"/>
            </lang>
            <lang name="node" type="XidLong"/>
        </type>

        <!--
        <type name="float16" size="4">
            <comment>32-bit, IEEE 754 binary16</comment>
            <comment>C/cpp usually a "float"</comment>
            <artifact>https://wikipedia.org/wiki/Half-precision_floating-point_format</artifact>
        </type>
        -->

        <type name="float32" size="4">
            <comment>32-bit, IEEE 754 binary32</comment>
            <artifact>https://wikipedia.org/wiki/Single-precision_floating-point_format</artifact>
            <lang name="c" type="float"/>
            <lang name="cpp" type="float"/>
            <lang name="java" type="XidFloat" include="com.telecomsys.tensor.xid.XidFloat">
                <tag name="native" value="float"/>
            </lang>
            <lang name="node" type="XidFloat"/>
        </type>
        <type name="float64" size="8">
            <comment>64-bit, IEEE 754 binary64</comment>
            <artifact>https://wikipedia.org/wiki/Double-precision_floating-point_format</artifact>
            <lang name="c" type="double"/>
            <lang name="cpp" type="double"/>
            <lang name="java" type="XidDouble" include="com.telecomsys.tensor.xid.XidDouble">
                <tag name="native" value="double"/>
            </lang>
            <lang name="node" type="XidDouble"/>
        </type>
        <!--
        <type name="float128" size="8">
            <comment>128-bit, IEEE 754 binary128</comment>
            <artifact>https://wikipedia.org/wiki/Quadruple-precision_floating-point_format</artifact>
            <lang name="cpp" type="long double"/>
        </type>
        -->
        
        <type name="byte" size="1">
            <comment>A single byte</comment>
            <lang name="c" type="uint8_t" include="stdint.h"/>
            <lang name="cpp" type="uint8_t" include="cstdint"/>
            <lang name="java" type="XidByte" include="com.telecomsys.tensor.xid.XidByte">
                <tag name="native" value="byte"/>
            </lang>
            <lang name="node" type="XidUInt8"/>
        </type>
        <type name="raw">
            <comment>Variable sized collection of bytes</comment>
            <!-- may change this type -->
            <lang name="c" type="CXMFString" include="Tensor/CXMF/CXMFString.h"/>
            <lang name="cpp" type="::Tensor::XMF::Atom" include="Tensor/XMF/Atom.h"/>
            <lang name="java" type="XidRaw" include="com.telecomsys.tensor.xid.XidRaw"/>
            <lang name="node" type="Atom"/>
        </type>

        <type name="string">
            <comment>Variable sized collection of characters</comment>
            <lang name="c" type="CXMFString" include="Tensor/CXMF/CXMFString.h"/>
            <lang name="cpp" type="std::string" include="string"/>
            <lang name="java" type="XidString" include="com.telecomsys.tensor.xid.XidString">
                <tag name="native" value="String"/>
            </lang>
            <lang name="node" type="XidString"/>
        </type>

        <type name="datetime" size="8">
            <comment>
                nanoseconds since Jan 1, 1970 UTC.
                ISO-8601 for string formats (e.g. JSON).
            </comment>
            <artifact>https://www.iso.org/standard/40874.html</artifact>
            <artifact>https://wikipedia.org/wiki/ISO_8601</artifact>
            <artifact>https://xkcd.com/1179</artifact>
            <lang name="c" type="uint64_t" include="stdint.h"/>
            <lang name="cpp" type="::Tensor::Types::DateTime" include="Tensor/Types/DateTime.h"/>
            <lang name="java" type="XidDateTime" include="com.telecomsys.tensor.xid.XidDateTime"/>
            <lang name="node" type="XidDateTime"/>
        </type>

        <type name="UUID" size="16">
            <comment>16 byte UUID.</comment>
            <artifact>https://wikipedia.org/wiki/Universally_unique_identifier</artifact>
            <lang name="c" type="UUID" include="Tensor/CXMF/uuid.h"/>
            <lang name="cpp" type="::Tensor::Types::UUID" include="Tensor/Types/uuid.h"/>
            <lang name="java" type="XidUuid" include="com.telecomsys.tensor.xid.XidUuid"/>
            <lang name="node" type="XidUuid"/>
        </type>

        <type name="uri">
          <comment>Standard Universal Resource Identifier (URI)</comment>
          <tag name="TODO" value="Define uri as a custom type.  Use string for now."/>
          <lang name="c" type="CXMFString" include="Tensor/CXMF/CXMFString.h"/>
          <lang name="cpp" type="std::string" include="string"/>
          <lang name="java" type="XidString" include="com.telecomsys.tensor.xid.XidString"/>
          <lang name="node" type="XidString"/>
        </type>

        <type name="json">
          <comment>JSON formatted/encoded string</comment>
          <lang name="c" type="CXMFString" include="Tensor/CXMF/CXMFString.h"/>
          <lang name="cpp" type="::Tensor::JSON::JSONObj" include="Tensor/JSON/TensorJSON.h"/>
          <lang name="java" type="XidJSON" include="com.telecomsys.tensor.xid.XidJSON"/>
          <lang name="node" type="XidString"/>
        </type>

        <type name="xmf">
            <comment>XMF formatted/encoded data, this is straight XMF in XMF formatted data, and base64 encoded binary XMF in JSON formatted data. </comment>
            <lang name="c" type="CAtom" include="Tensor/CXMF/CXMF.h"/>
            <lang name="cpp" type="::Tensor::XMF::Atom" include="Tensor/XMF/Atom.h"/>
            <lang name="java" type="Atom" include="com.telecomsys.tensor.xmf.Atom"/>
            <lang name="node" type="Atom"/>
        </type>

        <type name="mac48" size="6">
			<artifact>https://wikipedia.org/wiki/MAC_address</artifact>
            <comment>6 byte IEEE MAC-48</comment>
            <lang name="c" type="MacAddress48" include="Tensor/CXMF/MacAddress48.h"/>
            <lang name="cpp" type="::Tensor::Types::MacAddress48" include="Tensor/Types/MacAddress48.h"/>
            <lang name="java" type="XidMacAddress48" include="com.telecomsys.tensor.xid.XidMacAddress48"/>
            <lang name="node" type="XidMacAddress48"/>
        </type>
    </namespace>

    <namespace name="XIDCG">
    <comment>
    The XIDCG namespace and &lt;type&gt; declarations are used internally by
    the code generators so that their datatypes are not hardcoded.
    </comment>
    <comment>
    DO NOT USE THESE TYPES in XID specs.
    </comment>

        <!-- These types are not intended to be used in XID declarations. -->
        <!-- They are used in XIDCG so that types are not hardcoded. -->
        <!-- In theory, you can override "Atom",etc. with your own API compatible implementation,
			 renerate and have a completely different encoding support.
			 For instance, this can be used to define and encode TCAP BER.
		-->
        <type  name="Atom">
            <comment>Atom type XIDCG uses </comment>
            <lang name="c" type="CAtom" include="Tensor/CXMF/CXMF.h"/>
            <lang name="cpp" type="::Tensor::XMF::Atom" include="Tensor/XMF/Atom.h"/>
            <lang name="java" type="Atom" include="com.telecomsys.tensor.xmf.Atom"/>
            <lang name="node" type="Atom"/>
        </type>
        <type  name="AtomListIF">
            <comment>AtomList type XIDCG uses </comment>
            <lang name="c" type="CAtomListBase" include="Tensor/CXMF/CXMF.h"/>
            <!-- <lang name="cpp" type="::Tensor::XMF::AtomList" include="Tensor/XMF/AtomList.h"/> -->
            <lang name="java" type="AtomListIF" include="com.telecomsys.tensor.xmf.AtomListIF"/>
            <!-- <lang name="node" type="AtomList"/> -->
        </type>
        <type  name="AtomList">
            <comment>AtomList type XIDCG uses </comment>
            <lang name="c" type="CAtomList" include="Tensor/CXMF/CXMF.h"/>
            <lang name="cpp" type="::Tensor::XMF::AtomList" include="Tensor/XMF/AtomList.h"/>
            <lang name="java" type="AtomList" include="com.telecomsys.tensor.xmf.AtomList"/>
            <lang name="node" type="AtomList"/>
        </type>
        <type  name="PackedAtomList">
            <comment>PackedAtomList type XIDCG uses </comment>
            <lang name="c" type="CPackedAtomList" include="Tensor/CXMF/CXMF.h"/>
            <lang name="cpp" type="::Tensor::XMF::PackedAtomList" include="Tensor/XMF/PackedAtomList.h"/>
            <lang name="java" type="PackedAtomList" include="com.telecomsys.tensor.xmf.PackedAtomList"/>
            <lang name="node" type="PackedAtomList"/>
        </type>
        <type  name="AtomListIterator">
            <comment>AtomList type XIDCG uses </comment>
            <lang name="c" type="CAtomListIterator" include="Tensor/CXMF/CXMF.h"/>
            <lang name="cpp" type="::Tensor::XMF::AtomListIterator" include="Tensor/XMF/AtomList.h"/>
            <lang name="java" type="AtomListIterator" include="com.telecomsys.tensor.xmf.AtomListIterator"/>
            <lang name="node" type="AtomListIterator"/>
        </type>
        <type  name="JSONObject">
            <comment>JSONObject type XIDCG uses </comment>
            <!-- <lang name="c" type="" include=""/> -->
            <lang name="cpp" type="::Tensor::JSON::JSONObj" include="Tensor/JSON/TensorJSON.h"/>
            <lang name="java" type="JSONObject" include="com.telecomsys.tensor.json.JSONObject"/>
            <!-- <lang name="node" type=""/> -->
        </type>
        <type  name="JSONArray">
            <comment>JSONArray type XIDCG uses </comment>
            <!-- <lang name="c" type="" include=""/> -->
            <!-- <lang name="cpp" type="::Tensor::JSON::JSONObj" include="Tensor/JSON/TensorJSON.h"/> -->
            <lang name="java" type="JSONArray" include="com.telecomsys.tensor.json.JSONArray"/>
            <!-- <lang name="node" type=""/> -->
        </type>
        <type  name="JSONException">
            <comment>JSONException type XIDCG uses </comment>
            <!-- <lang name="c" type="" include=""/> -->
            <!-- <lang name="cpp" type="::Tensor::JSON::JSONObj" include="Tensor/JSON/TensorJSON.h"/> -->
            <lang name="java" type="JSONException" include="com.telecomsys.tensor.json.JSONException"/>
            <!-- <lang name="node" type=""/> -->
        </type>
    </namespace>
</specification>