IBM InfoSphere Streams Version 4.1.0

Creating an SPL project and an operator model for a C++ operator

An SPL project represents an SPL toolkit. Create an SPL project to store toolkit artifacts that are required for defining a C++ operator. The SPL project also contains the SPL application for running and testing the C++ operator.

Procedure

  1. Create an SPL project.
    1. From the menu bar, click File > New > Project.
    2. In the New Project window, expand InfoSphere Streams Studio, select SPL Project, and then click Next.
    3. In the Project name field, enter a name for the SPL project, and then click Finish.
  2. Create a primitive operator:
    1. In the Project Explorer view, right-click the SPL project that you created.
    2. Click New > SPL Primitive Operator.
    3. In the Name field, enter a name for the operator.
    4. To implement the primitive operator in C++ language, in the Operator language area, click C++. The SPL Primitive Operator wizard creates a primitive operator in the specified SPL project.

Results

When you create a primitive operator, the SPL Primitive Operator wizard generates the following artifacts. As an SPL application developer, you must edit these resources when you implement the C++ primitive operator.
Operator model
The operator model is an XML file that defines the attributes of the C++ operator. The operator model of the C++ operator is named as operator-name.xml and is generated in the namespace/operator/ directory.
Operator templates
The operator templates are the header and implementation files (*.cgt) that contain the operator logic. These files are generated in the namespace/operator/ directory.
Subdirectories to store the implementation of the C++ operator
Under the impl directory, a set of subdirectories is generated to store the implementation of the C++ operator:
  • impl/bin. This directory is used to store the binary files(*.o files) that are built.
  • impl/include. This directory is used to store the *.hpp files.
  • impl/lib. This directory is used to store the shared libraries (.so files) that are built for the C++ operator.
  • impl/src. This directory is used to store the *.cpp files.