knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
ListTerm.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_LIST_TERM_H_
7 #define KNOWROB_LIST_TERM_H_
8 
9 #include <vector>
10 #include <memory>
11 #include <ostream>
12 #include "Function.h"
13 
14 namespace knowrob {
19  class ListTerm : public Function {
20  public:
21  explicit ListTerm(const std::vector<TermPtr> &elements);
22 
23  static const AtomPtr &listFunctor();
24 
28  static std::shared_ptr<ListTerm> nil();
29 
33  bool isNIL() const;
34 
39  auto &elements() const { return arguments_; }
40 
44  auto begin() { return arguments_.begin(); }
45 
49  auto end() { return arguments_.end(); }
50 
51  // Override Printable
52  void write(std::ostream &os) const override;
53  };
54 }
55 
56 #endif //KNOWROB_LIST_TERM_H_
const std::vector< TermPtr > arguments_
Definition: Function.h:67
auto & elements() const
Definition: ListTerm.h:39
bool isNIL() const
void write(std::ostream &os) const override
static std::shared_ptr< ListTerm > nil()
ListTerm(const std::vector< TermPtr > &elements)
static const AtomPtr & listFunctor()
std::shared_ptr< Atom > AtomPtr
Definition: Atom.h:69