hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
prepl.H
Go to the documentation of this file.
1 /********
2  * repl : I/O for a "machine REPL" between processes
3  ********/
4 
5 #ifndef HOBBES_IPC_REPL_HPP_INCLUDED
6 #define HOBBES_IPC_REPL_HPP_INCLUDED
7 
8 #include <string>
9 #include <unistd.h>
10 
11 namespace hobbes {
12 
13 class cc;
14 
15 struct proc {
16  std::string cmd; // the command that spawned this process
17  pid_t pid; // the local pid of the process being communicated with
18  int write_fd; // write to this to send remote proc messages
19  int read_fd; // read from this to get remote proc responses
20 };
21 
22 void spawn(const std::string&, proc*);
23 void procDefine(proc*, const std::string&, const std::string&);
24 void procEval(proc*, const std::string&);
25 void procTypeof(proc* p, const std::string& x);
26 void procTypeEnv(proc* p);
27 void procRead(proc*, std::ostream*, uint64_t waitUS = 0);
28 MonoTypePtr refinedType(const proc& p, const std::string& fname, const MonoTypePtr& hasty);
29 int invocationID(const proc& p, const std::string& fname, const MonoTypePtr& hasty);
30 
31 typedef std::pair<size_t, MonoTypePtr> PrepProcExpr;
32 PrepProcExpr procPrepareExpr(const proc&, const ExprPtr&);
33 
34 void runMachineREPL(cc*);
35 
36 }
37 
38 #endif
39 
PrepProcExpr procPrepareExpr(const proc &, const ExprPtr &)
Definition: prepl.C:437
void procTypeof(proc *p, const std::string &x)
Definition: prepl.C:356
int invocationID(const proc &p, const std::string &fname, const MonoTypePtr &hasty)
Definition: prepl.C:464
Definition: boot.H:7
pid_t pid
Definition: prepl.H:17
MonoType::ptr MonoTypePtr
Definition: type.H:71
int read_fd
Definition: prepl.H:19
std::pair< size_t, MonoTypePtr > PrepProcExpr
Definition: prepl.H:31
void procDefine(proc *, const std::string &, const std::string &)
Definition: prepl.C:345
void procTypeEnv(proc *p)
Definition: prepl.C:361
std::shared_ptr< Expr > ExprPtr
Definition: expr.H:58
void runMachineREPL(cc *)
Definition: prepl.C:309
MonoTypePtr refinedType(const proc &p, const std::string &fname, const MonoTypePtr &hasty)
Definition: prepl.C:411
Definition: cc.H:64
void procRead(proc *, std::ostream *, uint64_t waitUS=0)
Definition: prepl.C:365
int write_fd
Definition: prepl.H:18
void spawn(const std::string &, proc *)
Definition: prepl.C:30
void procEval(proc *, const std::string &)
Definition: prepl.C:351
Definition: prepl.H:15
std::string cmd
Definition: prepl.H:16