-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathinterpl.hh
More file actions
58 lines (51 loc) · 1.52 KB
/
interpl.hh
File metadata and controls
58 lines (51 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/********************************************************************
* Description: interpl.hh
* Mechanism for building lists of arbitrary NML messages, used by
* the canonical interface and interpreter to pass planned sequences
* to the HME.
*
* Derived from a work by Fred Proctor & Will Shackleford
*
* Author:
* License: GPL Version 2
* System: Linux
*
* Copyright (c) 2004 All rights reserved.
*
* Last change:
********************************************************************/
#ifndef INTERP_LIST_HH
#define INTERP_LIST_HH
#include <deque>
#include <memory>
#include <string>
class NMLmsg;
// these go on the interp list
struct NML_INTERP_LIST_NODE
{
int line_number; // line number it was on
// std::vector<char> command;
std::unique_ptr<NMLmsg> command;
};
// here's the interp list itself
class NML_INTERP_LIST
{
public:
void set_line_number(int line);
int get_line_number() const;
void set_filename(const std::string& s);
const std::string& get_filename() const;
int append(std::unique_ptr<NMLmsg>&& command);
std::unique_ptr<NMLmsg> get();
void clear();
void print();
int len();
private:
std::deque<NML_INTERP_LIST_NODE> linked_list;
int next_line_number = 0; // line number used to fill temp_node
int line_number = 0; // line number of node from get()
// NML_INTERP_LIST_NODE node; // pointer returned by get
std::string filename;
};
extern NML_INTERP_LIST interp_list; /* NML Union, for interpreter */
#endif