forked from cdkersey/chdl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodeimpl.h
More file actions
36 lines (26 loc) · 758 Bytes
/
Copy pathnodeimpl.h
File metadata and controls
36 lines (26 loc) · 758 Bytes
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
// Node implementation.
#ifndef __NODEIMPL_H
#define __NODEIMPL_H
#include <vector>
#include <iostream>
#include "node.h"
#include "hierarchy.h"
#include "cdomain.h"
namespace chdl {
struct nodeimpl;
extern std::vector<nodeimpl*> nodes;
struct nodeimpl {
nodeimpl() { id = nodes.size(); nodes.push_back(this); path = get_hpath(); }
virtual ~nodeimpl() {}
virtual bool eval(cdomain_handle_t) = 0;
virtual void print(std::ostream &) = 0;
virtual void print_vl(std::ostream &) = 0;
// The node keeps a copy of its ID. This makes mapping from nodeimpl
// pointers to node objects straightforward.
nodeid_t id;
// Where is this node in the hierarchy?
hpath_t path;
std::vector<node> src;
};
};
#endif