Fleet  0.0.9
Inference in the LOT
Public Member Functions | Public Attributes | List of all members
SExpression::SExpNode Class Reference

#include <SExpression.h>

Inheritance diagram for SExpression::SExpNode:
Inheritance graph
[legend]
Collaboration diagram for SExpression::SExpNode:
Collaboration graph
[legend]

Public Member Functions

 SExpNode ()
 
 SExpNode (const std::string &s)
 
 SExpNode (const SExpNode &s)
 
SExpNodeoperator= (const SExpNode &n)
 
SExpNodeoperator= (const SExpNode &&n)
 
virtual bool operator== (const SExpNode &n) const override
 
std::string get_label ()
 
virtual std::string string () const
 
- Public Member Functions inherited from BaseNode< SExpNode >
 BaseNode (size_t n=0, SExpNode *p=nullptr, size_t i=0)
 Constructor of basenode – sizes children to n. More...
 
 BaseNode (const SExpNode &n)
 
 BaseNode (SExpNode &&n)
 
void operator= (const SExpNode &t)
 
void operator= (const SExpNode &&t)
 
void make_root ()
 Make a node root – just nulls the parent. More...
 
virtual ~BaseNode ()
 
virtual std::string string (bool usedot=true) const
 
virtual std::string my_string () const
 
virtual bool operator== (const SExpNode &n) const
 
NodeIterator begin () const
 
NodeIterator end () const
 
virtual bool operator!= (const SExpNode &n) const
 
void reserve_children (const size_t n)
 
decltype(children) & get_children ()
 
decltype(children) const & get_children () const
 
SExpNode & child (const size_t i)
 
const SExpNode & child (const size_t i) const
 
void fill (size_t n, Args... args)
 
size_t nchildren () const
 
SExpNode * left_descend () const
 
size_t depth () const
 
void fix_child_info ()
 
void check_child_info () const
 
SExpNode & operator[] (const size_t i)
 
const SExpNode & operator[] (const size_t i) const
 
void set_child (const size_t i, SExpNode &n)
 
void set_child (const size_t i, SExpNode &&n)
 
void push_back (SExpNode &n)
 
void push_back (SExpNode &&n)
 
virtual bool is_root () const
 Am I a root node? I am if my parent is nullptr. More...
 
SExpNode * root ()
 Find the root of this node by walking up the tree. More...
 
SExpNode * get_via (std::function< bool(SExpNode &)> &f)
 Return a pointer to the first node satisfying predicate f, in standard traversal; nullptr otherwise. More...
 
virtual size_t count () const
 How many nodes total are below me? More...
 
virtual size_t count (const SExpNode &n) const
 How many nodes below me are equal to n? More...
 
virtual bool is_terminal () const
 Am I a terminal? I am if I have no children. More...
 
virtual size_t count_terminals () const
 
virtual SExpNode * get_nth (int n, std::function< int(const SExpNode &)> &f)
 
virtual SExpNode * get_nth (int n)
 
sum (std::function< T(const SExpNode &)> &f) const
 
sum (T(*f)(const SExpNode &)) const
 
bool all (std::function< bool(const SExpNode &)> &f) const
 
void map (const std::function< void(SExpNode &)> &f)
 
void show (size_t t=0) const
 

Public Attributes

std::optional< std::string > label
 
- Public Attributes inherited from BaseNode< SExpNode >
SExpNode * parent
 
size_t pi
 

Additional Inherited Members

- Static Public Attributes inherited from BaseNode< SExpNode >
static NodeIterator EndNodeIterator
 
- Protected Attributes inherited from BaseNode< SExpNode >
std::vector< SExpNode > children
 

Detailed Description

Author
Steven Piantadosi
Date
26/06/22

Constructor & Destructor Documentation

◆ SExpNode() [1/3]

SExpression::SExpNode::SExpNode ( )
inline

◆ SExpNode() [2/3]

SExpression::SExpNode::SExpNode ( const std::string &  s)
inline

◆ SExpNode() [3/3]

SExpression::SExpNode::SExpNode ( const SExpNode s)
inline

Member Function Documentation

◆ get_label()

std::string SExpression::SExpNode::get_label ( )
inline

◆ operator=() [1/2]

SExpNode& SExpression::SExpNode::operator= ( const SExpNode n)
inline

◆ operator=() [2/2]

SExpNode& SExpression::SExpNode::operator= ( const SExpNode &&  n)
inline

◆ operator==()

virtual bool SExpression::SExpNode::operator== ( const SExpNode n) const
inlineoverridevirtual

◆ string()

virtual std::string SExpression::SExpNode::string ( ) const
inlinevirtual

Member Data Documentation

◆ label

std::optional<std::string> SExpression::SExpNode::label

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