• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

1.6 Overview
All Application Manual Name SummaryHelp

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

1.6.3 Summary of classes

The list below summarises the classes defined in the C++ interface.

PlTerm
Generic Prolog term that wraps term_t (for more details on term_t, see Interface Data Types).

This is a “base class” whose constructor is protected; subclasses specify the actual contents. Additional methods allow checking the Prolog type, unification, comparison, conversion to native C++-data types, etc. See section 1.11.1.

For more details about PlTerm, see section 1.6.6

PlCompound
Subclass of PlTerm with constructors for building compound terms. If there is a single string argument, then PL_chars_to_term() or PL_wchars_to_term() is used to parse the string and create the term. If the constructor has two arguments, the first is name of a functor and the second is a PlTermv with the arguments.
PlTermv
Vector of Prolog terms. See PL_new_term_refs(). The [] operator is overloaded to access elements in this vector. PlTermv is used to build complex terms and provide argument-lists to Prolog goals.
PlAtom
Wraps atom_t in their internal Prolog representation for fast comparison. (For more details on atom_t, see Interface Data Types). For more details of PlAtom, see section 1.11.12.4.
PlFunctor
A wrapper for functor_t, which maps to the internal representation of a name/arity pair.
PlPredicate
A wrapper for predicate_t, which maps to the internal representation of a Prolog predicate.
PlModule
A wrapper for module_t, which maps to the internal representation of a Prolog module.
PlQuery
Represents opening and enumerating the solutions to a Prolog query.
PlException
If a call to Prolog results in an error, the C++ interface converts the error into a PlException object and throws it. If the enclosing code doesn't intercept the exception, the PlException object is turned back into a Prolog error when control returns to Prolog from the PREDICATE() macros. This is a subclass of PlExceptionBase, which is a subclass of std::exception.
PlFrame
This utility-class can be used to discard unused term-references as well as to do data-backtracking.
PlEngine
This class is used in embedded applications (applications where the main control is held in C++). It provides creation and destruction of the Prolog environment.
PlRegister
Encapsulates PL_register_foreign() to allow using C++ global constructors for registering foreign predicates.
PlFail
Can be thrown to short-circuit processing and return failure to Prolog. Performance-critical code should use return false instead if failure is expected. An error can be signaled by calling Plx_raise_exception() or one of the PL_*_error() functions and then throwing PlFail; but it's better style to create the error throwing one of the subclasses of PlException e.g., throw PlTypeError("int", t). Subclass of PlExceptionFailBase.
PlExceptionFail
In some situations, a Prolog error cannot be turned into a PlException object, so a PlExceptionFail object is thrown. This is turned into failure by the PREDICATE() macro, resulting in normal Prolog error handling. Subclass of PlExceptionFailBase.
PlExceptionBase
A “do nothing” subclass of std::exception, to allow catching PlException, PlExceptionFail or PlFail in a single “catch” clause.
PlExceptionFailBase
A “do nothing” subclass of PlExceptionBase, to allow catching PlExceptionFail or PlFail in a single “catch” clause, excluding PlException.

ClioPatria (version V3.1.1-51-ga0b30a5)