pl_search_cpp 1.4
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
pl_search::PAtom Class Reference

Represents a Prolog atom. More...

#include <patom.hpp>

Inheritance diagram for pl_search::PAtom:
Inheritance graph
[legend]
Collaboration diagram for pl_search::PAtom:
Collaboration graph
[legend]

Public Member Functions

 PAtom (const std::string &name)
 Constructs a PAtom with the given name.
 
std::string getName () const
 Returns the name of the atom.
 
std::string repr () const override
 Returns a string representation of the atom.
 
bool isEqualTo (Term &t) const override
 Checks if the term is equal to another term.
 
bool isLessThan (Term &t) const override
 < operator for a PAtom and a Term
 
- Public Member Functions inherited from pl_search::Term
virtual TermPtr dereference ()
 Dereferences the term. The default is to return a shared pointer to term itself.
 
virtual bool unifyWith (Engine *engine, TermPtr t)
 A hook for unification of user-defined classes. Only override this method if you want to unify user-defined classes.
 
virtual bool is_var ()
 Checks if the term is a variable.
 
 Term ()
 Default constructor.
 
virtual ~Term ()
 Virtual destructor for proper cleanup.
 

Protected Attributes

std::string name
 The name of the atom.
 

Additional Inherited Members

- Protected Member Functions inherited from pl_search::Term
virtual Termderef_term ()
 Similar to dereference but returning the "raw" pointer.
 

Detailed Description

Represents a Prolog atom.

PAtom objects approximate Prolog atoms. Atoms are immutable and cannot be bound to other terms.

Constructor & Destructor Documentation

◆ PAtom()

pl_search::PAtom::PAtom ( const std::string &  name)
inline

Constructs a PAtom with the given name.

Parameters
nameThe name of the atom.

Member Function Documentation

◆ getName()

std::string pl_search::PAtom::getName ( ) const
inline

Returns the name of the atom.

Returns
The name of the atom.

◆ isEqualTo()

bool pl_search::PAtom::isEqualTo ( Term t) const
inlineoverridevirtual

Checks if the term is equal to another term.

Parameters
tThe term to compare to.
Returns
True if the terms are equal, false otherwise.

Implements pl_search::Term.

◆ isLessThan()

bool pl_search::PAtom::isLessThan ( Term other) const
overridevirtual

< operator for a PAtom and a Term

Parameters
otherThe term being compared
Returns
True if the this PAtom is < other, false otherwise.

Implements pl_search::Term.

◆ repr()

std::string pl_search::PAtom::repr ( ) const
inlineoverridevirtual

Returns a string representation of the atom.

Returns
A string representation of the atom.

Reimplemented from pl_search::Term.

Member Data Documentation

◆ name

std::string pl_search::PAtom::name
protected

The name of the atom.


The documentation for this class was generated from the following files: