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

UpdatableVar implements what some Prologs call updatable assignment. More...

#include <pvar.hpp>

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

Public Member Functions

 UpdatablePVar (TermPtr t)
 
TermPtr dereference () override
 Dereferences the variable to find the actual term it points to.
 
- Public Member Functions inherited from pl_search::PVar
 PVar ()
 Constructs a PVar.
 
virtual bool bind (const TermPtr &t)
 Binds the variable to a term.
 
void reset (const TermPtr &t)
 Resets the variable to point at the supplied term.
 
bool is_var () override
 Checks if the term is a variable.
 
bool isLessThan (Term &other) const override
 Checks if the variable is less than another term.
 
int getVarId () const
 Returns the variable ID.
 
std::string repr () const override
 Returns a string representation of the term.
 
- Public Member Functions inherited from pl_search::Term
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.
 
 Term ()
 Default constructor.
 
virtual ~Term ()
 Virtual destructor for proper cleanup.
 

Protected Member Functions

Termderef_term () override
 Similar to dereference but returning the "raw" pointer.
 
- Protected Member Functions inherited from pl_search::PVar
virtual bool isEqualTo (Term &other) const override
 Checks if the term is equal to another term.
 

Additional Inherited Members

- Public Attributes inherited from pl_search::PVar
TermPtr value
 The value of the variable.
 
- Static Public Attributes inherited from pl_search::PVar
static int id = 0
 Static member to generate unique IDs for variables.
 
- Protected Attributes inherited from pl_search::PVar
int var_id
 The ID of the variable.
 

Detailed Description

UpdatableVar implements what some Prologs call updatable assignment.

Constructor & Destructor Documentation

◆ UpdatablePVar()

pl_search::UpdatablePVar::UpdatablePVar ( TermPtr  t)
inline

Member Function Documentation

◆ deref_term()

Term * pl_search::UpdatablePVar::deref_term ( )
inlineoverrideprotectedvirtual

Similar to dereference but returning the "raw" pointer.

Returns
A pointer to the dereferenced term. WARNING: This should only be used for testing as it returns the raw pointer of a shared_ptr.

Reimplemented from pl_search::PVar.

◆ dereference()

TermPtr pl_search::UpdatablePVar::dereference ( )
inlineoverridevirtual

Dereferences the variable to find the actual term it points to.

Returns
A pointer to the dereferenced term.

Reimplemented from pl_search::PVar.


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