dol: initial dol commit
[jump.git] / dol / src / dol / visitor / PipeAndFilter / lib / ProcessWrapper.h
1 #ifndef _PROCESSWRAPPER_H_\r
2 #define _PROCESSWRAPPER_H_\r
3 \r
4 #include <stdio.h>\r
5 #include <stdlib.h>\r
6 #include "dol.h"\r
7 #include "Fifo.h"\r
8 #include "WindowedFifo.h"\r
9 \r
10 #ifdef INCLUDE_PROFILER\r
11 extern FILE *profiler_output_file;\r
12 extern unsigned int profiler_event_counter;\r
13 #endif\r
14 \r
15 class ProcessWrapper\r
16 {\r
17     public:\r
18         ProcessWrapper(char* name);\r
19         virtual ~ProcessWrapper();\r
20         virtual void initialize();\r
21         virtual int fire();\r
22         virtual bool isDetached() { return _isDetached; }\r
23         virtual void detach();\r
24         virtual int getIndex(unsigned indexNumber) const;\r
25         virtual char* getName() const;\r
26 \r
27 #ifdef INCLUDE_PROFILER\r
28         virtual void addToProfile(const char *event, void *port,\r
29                 int length);\r
30 #endif\r
31 \r
32 #ifdef INCLUDE_TRACE\r
33         int start_line;\r
34         int end_line;\r
35         char channel_name[NAME_LENGTH];\r
36 #endif\r
37 \r
38 #ifdef INCLUDE_PERFORMANCE\r
39         int start_line;\r
40         int end_line;\r
41         CURRENT_TIME start_time;\r
42         CURRENT_TIME end_time;\r
43 #endif\r
44 \r
45     protected:\r
46         char* _name;\r
47         DOLProcess _process;\r
48         bool _isDetached;\r
49         int _iteratorIndex[4];\r
50         virtual int getIndex(const char* string, char* tokens,\r
51                 int indexNumber) const;\r
52 };\r
53 \r
54 #endif\r
55 \r