QP Bundle version 7.1.3 with QM version 5.2.3.
Create a model with a simple class. For example, see the following model file:
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.3" links="0">
<framework name="qpcpp"/>
<package name="Simple" stereotype="0x00">
<class name="Class">
<operation name="Process" type="void" visibility="0x00" properties="0x00">
<code>// process here</code>
</operation>
</class>
</package>
<directory name=".">
<file name="SimpleClass.External.5.2.3.cpp">
<text>$declare(Simple::Class)
$define(Simple::Class)</text>
</file>
</directory>
</model>
Note that there is no newline after the "$define(Simple::Class)". Now if you generate the code, here is the result of the declaration and definition of the simple class (file header not included):
//${Simple::Class} ...........................................................
class Class {
public:
void Process();
}; // class Class
//$enddecl${Simple::Class} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//$define${Simple::Class} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${Simple::Class} ...........................................................
//${Simple::Class::Process} ..................................................
void Class::Process() {
// process here
}
//$enddef${Simple::Class} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Next, select the "external" check box to make the code generation externally saved in the cpp file and re-generate the code again. Here is the result of the declaration and definition of the simple class (file header not included):
//${Simple::Class} ...........................................................
class Class {
public:
void Process();
}; // class Class
//$enddecl${Simple::Class} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$define(Simple::Class
Change the source file to not be external and add a newline after the "$define(Simple::Class)".
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.3" links="0">
<framework name="qpcpp"/>
<package name="Simple" stereotype="0x00">
<class name="Class">
<operation name="Process" type="void" visibility="0x00" properties="0x00">
<code>// process here</code>
</operation>
</class>
</package>
<directory name=".">
<file name="SimpleClass.External.5.2.3.cpp">
<text>$declare(Simple::Class)
$define(Simple::Class)
</text>
</file>
</directory>
</model>
Now change the source file back to "external" and generate the code again. Here is the result of the declaration and definition of the simple class (file header not included):
//${Simple::Class} ...........................................................
class Class {
public:
void Process();
}; // class Class
//$enddecl${Simple::Class} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//$define${Simple::Class} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${Simple::Class} ...........................................................
//${Simple::Class::Process} ..................................................
void Class::Process() {
// process here
}
//$enddef${Simple::Class} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Anonymous
Fixed in QM 5.2.3.
--MMS