LOOS  v2.3.2
Kernel.hpp
1 /*
2  This file is part of LOOS.
3 
4  LOOS (Lightweight Object-Oriented Structure library)
5  Copyright (c) 2008, Tod D. Romo, Alan Grossfield
6  Department of Biochemistry and Biophysics
7  School of Medicine & Dentistry, University of Rochester
8 
9  This package (LOOS) is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation under version 3 of the License.
12 
13  This package is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 
23 
24 
25 
26 #if !defined(LOOS_KERNEL_HPP)
27 #define LOOS_KERNEL_HPP
28 
29 #include <vector>
30 
31 #include <loos_defs.hpp>
32 #include <exceptions.hpp>
33 
34 #include "KernelValue.hpp"
35 #include "KernelStack.hpp"
36 #include "KernelActions.hpp"
37 
38 namespace loos {
39 
41 
42  class Kernel {
43  std::vector<internal::Action*> actions;
44  internal::ValueStack val_stack;
45 
46  public:
47 
49  ~Kernel();
50 
52  void push(internal::Action*);
53 
54  void pop(void);
55 
57 
66  void execute(pAtom pa = pAtom());
67 
68  void clearActions(void);
69 
70  internal::ValueStack& stack(void);
71 
72  friend std::ostream& operator<<(std::ostream&, const Kernel&);
73  };
74 };
75 
76 
77 #endif
~Kernel()
The data stack...
Definition: Kernel.cpp:28
Base class for all commands...
void push(internal::Action *)
Add a command, setting the data-stack pointer...
Definition: Kernel.cpp:34
void execute(pAtom pa=pAtom())
Execute the stored commands for a specific atom.
Definition: Kernel.cpp:47
Namespace for most things not already encapsulated within a class.
The Kernel (virtual machine) for compiling and executing user-defined atom selections.
Definition: Kernel.hpp:42