2.4 Overview (version 2)
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • A C++ interface to SWI-Prolog
        • A C++ interface to SWI-Prolog (Version 2)
          • Overview (version 2)
            • Design philosophy of the classes
            • Summary of files
            • Summary of classes
            • Wrapper functions
            • Naming conventions, utility functions and methods (version 2)
            • Limitations of the interface
            • Linking embedded applications using swipl-ld

2.4.2 Summary of files

The following files are provided:

  • SWI-cpp2.h Include this file to get the C++ API. It automatically includes SWI-cpp2-plx.h but does not include SWI-cpp2.cpp.

  • SWI-cpp2.cpp Contains the implementations of some methods and functions. It must be compiled as-is or included in the foreign predicate's source file. Alternatively, it can be included with each include of SWI-cpp2.h with this macro definition:
        #define _SWI_CPP2_CPP_inline inline
        

  • SWI-cpp2-plx.h Contains the wrapper functions for the most of the functions in SWI-Prolog.h. This file is not intended to be used by itself, but is #included by SWI-cpp2.h.

  • test_cpp.cpp, test_cpp.pl Contains various tests, including some longer sequences of code that can help in understanding how the C++ API is intended to be used. In addition, there are test_ffi.cpp, test_ffi.pl, which often have the same tests written in C, without the C++ API.