IBM Streams 4.2

spl-make-operator

The spl-make-operator command creates code generator modules from template files. The command can also create skeleton code generator templates and a default operator model if they do not exist.

Usage

Read syntax diagramSkip visual syntax diagram
spl-make-operator

>>-+-----------------+--+-------------+------------------------->
   '- -brief-opmodel-'  '-+- -h-----+-'   
                          '- --help-'     

>--+----------------------------+--+-------------------+-------->
   '-+- -i----------+--pathname-'  '-+- -k-----+--kind-'   
     '- --directory-'                '- --kind-'           

>--+---------------+-------------------------------------------><
   '-+- -s-------+-'   
     '- --silent-'     

Authority

You do not need any authority to run this command.

Description

You can use the spl-make-operator command to create skeleton code generator templates (.cgt files) and the default operator model (.xml file) as a starting point.

The command is designed to run in the directory that contains the primitive operator artifacts. Based on the directory name, it figures out the name of the operator. If you have template files named opname_h.cgt and opname_cpp.cgt, this command creates code generator modules named opname_h.pm and opname_cpp.pm. This step can be deferred to toolkit indexing or completely skipped. In the latter case, the SPL compiler creates the code generator templates the first time they are used as part of an application compilation. This early generation eases the development of operator code generator templates by providing quicker turnaround for the change, compile, or debug cycle. This early generation might not be always possible if the toolkit directory is read-only when the SPL compiler is launched by a developer. Thus, it is advisable to create and include the code generator templates in a toolkit. spl-make-operator also checks the code generator templates for any errors in the Perl code, as part of creating the code generators.

Options and arguments

--brief-opmodel
Specifies to not generate sample sections in the operator model.
-h, --help
Specifies to show the command syntax and help information.
-i, --directory pathname
Specifies the path that contains the operator artifacts. By default, the command uses the current directory.
-k, --kind kind
Specifies to generate templates for a specific type of operator. The following values are valid:
  • c++: A non-generic C++ operator.
  • generic: A generic mixed-mode C++ operator.
  • java: A non-generic Java™ operator.
-s, --silent
Specifies to create skeleton code generator templates for missing artifacts without prompting the user.

Examples

The following example creates a generic Foo operator in the sample.oper namespace:
spl-make-operator -k generic -i sample.oper/Foo