| |||
Home > Communication with C++ Code > Accessing C++ constructs from LISA+ > Changes required to your source code |
To make C++ class declarations and definitions visible in
LISA+ behaviors, add #include statements, referencing
the C++ header files, to the includes
section
of the component. Everything defined in these header files is visible
inside the bodies of all behaviors of the component. However, #defines
defined
in these headers are not visible outside of the behavior bodies
and cannot affect conditional compilation of LISA+ code. Additional
information on the includes
section is available
elsewhere in this document. See Appendix A Preprocessor.
Figure 3.1 shows
an example where a C++ component, MyCPPComponent
,
is imported into the LISA+ code for MyComponent. The LISA+ wrapper
code references the C++ header for the MyCPPComponent
model
in the
section.
To access the C++ object, use pointers. In Figure 3.1, a pointer, includes
*mycomp
,
is used to access the reset
function of the
MYCPPComponent C++ component.