Lines like the following are the basis of Middle code:

[ -out -in -no_inline -max_length= ] (T1, T2, ...  Tn)

Options start with a dash (-) symbol. After any options, a list of C++ types is enclosed in a pair of parentheses.

One or more of these lines are wrapped by a name and a closing brace (}) like this:


middle_messages_front
  -out            (bool)
  -out -no_inline (bool, ::std::string_view)
}

Based on that input, the C++ Middleware Writer (CMW) creates a middle_messages_front namespace in a file called zz.middle_messages_front.hh.

The out and in options are used to control the output. If you specify just -out, only the message-building/sending function is generated. If you specify just -in, only the message-parsing/receiving function gets generated. If you specify neither, both message-building and message-parsing functions will be created.

The no_inline option indicates that a generated function should not be marked as inline. If you only include a generated header in one translation unit, it's safe to use this option. If you have a message that you build in multiple places in a translation unit, using this option may reduce the size of your executable. The use of this option reduced the size of the CMW Ambassador's text segment by 128 bytes, which was about 0.3% of the total.

Use // to comment out a line of Middle code.