Developing C++ native functions

Native functions can be invoked from SPL by using the same syntax that is used for an SPL function.

See Native function artifacts for details on the artifacts that are involved in creating native functions. You create C++ functions that match the function signatures in the function.xml file.

The function model files have the following schema:
<xs:schema 
 xmlns="http://www.ibm.com/xmlns/prod/streams/spl/function"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common"
 targetNamespace="http://www.ibm.com/xmlns/prod/streams/spl/function"
 elementFormDefault="qualified"
 attributeFormDefault="unqualified">
 
 <xs:import namespace="http://www.ibm.com/xmlns/prod/streams/spl/common"
            schemaLocation="commonModel.xsd"/>
 
 <xs:element name="functionModel" type="functionModelType"/>
 
 <xs:complexType name="functionModelType"> 
   <xs:sequence> 
    <xs:element name="functionSet" type="functionSetType" minOccurs="1"
maxOccurs="unbounded"/>
   </xs:sequence> 
 </xs:complexType> 
 
 <xs:complexType name="functionSetType">
  <xs:sequence>
    <xs:element name="headerFileName" type="xs:string" minOccurs="0"
maxOccurs="1"/>
    <xs:element name="cppNamespaceName" type="xs:string" minOccurs="0"
maxOccurs="1"/>
    <xs:element name="functions" type="functionsType"/>
    <xs:element name="dependencies" type="dependenciesType" minOccurs="0"/>
  </xs:sequence>
</xs:complexType>

<xs:complexType name="functionsType">
  <xs:sequence>
    <xs:element name="function" type="functionType" minOccurs="1"
maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>

<xs:complexType name="functionType">
  <xs:sequence>
    <xs:element name="description" type="common:descriptionType"
minOccurs="0" maxOccurs="1"/>
    <xs:element name="prototype" type="prototypeType"/>
  </xs:sequence>
</xs:complexType>

<xs:complexType name="prototypeType">
  <xs:simpleContent>
    <xs:extension base="xs:token">
      <xs:attribute name="cppName" type="xs:token"/>
      <xs:attribute name="line" type="xs:unsignedLong"/>
      <xs:attribute name="column" type="xs:unsignedLong"/>
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>

<xs:complexType name="dependenciesType">
  <xs:sequence>
    <xs:element name="library" type="common:libraryType" minOccurs="1"
maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>

</xs:schema>